Thursday, April 11, 2019

apt - How to list all installed packages



I'd like to output a list of all installed packages into a text file so that I can review it and bulk-install on another system. How would I do this?





The apt tool on Ubuntu 14.04 and above makes this very easy.



apt list --installed








To get a list of packages installed locally do this in your terminal:






dpkg --get-selections | grep -v deinstall


(The -v tag "inverts" grep to return non-matching lines)



To get a list of a specific package installed:



dpkg --get-selections | grep postgres



To save that list to a text file called packages on your desktop do this in your terminal:



dpkg --get-selections | grep -v deinstall > ~/Desktop/packages


Alternatively, simply use



dpkg -l



(you don't need to run any of these commands as the superuser, so no sudo or any other variants necessary here)


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...