Difference between revisions of "Dpkg"
Jump to navigation
Jump to search
(20 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <code>[[Wikipedia:dpkg|dpkg]]</code> is a [[package management]] software used among others by Debian operating system. It can be used to install, remove, and provide information about .deb packages. | + | {{lowercase}} |
+ | <code>[[Wikipedia:dpkg|dpkg]]</code> ([[1994]]) is a [[package management]] software used among others by Debian operating system. It can be used to install, remove, and provide information about <code>[[.deb]]</code> packages. | ||
+ | * <code>[[dpkg --help]]</code> | ||
+ | |||
New package configurations will append a *.dpkg-old OR *.dpkg-dist. | New package configurations will append a *.dpkg-old OR *.dpkg-dist. | ||
Line 6: | Line 9: | ||
* Install a .deb package: | * Install a .deb package: | ||
** <code>dpkg -i ''filename.deb''</code> | ** <code>dpkg -i ''filename.deb''</code> | ||
+ | ** <code>dpkg -i -E ''filename.deb''</code> ( <code>-E, [[--skip-same-version]]</code>) | ||
+ | |||
* Remove an installed package: | * Remove an installed package: | ||
** <code>dpkg -r ''package_name''</code> | ** <code>dpkg -r ''package_name''</code> | ||
* Get Information about a package | * Get Information about a package | ||
− | ** <code>dpkg -s ''package_name''</code> (-s status). See also: <code>[[apt-cache]] policy package_name</code> | + | ** <code>[[dpkg -s]] ''package_name''</code> (<code>-s --status</code>). See also: <code>[[apt-cache]] policy package_name</code> |
− | * List | + | * [[List installed packages]] in your computer can be obtained with: |
− | ** <code> dpkg -l ''[optional pattern]''</code> | + | ** <code> [[dpkg -l]] ''[optional pattern]''</code> |
* List files in a package: | * List files in a package: | ||
− | ** <code>dpkg -L ''package_name''</code> | + | ** <code>[[dpkg -L]] ''package_name''</code> |
** <code>[[dpkg-query]] -L ''package_name''</code> | ** <code>[[dpkg-query]] -L ''package_name''</code> | ||
Line 21: | Line 26: | ||
** <code>dpkg -S `which file_to_search`</code> (-S Search) | ** <code>dpkg -S `which file_to_search`</code> (-S Search) | ||
− | * List content of a package, content can be extracted suing <code>ar</code> command: | + | * List content of a package, content can be extracted suing <code>[[ar]]</code> command: |
** <code>dpkg -c /path/to/package_name.deb</code> | ** <code>dpkg -c /path/to/package_name.deb</code> | ||
− | + | {{dpkg changes}} | |
− | |||
− | |||
− | |||
− | |||
− | * | + | * <code>[[dpkg --configure -a]]</code><ref> https://www.ostechnix.com/how-to-fix-e-could-not-get-lock-var-lib-dpkg-lock-error-on-ubuntu/</ref> |
− | |||
− | * <code>dpkg - | + | * <code>[[dpkg-reconfigure]]</code>, <code>[[dpkg-reconfigure openssh-server]]</code> |
=== Example Outputs of dpkg commands === | === Example Outputs of dpkg commands === | ||
− | * <code>dpkg --status [[sysstat]]</code> or <code>dpkg -s [[sysstat]]</code | + | * <code>[[dpkg --status]] [[sysstat]]</code> or <code>dpkg -s [[sysstat]]</code> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Activities == | == Activities == | ||
===Basic=== | ===Basic=== | ||
− | # Read [[apt]] and <code>[[snap]]</code> page | + | # Read <code>[[apt]]</code> and <code>[[snap]]</code> page |
# Install a package using [[dkpg]] | # Install a package using [[dkpg]] | ||
# Understand differences between apt and dpkg | # Understand differences between apt and dpkg | ||
Line 81: | Line 46: | ||
=== Advanced === | === Advanced === | ||
# Read <code>uscan</code>https://manpages.debian.org/buster/devscripts/uscan.1.en.html and https://wiki.debian.org/debian/watch to understand how new packages are generated: https://manpages.debian.org/buster/devscripts/uscan.1.en.html | # Read <code>uscan</code>https://manpages.debian.org/buster/devscripts/uscan.1.en.html and https://wiki.debian.org/debian/watch to understand how new packages are generated: https://manpages.debian.org/buster/devscripts/uscan.1.en.html | ||
+ | # Learn about <code>[[dpkg -V]]</code> and [[dpkg -C]]</code> options | ||
== See Also == | == See Also == | ||
* {{apt}} | * {{apt}} | ||
− | * {{ | + | * {{package managers}} |
* {{dpkg}} | * {{dpkg}} | ||
* {{snap}} | * {{snap}} | ||
− | |||
− | |||
* [[wikipedia:Deb_(file_format)]] to understand ''.deb'' internal format an included files: ''preinst, postinst, prerm and postrm.'' | * [[wikipedia:Deb_(file_format)]] to understand ''.deb'' internal format an included files: ''preinst, postinst, prerm and postrm.'' | ||
− | |||
− | |||
− | |||
* [[wikipedia:apt-file]] to view the contents of debian packages on remote repositories | * [[wikipedia:apt-file]] to view the contents of debian packages on remote repositories | ||
{{CC license}}. Source: https://en.wikiversity.org/wiki/Linux_server_administration/dpkg | {{CC license}}. Source: https://en.wikiversity.org/wiki/Linux_server_administration/dpkg | ||
+ | [[Category:dpkg]] | ||
[[Category:Server administration]] | [[Category:Server administration]] | ||
[[Category:Operating systems]] | [[Category:Operating systems]] | ||
[[Category:Linux]] | [[Category:Linux]] |
Latest revision as of 11:20, 16 September 2021
dpkg
(1994) is a package management software used among others by Debian operating system. It can be used to install, remove, and provide information about .deb
packages.
New package configurations will append a *.dpkg-old OR *.dpkg-dist.
Contents
Basic dpkg commands[edit]
- Install a .deb package:
dpkg -i filename.deb
dpkg -i -E filename.deb
(-E, --skip-same-version
)
- Remove an installed package:
dpkg -r package_name
- Get Information about a package
- List installed packages in your computer can be obtained with:
dpkg -l [optional pattern]
- List files in a package:
dpkg -L package_name
dpkg-query -L package_name
- Find package owner of a file:
dpkg -S `which file_to_search`
(-S Search)
- List content of a package, content can be extracted suing
ar
command:dpkg -c /path/to/package_name.deb
- Get a list of recently installed packages
zcat -f /var/log/dpkg.log* | grep "\ install\ " | sort
- Get a list of recently upgraded packages
zcat -f /var/log/dpkg.log* | grep "\ upgrade\ " | sort
- Get a list of recently installed or upgraded packages
zcat -f /var/log/dpkg.log* | egrep "\ install\ |\ upgrade\ " | sort -nk1
Example Outputs of dpkg commands[edit]
dpkg --status sysstat
ordpkg -s sysstat
Activities[edit]
Basic[edit]
Advanced[edit]
- Read
uscan
https://manpages.debian.org/buster/devscripts/uscan.1.en.html and https://wiki.debian.org/debian/watch to understand how new packages are generated: https://manpages.debian.org/buster/devscripts/uscan.1.en.html - Learn about
dpkg -V
and dpkg -C options
See Also[edit]
APT
:wajig
,apt-cache
,add-apt-repository
PPA,apt
[install
|remove
|purge | show | list | changelog
|update
|upgrade
],do-release-upgrade
,apt-mark
,apt full-upgrade
,sources.list
, APT Automatic updates,unattended-upgrade
,apt-transport-https
,apt-get update
,/etc/apt/
,/etc/apt/apt.conf.d/50unattended-upgrades
,/etc/apt/apt.conf.d/
,/etc/apt/apt.conf.d/20auto-upgrades
,apt-file, apt-utils
- Package managers: dpkg, APT, RPM, YUM, DNF, homebrew, pkgutil, opkg, Helm, pkg and snap, npm, Aptitude, alien, Conan, CRAN, Chocolatey, NuGet, PackageKit, Wajig, pacman, PIP, Apache Ivy, List packages, List files in packages, Spack
dpkg, dpkg-query
,update-alternatives
[2],ar
,debsums
,dpkg -V
,dpkg -S
,dpkg -L
,dpkg --configure -a
,wajig
,dpkg -i -E
,dpkg --help, dpkg-source-gitarchive
- Snap:
snap
,snapd
,snapctl
,snapcraft
,snap
: [list
|install
|find
|info
|services
|start
|stop
|remove
|refresh | set
|logs
]snapd
|snap list | snap version
|snap find aws
|snap --help
] - wikipedia:Deb_(file_format) to understand .deb internal format an included files: preinst, postinst, prerm and postrm.
- wikipedia:apt-file to view the contents of debian packages on remote repositories
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.. Source: https://en.wikiversity.org/wiki/Linux_server_administration/dpkg
Advertising: