#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-devHowever, 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 dpkg:
#sudo dpkg -l | grep python3-devIn RedHat and RedHat-like Linuxes such as Fedora and CentOS we can use either rpm:
#sudo rpm -qa | grep python3-devor yum:
#sudo yum list installed | grep python3-devPosted 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