Differences between revisions 23 and 52 (spanning 29 versions)
Revision 23 as of 2008-02-22 18:25:43
Size: 2297
Editor: Mac
Comment:
Revision 52 as of 2015-06-26 14:57:51
Size: 3495
Editor: GuillemJover
Comment: Improve page, and fix some incorrectness
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
language en
||<tablewidth="100%">~-Translation(s): -~ ||<style="TEXT-ALIGN: right"> (!) ["/Talk"] ||

## page was renamed from Packaging/Listing Installed Packages
## page was renamed from ListInstalledPackages
#language en
||<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 installed packages ===
Line 9: Line 10:
 * DebPkg:dpkg --list
And to store in a file:
With version and architecture information, and description, in a table:
{{{
dpkg-query -l
}}}
Line 12: Line 15:
 * dpkg --list > /backup/installed-software.log Package names only, one per line:
{{{
dpkg-query -f '${binary:Package}\n' -W
}}}

=== 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 ===
Line 15: Line 32:
 * 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-query -l '*' | less
}}}
Line 18: Line 36:
 * dpkg -l | DebPkg:grep '^i'
to filter through grep to get results for "i"
This will show all packages (one line each) that are in various stages of installation (including packages that were removed but not purged) and packages just available from a repository. To show only installed packages:

{{{
dpkg -l | grep '^.i'
}}}

you can filter with grep to get results for "i".
Line 23: Line 46:
 * DebPkg:apt-cache pkgnames
You can if you are using Debian Linux use dpkg command to list installed software:
{{{
apt-cache pkgnames
}}}
Line 26: Line 50:
 * dpkg --get-selections
And store the list installed software to a file called /backup/installed-software.log
Or you can use dpkg to list the current package selections (the desired state of either installed or to be installed packages):
Line 29: Line 52:
$ dpkg --get-selections > /backup/installed-software.log {{{
dpkg --get-selections
}}}
Line 31: Line 56:
You can also find package information in (you can use DebPkg:mc to browse these): And store the list of software to a file called /backup/package-selections
Line 33: Line 58:
 * /var/lib/apt/lists/*
 * /var/lib/dpkg/available
{{{
dpkg --get-selections >/backup/package-selections
}}}

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 from repositories.
 * {{{/var/lib/dpkg/status}}}: status of installed (and available) packages. This file contains information about whether a package is marked for removal or not, whether it is installed or not, etc. A package marked reinst-required is broken and requires reinstallation.
Line 36: Line 69:
After re-installing base system you can immediately re-install all software.
Line 38: Line 70:
All you have to do is type following two commands: After re-installing base system you can immediately re-install all software. You need dselect:
Line 40: Line 72:
 * dpkg --set-selections < /backup/installed-software.log
Now your list is imported use dselect, ["Synaptic"] or other PackageManagementtools to install the package :
{{{
apt-get install dselect
}}}
Line 43: Line 76:
 * dselect
Select ‘i‘ for install the software
Then you have to type following commands:
Line 46: Line 78:
You can also use “apt-get dselect-upgrade” instead of dselect {{{
dpkg --get-selections >/backup/package-selections
dpkg --set-selections </backup/package-selections
}}}

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

{{{
apt-get dselect-upgrade
}}}
Line 50: Line 91:
apt-get install {{{cat installed-software.log}}} {{{
aptitude install $(cat /backup/package-selections | awk '{print $1}')
}}}
Line 53: Line 96:
 * DebPkg: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]
 * WikiPedia:JIG (Wikipedia article about JIG) and DebPkg:JIG (Package JIG)

* [[DebianMan:1/dpkg-query|dpkg-query(1)]] manpage
 * Debian
Pkg: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]]
Line 58: Line 102:

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 installed packages

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

dpkg-query -l

Package names only, one per line:

dpkg-query -f '${binary:Package}\n' -W

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-query -l '*' | less

This will show all packages (one line each) that are in various stages of installation (including packages that were removed but not purged) and packages just available from a repository. To show only installed packages:

dpkg -l | grep '^.i'

you can filter with grep to get results for "i".

You can also use:

apt-cache pkgnames

Or you can use dpkg to list the current package selections (the desired state of either installed or to be installed packages):

dpkg --get-selections

And store the list of software to a file called /backup/package-selections

dpkg --get-selections >/backup/package-selections

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 from repositories.

  • /var/lib/dpkg/status: status of installed (and available) packages. This file contains information about whether a package is marked for removal 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/package-selections
dpkg --set-selections </backup/package-selections

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

apt-get dselect-upgrade

All this with a single command:

aptitude install $(cat /backup/package-selections | awk '{print $1}')

See also


CategoryPackageManagement