How to see the list of packages installed in Debian and derivatives

Ikea instructions Tux cut out

When we have a distribution, something very useful is know all packages that we have installed, either to make a list and know what we have in case of formatting to be able to reinstall them without forgetting any or simply to bring an idea of ​​everything we have in case we want to remove any that we no longer use and from which We don't even remember that it was installed and that it is taking up space on the hard disk.

If you use Ubuntu for example, and you go to Ubuntu Software Center, clicking on the Installed button, you can see the software you have installed, but the list is not complete. Therefore it is not very practical in this regard. It is also not logical to look at the packages installed from other package management tools because they will present you only the packages installed from them.

To know the complete list, the solution is another that we present here and thus be able to have a complete report on all the software that is installed in our distro, either Debian, Ubuntu or derivatives of both that use dpkg. We can also add a very interesting option to this command that we will present to you and that will also allow us to see the size of each of the packages listed on our hard drive.

Well, to see the list is extremely simple. You just have to open the terminal or console, and from there type the following line of text to display the list:

dpkg-query -W -f='${Installed-Size} ${Package}\n' | sort -n

This is an option to perform this task, but you can modify the options and attributes of the command so that the result is different according to your needs. Any questions or suggestions will be welcome. Leave your comment and I will answer as soon as possible.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Jimmy olano said

    SUGGESTION:

    We could quickly create an automated script prototype for the next team (or reinstallation or distro change) as long as we have our .deb on a different partition (or well, we download it from our own mirror on our LAN or, last resort , we "download" it from the internet):

    `dpkg-query -W -f = 'apt-get install $ {Package} \ n' | sort -n> list_app_to_install.sh `

    Of course if you use apt-get otherwise replace with the proper one (aptitude, yum, etc). As I say it is a prototype, the header #! / Bin / bash is missing, make it executable, manage to scale permissions for installation, etc.

    THE ABOVE makes me wonder ** How to know if a package is ALREADY installed on the target machine? **

    Well, the great thing about reusing the code: we execute the same sentence that I suggest on the target machine GIVING A DIFFERENT NAME TO THE LIST and then we execute the DIFF command on the two files. What do you think?

  2.   Jimmy olano said

    CORRIJO «yum» uses RPM packages I'm «confusing gymnastics with magnesia», worth the note. 8- (

  3.   pedro said

    To quickly see the installed packages it could also be:

    dpkg -l

  4.   Walter Omar D'ari said

    Hello people:

    It could be with ...

    dpkg --get-selections | grep -v deinstall | less

    ... or change less to send it to a file ...

    dpkg –get-selections | grep -v deinstall> installed_packages

    Greetings!