Ubuntu is quite a famous distribution that assists its audience with a variety of built-in functionalities. However, these functionalities are outdated with time. Therefore, updating these features is essential to fulfilling the needs of users. It is quite useful to fix bugs, upgrade applications, and resolve security issues.
This guide will demonstrate the step-by-step instructions to install updates in Ubuntu via the command line interface. The content of this guide is mentioned below:
Let’s start the installation process:
How to Install Updates in Ubuntu via Command Line?
If you are new and wondering about updating the Ubuntu packages with all their dependencies. The guidelines are provided here to install updates in Ubuntu via the command line:
Step 1: Open the Terminal
In Ubuntu, the command line interface is accessed through the “CTRL+ALT+T” shortcut key or “Show Applications” button:
Step 2: Display Available Updates in Ubuntu
To extract the latest version of packages with their dependencies, the script is provided below that does not install or download any of these updates:
$ sudo apt update
Note: The apt-get and apt-aptitude commands can also be used as alternatives.
Step 3: Install Updates in Ubuntu
To install updates in Ubuntu, the “sudo apt upgrade” script is utilized to download outdated dependencies and packages of the system. The command is provided below for the installation process:
$ sudo apt upgrade
Hit the “Y” key to continue the further process. It automatically downloads the required packages and installs the latest updates.
Step 4: Reboot Ubuntu
To reboot the Ubuntu operating system, execute the useful script to integrate the latest update with system dependencies:
$ sudo reboot
Note: The “sudo apt full-upgrade” command also installs updates but removes some packages.
How to Display Upgraded Packages?
To display the list of packages that can be upgraded in the future, the below script can be carried out:
$ apt list -- upgradable
How to Upgrade a Specific Package?
Suppose you want to upgrade a specific package. In that case, you can use the apt-get install command with the “–only-upgrade” option and the name of the package:
$ sudo apt install --only-upgrade <package-name>
Replace <package-name> with the actual name of the package you want to upgrade. In our case, upgrade the “python3” package by executing the below script:
$ sudo apt install --only-upgrade python3
You may be asked to confirm the installation and to enter your password, type the password, and hit the Enter button to continue.
That is all from the installation of updates in Ubuntu.
Conclusion
In Ubuntu, the “sudo apt upgrade” command is utilized to install the updates via the command line interface. It automatically downloads all the latest versions of required packages with their dependencies and upgrades the packet management system. Additionally, users can display the required package list via the “sudo apt update” command. This guide has explained all the required steps to install updates in Ubuntu using the command line interface (terminal).