- How to get list of installed packages on Ubuntu / Debian Linux
- Just list all installed packages with a short description
- How to get a list of packages installed
- How to save a list to a text file
- How to restore a list on server2
- How do I see what packages are installed on Ubuntu Linux?
- How do I see what packages are installed on Ubuntu Linux?
- apt list installed packages
- List all installed packages only
- How to list or find out if a specific package installed or not
- Ubuntu list installed packages
- Listing installed packages sorted by installation date and time
- Conclusion
- Linux rpm List Installed Packages Command
- Linux rpm list installed packages command syntax
- List all installed packages using rpm -a option
- Getting info about specific packages
- List all files installed by the RPM package
- List installed RPM packages using yum or dnf on Linux
- Count all installed RPM packages using yum/dnf in Linux
- List all installed packages in RHEL, CentOS, Oracle and Fedora Linux
- How to check and list installed packages in CentOS Linux
- How to check installed packages in CentOS
- Check and list installed packages with yum command
- Display packages list that needs updates/patching
- Get a list of all installed packages with rpm command
- Use repoquery command from dnf-utils package
- More on repoquery option
- How to check for installed packages on CentOS and backup them
How to get list of installed packages on Ubuntu / Debian Linux
Just list all installed packages with a short description
Type the following command:
$ dpkg-query -l
Sample outputs:
Just want to see a list of packages only? Try:
$ dpkg-query -f ‘$
Sample outputs:
How to get a list of packages installed
Type the following command
$ dpkg —get-selections | grep -v deinstall
Sample outputs:
Fig.01: Show a list of packages installed
How to save a list to a text file
The syntax is as follows on server1:
$ dpkg —get-selections | grep -v deinstall > mylist.txt
Or
$ dpkg -l | grep ^ii | awk ‘< print $2>’ > mylist.txt
Now copy mylist.txt to server named server2:
$ scp mylist.txt user@server2:
How to restore a list on server2
On server2 restore installations from the mylist.txt, run:
$ dpkg —clear-selections
$ sudo dpkg —set-selections
OR
$ sudo apt-get install -y $(
Finally run the following command to remove unwanted packages:
$ sudo apt-get autoremove
Above command should restore/install packages from backups or another server. Another option is to use aptitude command as follows:
- 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 ➔
🐧 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.
if you have aptitude installed, this works as a search
aptitude search ‘
that said, i prefer the solutions already listed
Alternative:
( zcat $( ls -tr /var/log/apt/history.log*.gz ) ; cat /var/log/apt/history.log ) | grep apt-get | grep install
It is not perfect but always worked fine for me.
cheers
I’m using this for years:
I’ve come across a TON of tutorials on this subject that seem to leave out the method for cleaning up the output file for parsing.
For the section:
How to save a list to a text file
The syntax is as follows on server1:
$ dpkg —get-selections | grep -v deinstall > mylist.txt
This ends up giving you a text file formatted like this:
…
tcpdump install
tdb-tools install
telnet install
time install
zlib1g:amd64 install
…
You will get gripes about “install” not being a package in APT if you skip straight to using:
sudo apt-get install -y $(
You need to get rid of all the tabs, newline chars and properly space the text of the list first. There may also be a difference in platform such as amd64 vs i386.
To do that, I’m a fan of this Perl5 one-liner:
perl -pe ‘s/\s*install\n|\:amd64/ /g’ mylist.txt > mylist.txt
This tweaks the file to look like this instead, which will actually work with that final step using «apt-get install -y» :
. tcpdump tdb-tools telnet time zlib1g .
Thanks for adding your notes. I appreciate your post.
Источник
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:
- Open the terminal application or log in to the remote server using ssh (e.g. ssh user @ sever-name )
- Run command apt list —installed to list all installed packages on Ubuntu
- 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
Источник
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 ‘(%
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 check and list installed packages in CentOS Linux
How to check installed packages in CentOS
The procedure is as follows to list installed packages:
- Open the terminal app.
- For remote server log in using the ssh command: ssh user@centos-linux-server-IP-here
- Show information about all installed packages on CentOS, run: sudo yum list installed
- To count all installed packages run: sudo yum list installed | wc -l
- Want to save all installed packages names in a file? Try: sudo yum list installed > my_list.txt
- 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:
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 ‘%
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 %
dnf repoquery —querytags
Sample outputs:
For instance, one can build fancy list as follows:
repoquery -a —installed \
—queryformat «%
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:
Источник