Linux show installed packages

How do I see what packages are installed on Ubuntu Linux?

I am a new Ubuntu Linux server user. My server hosted at Google cloud VM. How do I see what packages are installed on Ubuntu Linux?

Introduction: Ubuntu Linux is an open source operating system based upon the Linux kernel and GNU command line utilities. Ubuntu Linux is extremely popular among new Linux users as well as developers all around the globe. This page shows how to list all installed packages with apt command or apt-get command on Ubuntu Linux.

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Debian or Ubuntu Linux
Est. reading time 5 minutes

You need to use the apt or apt-get or dpkg command to list all installed packages on an Ubuntu Linux server from the bash shell prompt.

How do I see what packages are installed on Ubuntu Linux?

The procedure to list what packages are installed on Ubuntu:

  1. Open the terminal application or log in to the remote server using ssh (e.g. ssh user @ sever-name )
  2. Run command apt list —installed to list all installed packages on Ubuntu
  3. To display a list of packages satisfying certain criteria such as show matching apache2 packages, run apt list apache

Let us see some examples about how to list installed packages on Ubuntu and Debian Linux operating systems.

apt list installed packages

Let us list all software packages on Ubuntu Linux available for us:
$ apt list

You might want to use the grep command/egrep command to filter out:
$ apt list | grep nginx
OR
$ apt list | more
However, you may see message on screen that read as follows:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

To avoid this message use the dpkg command as follows:
$ dpkg —list | grep nginx
$ dpkg —list | more

List all installed packages only

The apt command displays both installed and packages available to install. What if you want to list currently installed software only? Fear not, pass the option to the apt command:
$ apt list —installed

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

How to list or find out if a specific package installed or not

Run package policy as follows:
$ apt list -a pkgNameHere
Is sudo package installed?
$ apt list -a sudo
Is sudo package mariadb-server?
$ apt list -a mariadb-server

Ubuntu list installed packages

It is also possible to list installed packages matching given pattern. The syntax is:
dpkg -l pattern
dpkg —list pattern
apt list pattern
apt list —installed pattern
For example:
dpkg —list ‘x*’
Sample outputs:

  • ii – Indicates that package named xauth installed.
  • un – Indicates that package not installed or in Unknown status.

Listing installed packages sorted by installation date and time

There is no simple command, but we can use the combination of zgrep and other commands as follows. Let us count it:

Total installed packages on nixcraft-wks01 : 6433
List them:
zgrep » installed » /var/log/dpkg.log*

Please note that zgrep will search possibly compressed files for a regular expression as those log files are compressed by system. Hence, we need to use various z commands on Linux. See “How to find out when Debian or Ubuntu package installed or updated” for more info.

Conclusion

You learned how to list both installed and uninstalled packages on an Ubuntu Linux server or desktop using the CLI method. See the following man pages using the man command:
man apt
man apt-get
man dpkg

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

How To List Installed Packages In Ubuntu, Debian, Kali, Mint

Ubuntu, Debian, Kali and Mint distributions uses apt-get and dpkg commands for package management. We generally use this commands to install or remove packages from Linux systems. But in some cases we may need to list and count installed packages. In this tutorial we will look how to list and count all ready installed packages in Ubuntu, Debian, Kali and Mint.

List Installed Packages and Details with dpkg

We will start with dpkg package manager in order to list installed packages. We will use -l option which will list installed packages with their details. The detailed will provide following information.

List Installed Packages and Details with dpkg

  • name the package name
  • Version the package version number
  • Architecture the package cpu architecture
  • Description brief information about package

List Installed Packages Names Only with dpkg-query

As we have seen previous example dpkg will list a lot of information. But this will be problem in some cases and we will need only the package name. We can use dpkg-query to only list package names. We also provide some regex for this like below.

List Installed Packages Names Only with dpkg-query

List Installed Packages Names Only with dpkg

We can also list only installed package names with dpkg too. We will use —get-selections option and some grep to remove lines those contains deinstall like below.

List Installed Packages Names Only with dpkg

List Installed Packages and Details with apt-get or apt

We can also use apt or apt-get inorder to list installed packages and their details. In this example we will use apt and list command by providing —installed parameter to list installed packages.

List Installed Packages and Details with apt-get or apt

Count Installed Packages with dpkg

We can also count installed packages by simply using wc command. In this example we will list installed package count with dpkg command.

Count Installed Packages with dpkg

Count Installed Packages with apt-get

We can also use apt and apt-get for installed package counting like below.

Search and Filter In Installed Packages with dpkg and grep

What if we are looking for a specific package and want to list wheter it is installed or not. We can search or filter installed packages with dpkg and grep .

Search and Filter In Installed Packages with apt and grep

We can filter installed packages with apt or apt-get and grep too.

Search and Filter In Installed Packages with apt and grep

Save Installed Packages List To A File

As a system administrator we generally need to migrate, clone or setup similar systems with required packages. We can get list of installed packages and install them another system easily. We save installed package names to a file like below.

Install Packages From List File with dpkg

We can restore given file which contains package names we want to install like below. We will use —set-selections .

Источник

How to List Installed Packages on Ubuntu 20.04

With Ubuntu, we can install several add-on packages based on our needs. Packages such as Apache, PHP, and MySQL do not come pre-loaded with the Linux operating system. These additional features, however, can be easily installed using the respective packages. You may also choose to have a specific version installed on your Linux OS.

There may be certain instances where you will want to replicate the environment from one machine to another. In such cases, you will need to list installed packages and their versions.

Similarly, you may want to reinstall the Linux operating system on your machine, which will require you to install the packages again.

If you are planning to install, uninstall, or reinstall packages, the first step should always be to first list the installed packages. This lets you verify the installed version of the package and cross verify in case a specific package needs to be updated.

Listing the installed packages on Ubuntu can be done in several ways. This article will show you a number of ways to do it using your terminal.

Using APT to List Installed Packages on Ubuntu

Ubuntu uses apt which is a command-line tool to help package management. apt was introduced in Ubuntu 14.04. Following this version, the apt command can be used to list the installed packages.

The command to list installed packages will be:

This will list all installed packages and their versions. The complete installed packages list will most likely be very long, exceeding your scrollable screen.

You can restrict the list installed output by using less. This will show a smaller output. The Linux command for this will be separated by a pipe (|). An example of this is as shown below:

While less does compress your output, it will still provide a list of the installed packages. To search for any specific package, you can use grep along with the package listing.

For instance, if you want to list all the PHP installed packages, use the following command:

Then, to view more information about a specific package, use the following command:

Using dpkg-query to List Installed Packages on Ubuntu

In case you have an older version of Linux Ubuntu installed and can’t use the apt tool, use the dpkg-query command. This also lists the installed packages. The basic dpkg command would be:

This output will similarly provide package names and their versions with a brief description of the package.

You can use less with this command to show a smaller output. The dpkg command for this would be:

With grep included in this command, you can search for specific packages. The command would look like this in the command line:

For example, to list installed PHP packages, simply type:

Create a List of Installed Packages on Ubuntu

There may be a need to create a complete list of installed packages and have that package list saved in a file. The command below saves a complete output to a file:

Alternatively, you can also try another command:

While this helps you track the packages installed on your machine, it can also be used to replicate the installation on other machines. You can use this to install the same packages to a new server. To do that, use the following command after placing completePackage.txt on the new machine:

This can also be done using apt. To get all the installed packages in a file you can use the command shown below:

Once we have this in a file, we can install everything on another server using the command:

Count the Installed Packages on Ubuntu

You may need to count the number of installed Linux packages. This can be done similarly to the command above. Not by redirecting the output to a file, but by using wc to get the count.

An example of such command is as shown below:

The output will be the total number of installed packages. Similarly, you can use the command below with apt to get the total number of installed packages.

How to List Upgradeable Packages

Using apt, you can also check newer package versions that are available for installation. This can be done using the command below:

List All Versions

In case you have multiple versions installed, you can list all the versions installed using apt. This can be done using the below command:

Within /var/log/apt folder, you can list the history.log file to check information about what package has been removed, updated, and deleted, and at what time and which day.

Snap and Flatpak Packages

Since apt and dpkg commands will not be able to list Linux Snap and Linux Flatpak packages, we will need to use slightly different commands.

To list the Linux Snap packages installed, use the following command:

Similarly, to list the Linux Flatpak packages installed, use the following command:

Wrapping Up

You now know some basic Linux commands to see what packages are installed on your Linux Ubuntu 20.04 machine. You can list all installed packages by using different commands. Give it a try and let us know how it goes in the comments below.

Edward is an expert communicator with years of experience in IT as a writer, marketer, and Linux enthusiast. IT is a core pillar of his life, personal and professional. Edward’s goal is to encourage millions to achieve an impactful online presence. He also really loves dogs, guitars, and everything related to space.

Источник

Apt-Get List Installed Packages | List Installed With Apt on Ubuntu

Apt-Get List Installed – step by step tutorial. Apt is a command-line interface that allows you to perform actions such as installing new software packages, removing unnecessary software packages, updating the existing software packages, searching for specific software packages etc. on a Linux VPS running Debian as an operating system or Debian-based Linux distributions like Ubuntu. In this tutorial, we will show you how to list all installed packages with apt on Ubuntu (show all installed software on your VPS).

Table of Contents

1. List the installed software packages on Ubuntu

First of all, connect to your Linux server via SSH. To list the installed software packages on your machine you can use the following command:

The output of the command will be very similar to the following one, depending on which packages are currently installed:

2. Use the LESS program

To easily read the entire output you can use the less program.

3. Use the GREP Command

You can look for a specific package through the output using the grep program.

4. List all packages that include Apache

The output from the above command will list all packages that include apache in their names.

Apt supports patterns to match package names and options to list installed (—installed) packages, upgradeable (—upgradeable) packages or all available (—all-versions) package versions.

5. Use the DPKG program

Another alternative that you can use to list the installed software packages on your Ubuntu VPS is the dpkg command.

The output of the command will provide you with information such as the name of the package, version, architecture, and a short description of the package. Of course, you can use the grep program again to search for a specific package.

The output should look like the one below:

With the competition of this tutorial, you have successfully learned how to list installed packages in Ubuntu.

If you’d like to list all installed packages on your CentOS VPS, then check our yum tutorial.

Of course, you don’t have to list all Installed packages with apt on Ubuntu if you use one of our Managed Linux Hosting services, in which case you can simply ask our expert Linux admins to list all installed packages with apt on Ubuntu and export it for you. They are available 24/7 and will take care of your request immediately.

If you liked this post on How to List All Installed Packages with apt on Ubuntu, please share it with your friends on the social networks using the buttons below or simply leave a reply. Thanks.

Источник

Читайте также:  Linux узнать размер папки команда
Оцените статью