Package Management Basics - Part 5
Login | Register RSS

In this installment of our Linux package management basics tutorial, we will be covering how to obtain a list of packages installed on your specific system.  This will teach you the different ways in which a list can be obtained.  This is very handy when want to do audit your system, review what is currently installed, include a list of the installed packages in a data backup, &/or if you want to install the same list of packages on another system.

* NOTE: All of the example commands below assume you are performing them as 'root' or some other authorized administrative user.  You can also perform these commands through 'sudo', if you do not wish to login directly as 'root'.  To do this via 'sudo', simple prepend the word 'sudo', followed by a space, before the given command.

Obtain list of installed packages:

To obtain a list of installed packages through the 'yum' command, enter this:

yum list installed;

To obtain a list of of installed RPMs through the 'rpm' command, enter this:

rpm -qa;

You can pipe these commands though the 'more' or 'less' command, to read the results one page at a time.  Some examples include:

yum list installed | more;
yum list installed | less;

rpm -qa | more;
rpm -qa | less;

You can also redirected the output to a file, instead of the screen.  This will allow you to write the list of installed packages directly to a file.  Some examples of how to do this are:

yum list installed > .installed_rpms.txt;

rpm -qa > .installed_rpms.txt;

As you can see its pretty easy to see what is installed to your system.  Once you have a list of the packages that are installed, it opens up new ways you handle things.  For example, I include a current list of the system's installed packages in every data backup.  This permits me to more quickly rebuild a workstation/server in the event of a system failure.  I can take the package list & use it to bulk install the same packages on a system quickly.  I also use the list to help audit a given system & decide what packages are no longer needed on that system.

In the next installment, we will cover how to remove packages that are no longer needed on the given system.

If you like this site or any of its content, please help promote it. Use the social media buttons below to help spread the word. Don't forget to post in the comments section.

  Print   Email