Difference between revisions of "Dpkg"
From Knoppix Documentation Wiki
(Must add Category:Useful Linux Commands) |
|||
Line 1: | Line 1: | ||
+ | This is the "canonical" or "official" utility/command for managing [[Deb files or Debian Packages]]. | ||
+ | |||
[[package]] | [[package]] | ||
---- | ---- |
Revision as of 05:23, 9 October 2006
This is the "canonical" or "official" utility/command for managing Deb files or Debian Packages.
- To list all the files in a package
dpkg -L packagename
- To install a package of a particular release ( assuming it's in your sources.list ).
apt-get install -t unstable packagename
- Tells the status (hold, purge etc..) of the package.
dpkg --get-selections <package name>
- To show anything in database with the package name.
dpkg -l ¦ grep <package name>
- To deinstall the package with all configuration files.
dpkg --purge <package name>
- To save or edit your packages status use
dpkg --get-selections > currentselections.txt
re-directs your packages to the file, to restore list
dpkg --set-selections < currentselections.txt
then
apt-get update
to refresh then
apt-get upgrade
to make the changes , also can be used to keep your current settings on any install just restore the list to the new install and
apt-get update
and upgrade or dist-upgrade and you will have the same software packages on the new install.
- To put a package on hold
echo packagename hold | dpkg --set-selections
- To take a package off hold
echo packagename install | dpkg --set-selections
- To list the version of an installed package
apt-cache policy packagename | grep Installed
- To list packages containing a certain string in its package name, version or description
COLUMNS=120 dpkg -l | grep string