Find all installed packages linux

How to check and list installed packages in CentOS Linux

How to check installed packages in CentOS

The procedure is as follows to list installed packages:

  1. Open the terminal app.
  2. For remote server log in using the ssh command: ssh user@centos-linux-server-IP-here
  3. Show information about all installed packages on CentOS, run: sudo yum list installed
  4. To count all installed packages run: sudo yum list installed | wc -l
  5. Want to save all installed packages names in a file? Try: sudo yum list installed > my_list.txt
  6. Execute the command sudo yum update to refresh package database and install updates if any.

Let us see all commands and examples in details.

  • 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

Check and list installed packages with yum command

From the dnf/yum man page:

The list command dumps lists of packages depending on the packages’ relation to the system. A package is installed if it is present in the RPMDB, and it is available if it is not installed but it is present in a repository that DNF knows about. The list command can also limit the displayed packages according to other criteria, e.g. to only those that update an installed package. The exclude option in configuration file (.conf) might influence the result, but if the command line option –disableexcludes is used, it ensure that all installed packages will be listed.

Hence, to lists installed packages on CentOS, type the following yum command:
sudo yum list —installed
sudo yum list —installed | more

List all installed packages in CentOS Linux using yum

Lists all packages known to us:
sudo yum list —all
Finally, show available packages, run:
sudo yum list —available
One can count all installed packages using the wc command:
sudo yum list —installed | wc -l
sudo yum list —all | wc -l
sudo yum list —available | wc -l

Display packages list that needs updates/patching

Keeping your CentOS box secure is an essential task. One can get a list of all upgrades available for the installed packages too. Type:
sudo yum list —upgrades
sudo yum list —upgrades | more
sudo yum list —upgrades | grep -i kernel
Sample outputs:

Читайте также:  Live дистрибутив linux для тестирования железа

Get a list of all installed packages with rpm command

Simply run the following rpm command:
sudo rpm -qa
sudo rpm -qa | more
sudo rpm -qa | wc -l
sudo rpm -qa | grep bash

Use rpm command to display a list of install installed packages on CentOS server

Use repoquery command from dnf-utils package

First, install yum-utils (CentOS 6.x/7.x) or dnf-utils on a CentOS 8.x:
sudo yum install yum-utils ## centos 6.x/7.x ##
sudo yum install dnf-utils ## centos 8.x ##
Sample outputs:

To check installed packages in CentOS Linux, execute:
sudo yum repoquery -a —installed

Display name, architecture and the containing repository of all nginx packages:
sudo yum repoquery —queryformat ‘%.% : %‘ nginx
List all available packages providing “webserver”:
sudo yum repoquery —whatprovides webserver
Or list all available packages providing “webserver” but only for “i686” architecture:
sudo yum repoquery —whatprovides webserver —arch i686

More on repoquery option

Custom display format created using the -qf % or —queryformat % syntax. The % is nothing but a string to output for each matched package. Every occurrence of % < >within is replaced by corresponding attribute of the package. List of recognized tags can be displayed by running
dnf repoquery —querytags
Sample outputs:

For instance, one can build fancy list as follows:
repoquery -a —installed \
—queryformat «%-%-% installed at ‘%‘ from ‘%‘»
Sample outputs:

How to check for installed packages on CentOS and backup them

One can list and backup all installed packages using the following syntax:

Источник

Linux rpm List Installed Packages Command

H ow do I list all installed packages using rpm command on CentOS/Suse/Fedora/RHEL/Scientific and Red Hat Enterprise Linux? Can you tell me the Linux command to list all rpm’s installed on the server?

The rpm command is a powerful package manager. It is used to build, install, query, verify, update, and erase individual software packages on RPM based distro such as OpenSUSE, RHEL or CentOS. The latest version of Red hat and friends recommend using the yum command or dnf command.

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements rpm
Est. reading time 2m

. This page explains how to list or count onstalled RPM packages on Linux operating systems.

Linux rpm list installed packages command syntax

The rpm command has -a option to query (list) all installed packages.

List all installed packages using rpm -a option

Open the Terminal or login to the remote server using ssh client. Type the following command as root user:
# rpm -qa
Sample outputs:

One can list installation date too as follows:
rpm -qa —qf ‘(%): %-%\n
Sample outputs:

Getting info about specific packages

You can display more information about package using the following command:
# rpm -qi iptables
Sample outputs:

List all files installed by the RPM package

You can list package files using the following command:
# rpm -ql iptables
Sample outputs:

Feel free to add pager such as less or more to display output one screen at a time:
# rpm -qa | less
# rpm -qa | more
# rpm -qa | grep ‘something’
# rpm -ql iptables | more
Want to find out the installation date of a specific package, for example nginx, run:
# rpm -q —last nginx
package nginx is not installed
# rpm -q —last ufw
ufw-0.35-9.el7.noarch Thursday 21 June 2018 11:33:26 PM IST

List installed RPM packages using yum or dnf on Linux

Count all installed RPM packages using yum/dnf in Linux

Pass the yum command output to the wc command to count installed packages on CentOS or RHEL or SUSE:
# yum list installed | wc -l
# dnf list installed | wc -l

List all installed packages in RHEL, CentOS, Oracle and Fedora Linux

Another option is to type the following rpmquery command. However, first install dnf-utils/yum-utils package:
# dnf install dnf-utils ## Fedora latest or CentOS/RHEL 8x. — ##
# yum install yum-utils ## CentOS/RHEL 6.x/7.x — ##
Next, type the following command:
# repoquery -a —installed
# repoquery -a —installed | grep httpd
# repoquery -a —installed | more

It is also possible to list installed packages from a particular repo such as epel repo on CentOS/RHEL 7 or ELEP repo on RHEL 8 or EPEL repo on CentOS 8. First, get the repo id, run:
# yum repolist
Sample outputs:

Источник

How to find out if package is installed in Linux

Debian / Ubuntu Linux

Use dpkg command. It is a package manager for Debian/Ubuntu Linux. Suppose you want to find out package apache-perl or sudo is installed or not, type command:
$ dpkg -s apache-perl
Sample outputs:

  • 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

Another example:
$ dpkg -s sudo
Sample outputs:

Use file /var/lib/dpkg/available to find out all package names available to you. Or you can use following command (list all packages in /var/lib/dpkg/status):
$ dpkg-query -l
You can also try to match package name using wild cards:
$ dpkg-query -l ‘libc6*’
Once you’ve found package name, use the following command to get exact status (whether it is installed or not):
$ dpkg-query -W -f=’$ $\n’ apache-perl
Sample outputs:

Red Hat Enterprise / Fedora Linux / Suse Linux / Cent OS

Under Red Hat/Fedora/CentOS/Suse Linux use the rpm command:
$ rpm -qa | grep For example find out package mutt installed or not:
$ rpm -qa | grep mutt
Output:

If you do not see or get any outputs (package name along with version), it means the package is not installed at all. You can display or list all installed packages with the following command:
$ rpm -qa
$ rpm -qa | less
You can conditionally do something if a rpm command succeeded or failed to find package using bash shell if command:

On a CentOS/RHEL version 6.x/7.x and above use the following yum command to tell whether a package named htop is installed:
$ yum list installed
$ yum list installed htop
Sample outputs:

If you are using Fedora Linux, try the following dnf command:
$ dnf list installed
$ dnf list installed htop

See also:

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

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

This is my first massage over here& i hope i will get full support.

How to open usermap.cfg file on NetApp server?- As i have to check whether unix user login is mapped correctly with Windows login.

As the main problem which few of the users are having is as below —

They are NOT able to map from Windows any network
drive (unix accounts) due to they have not access to their share drive.

It ask me for login and password, BUT earliear it never asked me for my windows login and password . It’s been working till the end of the year 2006.

Please suggest solutions—–

Many thanks in Advance

just a small addition –

on Gentoo Linux just do a:

or
cat /var/lib/portage/world

on CentOS or other “yum”-based systems:

yum list installed

how to see the programs and features in redhat linux (e.g– in windows we can check the same through control panel–progrmas)

@john: On RedHat – which is a rpm package management based distribution – you should can use i.e.:

to list all installed packages or

to get out details about the installed package.

how do i verify packages that are installed without using rpm, i mean recently i installed squid using make, make all, configure configure-install

after this, how do I check this package is installed?

…this is not possible as installing “by hand” (make install) has nothing to do with a “package” nor package management.

To find out if i.e. squid was installed just try to locate the squid binary by where, locate or find, even if you build and install software from sources by make.

If you use a port management system from i.e. pkgsrc, getoo portage or even FreeBSD the port management counts each modified and installed file of a port to make it possible to see which file belongs to which port (package) or which are installed etc.

this might be another story.

Thank you very much, I have another issue, I have Installed texlive but I still get an error message in my crm ” pdf latex not installed”, so do you know how check if any software is installed or not ? It’s different from packages, isn’t it ?

If you have a list of packages you want to query, it’s much easier to just list them instead of using grep:

rpm -q automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel

Why such a complicated command for rpm-based systems? On my machine (Fedora 20), I can just run rpm -q $, and it’s *much* faster since it doesn’t need to list every package on the system and then grep through it:

[blong@blong-desktop tmp]$ rpm -q vala; echo $?
vala-0.22.1-1.fc20.x86_64
0
[blong@blong-desktop tmp]$ rpm -q missing-package; echo $?
package missing-package is not installed
1

Is this a new feature?

In Debian based distros like Ubuntu, you can find out if a package is installed with:

apacheInstalled=$(dpkg -s apache2 | grep ‘Status: install ok installed’| wc -l)
#change apache2 to the package you are checking for. returns 1 if installed, 0 otherwise.
#script does not have to be running as root… but to change installed stuff… it would.

Источник

Читайте также:  Ошибка lvrs64 sys windows 10
Оцените статью