In CentOS systems you can list installed packages using the yum list installed and rpm -qa commands.įeel free to leave a comment if you have any questions. The output above shows that there are 603 packages installed. Utility to count the lines: sudo rpm -qa | wc -l 603 To find out how many packages are installed on your system, use the same command as before but instead of redirecting the output to a file, pipe it to the wc To install the same packages on another server you can use the catĬommand to pass all packages to yum: sudo yum -y install $(cat packages_list.txt) Count the number of installed packages # To create a list of the names of all installed packages on your CentOS system and save it in a file named packages_list.txt, redirect the command output to the file: sudo rpm -qa > packages_list.txt To get more information about the queried package pass -i: sudo rpm -qi tmux Create a List of all Installed packages # Otherwise, the command will print: package tmux2is not installed We will learn how to use yum from the command line. If the package is installed, you will see something like this: 86_64 Specifically, we will discuss the yum package manager to search, install, and update a software package. Package is installed on the system: sudo rpm -q tmux If the particular mirror lsited here is dead, you can simply find another mirror by returning to the list of mirrors and follow the same logic. The following command will show you whether the tmux I started with this, which got me a list of CentOS mirrors, and then picked the first mirror. To query (search) whether a certain package is installed pass the package name to the rpm -q command. The following command will list of all installed packages: sudo rpm -qa List Installed Packages with Rpm #Ĭommand with the -q option allows you to query the packages. Package is installed on the system you would run: sudo yum list installed | grep unzip unzip.x86_64 6.0-19.el7 output above shows that unzip version 6.0-19 is installed on the machine. To find out whether a specific package is installed, filter the output with the grep Usually, the packages list is long, for better readability it is a good idea to pipe the output to less: sudo yum list installed | less
0 Comments
Leave a Reply. |