One often has a need to see the list of all Linux Packages Installed on your system. If your OS is Ubuntu flavored then you can use the command

sudo apt list --installed

The above command will spit out details of all the different packages installed on your system. If you want to just see the names (listing) of all the packages without the details use the command..

sudo apt list --installed 2>/dev/null | cut -d/ -f1 | grep -v Listing

If you want to see the list of packages that are upgradeable then use

sudo apt list --upgradeable 2>/dev/null | cut -d/ -f1 | grep -v Listing

If you want to now update (upgrade) all the packages which are upgradeable, to their latest versions from already configured sources, then run the following two commands..

sudo apt update
sudo apt upgrade

Now apt upgrade only updates the already installed packages, it does not remove existing versions or install any dependency packages. If you want to do a more complete upgrade i.e. install any new dependencies or remove conflicting packages then after doing sudo apt update execute the following command instead

sudo apt dist-upgrade

Notice the use of the sudo keyword / command prior to the actual apt commands. sudo is part of the Linux / Unix privilege management system and should be used instead of using the su command which is a way to become superuser (administrator) on Linux and Unix systems. sudo is the preferred way to elevate privileges, see the following blog for more information on su and sudo,your%20security%20and%20compliance%20protocol.

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x