Arch Linux

List Installed Packages with Pacman on Arch Linux

Pacman is the tool for managing softwares on Arch Linux. It can use Pacman to install, remove, update individual software packages and also update the whole system if you want. You can also find out what software packages are installed on your Arch Linux system using Pacman.

In this article, I will show you how to generate a list of installed packages on your Arch Linux machine with Pacman. Let’s get started.

Why Generate a List of the Installed Packages?

Now you may ask, “hey what’s the point of generating a list of all the installed packages on Arch Linux?”. Well, it is mainly used to report bugs. You may need to send it to Linux experts if you face any problems with your Arch Linux machine that you can’t solve yourself.

You can also generate a list of packages installed on your system and install these in other Arch Linux machine using that list. That’s a lot easier than figuring out manually what is installed on one system.

Generating a List of Installed Packages using Pacman

You can generate a list of all the installed packages of your Arch Linux system with the following command:

$ pacman -Q

You should see something like this.

The package information is divided into 2 columns. The first column is the name of the installed packages and the second column is the version of the installed packages as you can see in the green and blue marked sections respectively in the screenshot below.

The list is quite long. You may want to export it to a file or pass it to a pager like less.

To export the list to a file, run the following command:

$ pacman -Q > my_arch_packages.txt

NOTE: The list should be saved to my_arch_packages.txt file in your current working directory.

Listing Only the Later Installed Packages

You can also generate a list of packages that are installed later (after you installed Arch Linux) using Pacman.

To list later installed or explicit packages, run the following command:

$ pacman -Qe

To leave more system packages, you may filter out more packages with the following command:

$ pacman -Qet

To export the list to a file, just redirect the output as follows:

$ pacman -Qe > packages.txt
or
$ pacman -Qet > packages.txt

Generating a List of Only the Installed Package Names

You can generate a list of all the installed package name. In other words, only the first column using any of the following commands depending on your need:

$ pacman -Q | awk '{print $1}'
$ pacman -Qe | awk '{print $1}'
$ pacman -Qet | awk '{print $1}'

You should see the following outputs:

Also export it to a file packages.txt with one of the following commands depending on your need:

$ pacman -Q | awk '{print $1}' > packages.txt
$ pacman -Qe | awk '{print $1}' > packages.txt
$ pacman -Qet | awk '{print $1}' > packages.txt

That’s how you list installed packages with Pacman on Arch Linux. Thanks for reading this article.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.