How to List Installed Packages in Ubuntu With APT – MUO – MakeUseOf

Here’s how you can use Ubuntu’s default package manager to get a list of packages currently installed on your system.
When you want to remove unwanted software from your system, having a list of all installed packages right in front of you can help. On Ubuntu, APT makes it easier for users to get a list of packages currently installed on their system.
In this guide, you will learn how to list installed packages on Ubuntu using APT, the default package manager on Debian-based distributions.
To output a list of packages that are currently installed, are upgradeable, or available on Ubuntu, you can use the list method of the APT command. To only print packages installed on your system, specify the –installed flag with the command.
Output:
The output generated by the aforementioned command contains additional information, including the version number and package state.
To get a clean output suitable for use in scripts and output transfer, you can use string manipulation tools like sed or awk. For example, to print only the package names:
Output:
Related: These sed Examples Will Make You a Linux Power User
You can also count the total number of packages. All you have to do is pipe the output of the aforementioned command with wc. Word count, abbreviated wc, is a Linux utility that counts the number of characters, words, or lines present in a text file.
Output:
As you can see in the output above, 2177 Linux packages are currently installed on the system.
Users running older versions of Ubuntu can use the dpkg-query command to get a list of installed packages.
Dpkg will present the output in a clean, tabular format by default.
To strip out additional information and print only the names of the packages, run the following command:
Output:
Learn More: What Is the Difference Between APT and dpkg in Ubuntu?
In addition to the list method, APT has several other functions that provide information associated with Linux packages. It also takes away the headache of removing unnecessary dependencies by keeping records of installed and uninstalled packages on your system.
Like APT, several other package managers are available for Linux, including DNF, pacman, and YUM. Most Debian-based distros ship with APT, while Arch Linux and RHEL-based systems use pacman and DNF as their default package managers respectively.
Deepesh is the Section Editor for Linux at MUO. He writes informational guides on Linux, aiming to provide a blissful experience to all newcomers. Not sure about movies, but if you want to talk about technology, he’s your guy.
Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

source

LINXGO
Logo
Compare items
  • Total (0)
Compare