Differences between revisions 2 and 51 (spanning 49 versions)
Revision 2 as of 2008-02-22 15:47:02
Size: 816
Editor: Mac
Comment:
Revision 51 as of 2015-06-26 14:21:30
Size: 3354
Editor: ?MichaelRedman
Comment: Added command to list package names only, 1 per line
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from Packaging/Listing Installed Packages
## page was renamed from ListInstalledPackages
Line 2: Line 4:
||<tablestyle="width: 100%;" style="border: 0px hidden">~-Translation(s): -~ ||<style="text-align: right; border: 0px hidden"> (!) [:/Talk:Talk]||
[[BR]]
||<tablestyle="width: 100%;" style="border: 0px hidden">~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[fr/ListInstalledPackages|Français]] - [[it/ListInstalledPackages|Italiano]] - [[ja/ListInstalledPackages|日本語(Nihongo)]]-~||<style="text-align: right;border: 0px hidden"> (!) [[/Discussion|Discussion]]||
----
Line 7: Line 8:
List all packages installed: === List all packages installed ===
With version and architecture information, and description, in a table:
{{{
dpkg-query -l
}}}
Line 9: Line 14:
 * DebPkg:dpkg --list Package names only, one per line:
{{{
dpkg --get-selections | cut -f 1
}}}
=== List packages using a search pattern ===
Line 11: Line 20:
To check the state of all packages on your system: It is possible to add a search pattern to list packages:
Line 13: Line 22:
 * dpkg -l | more {{{
dpkg-query -l 'foo*'
}}}
Line 15: Line 26:
It will show all packages that are in various
stages of install (this includes packages that were removed but not purged). To see only the installed :
 
=== Show status of all packages on the system ===

To check the status of all packages on your system:

{{{
dpkg -l | more
}}}

This will show all packages (1 line each) that are in various stages of install (this includes packages that were removed but not purged). To show only the installed:

{{{
Line 19: Line 38:
}}}
Line 20: Line 40:
to filter through grep to get results for "i"
Line 21: Line 42:
You can use also:
  
 * DebPkg:apt-cache pkgnames
You can also use:

{{{
apt-cache pkgnames
}}}
You can if you are using Debian Linux use dpkg command to list installed software:

{{{
dpkg --get-selections
}}}
And store the list installed software to a file called /backup/installed-software.log

{{{
dpkg --get-selections > /backup/installed-software.log
}}}

You can also find package information in the next directories (you can use DebianPkg:mc or other FileManager to browse them):

 * {{{/var/lib/apt/lists/*}}}
 * {{{/var/lib/dpkg/available}}}: list of available packages.
 * {{{/var/lib/dpkg/status}}} :statuses of available packages. This file contains information about whether a package is marked for removing or not, whether it is installed or not, etc. A package marked reinst-required is broken and requires reinstallation.

== Restore installed software ==

After re-installing base system you can immediately re-install all software. You need dselect:

{{{
apt-get install dselect
}}}

Then you have to type following commands:

{{{
dpkg --get-selections > /backup/installed-software.log
dpkg --set-selections < /backup/installed-software.log
}}}
Now your list is imported use apt-get, [[Synaptic]] or other PackageManagement tools. To install the package:

{{{
apt-get dselect-upgrade
}}}

All this with a single command:
{{{
aptitude install $(cat /backup/installed-software.log | awk '{print $1}')
}}}

== See also ==
 * [[DebianMan:1/dpkg-query|dpkg-query(1)]] manpage
 * DebianPkg:debfoster - If dependency changes, debfoster ask if you want to remove the old package.
 * [[http://www.howtogeek.com/howto/linux/show-the-list-of-installed-packages-on-ubuntu-or-debian/|Show the List of Installed Packages on Debian]].
 * [[http://linux.byexamples.com/archives/161/how-to-check-what-have-installed-in-debianubuntu/|Linux by examples]]
 * AptZip

Translation(s): English - Français - Italiano - 日本語(Nihongo)

(!) ?Discussion


This page is about the ways to list the installed packages in a Debian system and how to create a file with this list. This file can be uploaded to the web (i.e. from other computer with Internet connection) to download new packages.

List all packages installed

With version and architecture information, and description, in a table:

dpkg-query -l

Package names only, one per line:

dpkg --get-selections | cut -f 1

List packages using a search pattern

It is possible to add a search pattern to list packages:

dpkg-query -l 'foo*'

Show status of all packages on the system

To check the status of all packages on your system:

dpkg -l | more

This will show all packages (1 line each) that are in various stages of install (this includes packages that were removed but not purged). To show only the installed:

dpkg -l | grep '^i'

to filter through grep to get results for "i"

You can also use:

apt-cache pkgnames

You can if you are using Debian Linux use dpkg command to list installed software:

dpkg --get-selections

And store the list installed software to a file called /backup/installed-software.log

dpkg --get-selections > /backup/installed-software.log

You can also find package information in the next directories (you can use mc or other FileManager to browse them):

  • /var/lib/apt/lists/*

  • /var/lib/dpkg/available: list of available packages.

  • /var/lib/dpkg/status :statuses of available packages. This file contains information about whether a package is marked for removing or not, whether it is installed or not, etc. A package marked reinst-required is broken and requires reinstallation.

Restore installed software

After re-installing base system you can immediately re-install all software. You need dselect:

apt-get install dselect

Then you have to type following commands:

dpkg --get-selections > /backup/installed-software.log
dpkg --set-selections < /backup/installed-software.log

Now your list is imported use apt-get, Synaptic or other PackageManagement tools. To install the package:

apt-get dselect-upgrade

All this with a single command:

aptitude install $(cat /backup/installed-software.log | awk '{print $1}')

See also


CategoryPackageManagement