Linux Mint

Linux Mint 20 Update all Packages from Command Line

Whenever you are using any software or even a hardware device, you must have experienced people advising you for staying up to date. This is so because most of the time, the issues that we face while using any software or hardware are not necessarily because of the entire system rather, they are only with a small component that can easily be fixed by updating that particular component instead of changing the hardware or software altogether.

This is exactly why we are always asked to update our operating systems before installing any new software or package on them. This is required for the smooth functioning of your newly installed packages. Therefore, in this article, we are going to walk you through the method of updating all the packages from the command line while using Linux Mint 20.

Method of Updating all Packages from Command Line in Linux Mint 20:

For updating all packages from the command line in Linux Mint 20, you will need to perform the following steps:

  • Although you can update the packages using the GUI in Linux Mint 20, however, since this method is directed towards the use of the command-line interface, therefore, we will launch the terminal either by using the Ctrl+ Alt+ T keyboard shortcut or by clicking on the terminal icon located on the taskbar of Linux Mint 20. The newly opened terminal window is shown in the following image:

  • As we all know, that before installing any new packages, we must update our Linux Mint 20. For doing that, type the following command in your terminal and then press the Enter key:
sudo apt-get update

The update command cannot run properly without providing it with root privileges. That is why be sure to use the “sudo” keyword before this command. It is also shown in the image below:

  • This command will take some time to execute depending on how recently you ran this command before and also on how good your Internet connection is working at the moment. Once all the relevant packages have been updated successfully, you will be able to see the output shown in the following image on your terminal window:

  • The next step in this regard is to upgrade your Linux Mint 20 system. For doing that, you will need to type the following command in your terminal and then press the Enter key:
sudo apt-get upgrade

The upgrade command also requires root privileges to function properly because certain packages cannot be upgraded without providing root permissions. That is why we have used the “sudo” keyword before it. This command is also shown in the image below:

  • During the execution of this command, you will also be asked once to provide your consent to carry on with this upgrade. All you have to do is to type in “Y” for agreeing to proceed with the up-gradation process. As soon as all the necessary packages are upgraded successfully, your terminal window will look something like shown in the following image:

  • However, at times, the upgrade command mentioned above fails to execute properly, maybe because of longer response times. To prevent such a situation from happening or even if it has already happened, you can still get this issue fixed by typing in the following command in your terminal and then pressing the Enter key:
sudo apt-get dist-upgrade

The major focus of this command is to install the most important packages and dependencies while ignoring the less important ones, if needed, to prevent any failures. This command is shown in the image below:

  • Again, during the execution of this command, you will be asked to provide your consent by typing in “Y” in your terminal, after which the execution of this command will complete successfully. This is also shown in the following image:

  • At times, you do not want to upgrade all the packages; rather, you only want the security-related packages to be upgraded. For doing that, type the following command in your terminal and then press the Enter key:
sudo apt-get install unattended-upgrades

This command is also shown in the image below:

  • Once this command is executed successfully, your terminal window will look something like this:

Conclusion:

By following the simple steps described in this article, you can easily keep your Linux Mint 20 up to date by updating and upgrading all the necessary packages in it. You can even install only the security updates if you do not want all other packages to be updated using this method. This method is quite quick and convenient to follow. The only time that will be taken to follow this method will be because of a slow running Internet connection. However, if you have a good Internet connection, you can have all your packages updated from the command line while using Linux Mint 20 within no time.

About the author

Karim Buzdar

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn.