#Linux : list all packages installed
Sometimes we want to quickly check if we have a required package installed, for example a developer library we need to compile our code.
If you are running a Debian based Linux system such as Ubuntu, you have a couple of alternatives. Using
apt, let’s say we are looking for
python3-dev since it is required to debug python code through gdb:
#sudo apt list --installed | grep python3-dev
However, you will notice
apt is pretty slow and we will be greeted by the warning
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.. Moreover, the output is not so nice if we want to parse it in a scripted way. A faster alternative is provided by
#sudo dpkg -l | grep python3-dev
In RedHat and RedHat-like Linuxes such as Fedora and CentOS we can use either
#sudo rpm -qa | grep python3-dev
#sudo yum list installed | grep python3-dev
Posted on January 31, 2019, in Linux and tagged apt, CentOS Linux, command line, Debian, dpkg, Fedora Linux, RedHat Linux, rpm, Ubuntu Linux, yum. Bookmark the permalink. 1 Comment.
Pingback: #Linux : How to Slice an Array in #Bash | whitehatty