Differences between revisions 40 and 42 (spanning 2 versions)
Revision 40 as of 2009-03-16 03:32:27
Size: 3330
Editor: anonymous
Comment: converted to 1.6 markup
Revision 42 as of 2010-09-17 01:26:16
Size: 2870
Editor: ?skizzhg
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
||<tablewidth="100%">~-Translation(s): -~ ||<style="TEXT-ALIGN: right"> (!) [[/Discussion]] ||
##||<tablewidth="100%">~-Translation(s): [[it/ListInstalledPackages|Italiano]]-~ ||<style="TEXT-ALIGN: right"> (!) [[/Discussion]] ||
Line 11: Line 10:
 * dpkg-query -l

 or

 * DebPkg:dpkg --list
{{{
dpkg-query -l
}}}
Line 21: Line 18:
{{{
Line 22: Line 20:

=== Storing a list of installed packages in a file ===

And to store in a file:

 * dpkg --list > /backup/installed-software.log
}}}
Line 33: Line 26:
 * dpkg -l | more {{{
dpkg -l | more
}}}
Line 37: Line 32:
 * dpkg -l | DebPkg:grep '^i' {{{
dpkg -l | grep '^i'
}}}
Line 41: Line 38:
The command above is some how redundant, because dpkg support WikiPedia:Wildcard_character , doing this instead

 * dpkg-query -l 'i*'

or

 * dpkg -l "ii"
Line 51: Line 40:
 * DebPkg:apt-cache pkgnames {{{
apt-cache pkgnames
}}}
Line 54: Line 45:
 * dpkg --get-selections {{{
dpkg --get-selections
}}}
Line 57: Line 50:
$ dpkg --get-selections > /backup/installed-software.log {{{
dpkg --get-selections > /backup/installed-software.log
}}}
Line 59: Line 54:
You can also find package information in the next directories (you can use DebPkg:mc or other FileManager to browse them): You can also find package information in the next directories (you can use DebianPkg:mc or other FileManager to browse them):
Line 61: Line 56:
 * /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.
 * {{{/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.
Line 71: Line 66:
 * dpkg --set-selections < /backup/installed-software.log
Now your list is imported use dselect, [[Synaptic]] or other PackageManagement tools to install the package :
{{{
dpkg --set-selections < /backup/installed-software.log
}}}
Now your list is imported use apt-get, [[Synaptic]] or other PackageManagement tools to install the package :
Line 74: Line 71:
 * dselect
Select ‘i‘ for install the software

You can also use “apt-get dselect-upgrade” instead of dselect
{{{
apt-get dselect-upgrade
}}}
Line 80: Line 76:
  {{{
apt-get install `cat installed-software.log`
{{{
aptitude install $(cat installed-software.log)
Line 85: Line 81:
 * [[http://manpages.debian.net/man/1/dpkg-query|dpkg-query]]
* [[http://manpages.debian.net/man/8/dpkg-www|dpkg-www]]
 * DebPkg:debfoster - If dependency changes, debfoster ask if you want to remove the old package.
 * [[DebianMan:1/dpkg-query|dpkg-query(1)]] manpage
 * DebianPkg:debfoster - If dependency changes, debfoster ask if you want to remove the old package.
Line 90: Line 85:
 * WikiPedia:JIG (Wikipedia article about JIG) and DebPkg:JIG (Package JIG)

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

dpkg-query -l

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.

All you have to do is type following two commands:

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 installed-software.log)

See also


CategoryPackageManagement