Editing
Debian package management
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== dpkg, dpkg-query, dpkg-deb == === dpkg === * https://manpages.debian.org/unstable/dpkg/dpkg.1.en.html ==== installing a Debian package ==== <pre>$ sudo dpkg --install PACKAGE.deb</pre> ==== removing a Debian package ==== <pre>$ sudo dpkg --remove PACKAGE</pre> ==== verifying a Debian package ==== <pre>$ sudo dpkg --verify PACKAGE</pre> === dpkg-deb -- Debian package archive (.deb) manipulation tool === * https://manpages.debian.org/unstable/dpkg/dpkg-deb.1.en.html '''dpkg-deb''' packs, unpacks and provides information about Debian archives. Use '''dpkg''' to install and remove packages from your system. ==== which files are included? will be created from this package file? ==== <pre>$ dpkg-deb --contents PACKAGE.deb</pre> ==== what's the official package name? ==== <pre>$ dpkg-deb --info PACKAGE.deb</pre> ==== what is the content of the ctrl-tarfile you can extract from PACKAGE.deb? ==== <pre>$ dpkg-deb --ctrl-tarfile PACKAGE.deb | tar tvf - drwxr-xr-x root/root 0 2018-08-27 17:39 ./ -rw-r--r-- root/root 21773 2018-08-27 17:39 ./md5sums -rw-r--r-- root/root 229 2018-08-27 17:39 ./control -rw-r--r-- root/root 1071 2018-08-27 17:36 ./conffiles -rwxr-xr-x root/root 1228 2018-08-27 17:39 ./postinst</pre> * PACKAGE.deb contains a tarball (ctrl-tarfile). * the tarball contains ... . ==== what conffiles does PACKAGE.deb contain? ==== <pre>$ dpkg-deb --ctrl-tarfile PACKAGE.deb | tar xf - --to-stdout ./conffiles</pre> * PACKAGE.deb contains a tarball (ctrl-tarfile), * the tarball contains ./conffiles, * ./conffiles is only a list of what is to be treated as conffiles, it does not contain the conffiles themselves, they are an ordinary part of PACKAGE.deb === dpkg-query === * https://manpages.debian.org/unstable/dpkg/dpkg-query.1.en.html ==== which packages are installed (together with a '''couple''' of details)? ==== <pre>$ dpkg-query --list</pre> ==== is there an installed package, that sounds like XYZ? ==== <pre>$ dpkg-query --list | fgrep XYZ</pre> ==== details of an installed package (that you know the name of, e.g. PACKAGE) ==== <pre>$ dpkg-query --list PACKAGE</pre> ==== all details of specified package ==== <pre>$ dpkg-query --status PACKAGE</pre> ==== what's the content of an installed package (e.g. PACKAGE) ==== <pre>$ dpkg-query --listfiles PACKAGE</pre> ==== what conffiles does an installed package (e.g. PACKAGE) include ==== <pre>$ dpkg-query --showformat='${Conffiles}\n' --show PACKAGE $ dpkg-query --showformat='${Conffiles}\n' --show PACKAGE | perl -pe 's/^ \s* (.*?) \s* \w+ $/$1/x'</pre> ===== backup all the conffiles of an installed package (e.g. PACKAGE), each one for itself ===== <pre>$ sudo ~jochen.hayek/bin/create_snapshot.sh $( dpkg-query --showformat='${Conffiles}\n' --show PACKAGE | perl -pe 's/^ \s* (.*?) \s* \w+ $/$1/x' )</pre> ===== backup all the conffiles of an installed package (e.g. PACKAGE) to a single tarball ===== <pre>$ sudo tar cvf ~/tmp/PACKAGE.conffiles-$(date '+%Y%m%d%H%M%S').tar --directory / $( dpkg-query --showformat='${Conffiles}\n' --show PACKAGE | perl -pe 's/^ \s* (.*?) \s* \w+ $/$1/x' )</pre> ==== which installed package includes a certain FILE (utility, ...)? ==== <pre>$ dpkg-query --search FILE</pre>
Summary:
Please note that all contributions to wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
British English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information