All operating systems contain packages that are necessary for software and applications to be installed and run. Packages are a collection of scripts and files that are needed to run an application and are compressed in nature. Ubuntu needs to unpack the packages, or in other words, install and/or update the applications.

On Windows, users are generally provided an executable setup file that installs, and if needed, updates the software. On Linux, the package needs an opener and an installer. It is not very complicated, but new users can feel a bit overwhelmed.

For Ubuntu users, packages can either be updated via terminal, or by using the updater GUI. Using the package updater helps regular users with updating their apps without much room for error. Developers, however, can use the command line to update their packages. Using the GUI feels nicer, though, to be honest.

Let’s look at how to upgrade packages via the command line easily.

Updating Packages via the Command Line

You just need a couple of lines of code to update and upgrade your packages. If you just want to update security packages, that can be done as well.

Open the command line using Ctrl+Alt+T and type in the following line:

sudo apt update

You will be asked for your password to proceed. You have to type it into the terminal and hit enter.

This command updates the index files of your packages. This means the list of all available updates for your application packages will be updated to the latest date. You are not supposed to stop the process at this point. This DOES NOT upgrade your application packages. To upgrade your packages, you have to do a few more steps.

apt list --upgradable

This command shows you which packages can be updated.

If you wish to update a single package from the terminal, enter the following command:

sudo apt-get --only-upgrade install

Here, is to be substituted with whatever the name of the package you are trying to update is. This will update the given package only if it is installed. If the package does not exist in the index, you may choose to leave out the “–only upgrade” command. This ensures that the package is installed regardless of the index.

If you want to upgrade all the packages, type in the following:

sudo apt upgrade

This will bring another prompt for password confirmation. Enter your password, hit enter, and continue. The time required to update will be shown, and the terminal will once again ask for your confirmation. Enter y if yes or n if no.

If you press y, the terminal will first download the necessary upgrade and start upgrading your package(s).

If you wish to do this using a simpler method, just type in this command:

sudo apt update && sudo apt upgrade -y

The “&&” just groups two of the main commands into one line, for ease of updating your packages. You will still need your password to proceed. The command before the “&&” is executed first, so make sure you enter the correct line before it.

This was how to install package updates using the command prompt in just a few steps. If you want to see the graphical representation of the update process, you can use the updater GUI to update your packages.

Updating Packages via Package Updater

In the menu, go to the search bar and enter “Software updater”. This will open up the GUI for updating packages. It will automatically check whether any updates are available to install.

If such an update is available, you will be asked if you want to install it. Click on “Install Now”. You will be asked for your password, just like when updating via the command line. Enter the password and click on “Authenticate”. This will run the installer. Ubuntu will now download and install the selected packages.

Ubuntu may require you to restart your system to ensure proper installation.

After installation, some packages are left obsolete. These are packages that were present before upgrading. These can be deleted to gain space in your storage. To do so, in the command prompt, enter:

sudo apt autoremove

This will ensure your system is free of clutter and runs smoothly.

Conclusion

As we have seen, updating packages is very easy on Ubuntu, even if it is done using the command line. This method applies to Ubuntu and all of its distros. Ubuntu is a lot more safer and secure than Windows when it comes to package installation and updating, as it requires password permission for it.

Ubuntu is a very safe alternative to other operating systems as it is more stable with its updates and is also more secure due to it being open-source. Installing softwares and updating need not be as hard as people say it is.

Categorized in:

Linux,