Debian package management: Difference between revisions
imported>Johayek mNo edit summary |
imported>Johayek mNo edit summary |
||
Line 7: | Line 7: | ||
* ... | * ... | ||
== apt-cache -- query the APT cache == | === apt-cache -- query the APT cache === | ||
* https://manpages.debian.org/unstable/apt/apt-cache.8.en.html | * https://manpages.debian.org/unstable/apt/apt-cache.8.en.html | ||
== apt-get -- APT package handling utility -- command-line interface == | === apt-get -- APT package handling utility -- command-line interface === | ||
* https://manpages.debian.org/unstable/apt/apt-get.8.en.html | * https://manpages.debian.org/unstable/apt/apt-get.8.en.html | ||
* https://manpages.debian.org/experimental/apt/apt-get.8.en.html | * https://manpages.debian.org/experimental/apt/apt-get.8.en.html | ||
=== APT: resynchronising the package index files from their sources === | ==== APT: resynchronising the package index files from their sources ==== | ||
<pre>$ sudo apt-get update</pre> | <pre>$ sudo apt-get update</pre> | ||
=== APT: installing ... === | === APT: installing ... ==== | ||
<pre> | <pre> | ||
$ sudo apt-get install PACKAGE | $ sudo apt-get install PACKAGE | ||
Line 32: | Line 32: | ||
</pre> | </pre> | ||
=== APT: installing the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list === | ==== APT: installing the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list ==== | ||
<pre> | <pre> | ||
$ sudo apt-get upgrade | $ sudo apt-get upgrade | ||
Line 38: | Line 38: | ||
</pre> | </pre> | ||
=== APT: removing ... === | ==== APT: removing ... ==== | ||
<pre> | <pre> | ||
$ sudo apt-get remove PACKAGE | $ sudo apt-get remove PACKAGE | ||
Line 44: | Line 44: | ||
</pre> | </pre> | ||
== dpkg | == dpkg, dpkg-query, dpkg-deb == | ||
== dpkg == | === dpkg === | ||
* https://manpages.debian.org/unstable/dpkg/dpkg.1.en.html | * https://manpages.debian.org/unstable/dpkg/dpkg.1.en.html | ||
=== what's the official package name? === | ==== what's the official package name? ==== | ||
<pre>$ dpkg --info PACKAGE.deb</pre> | <pre>$ dpkg --info PACKAGE.deb</pre> | ||
=== which files are included? will be created from this package file? === | ==== which files are included? will be created from this package file? ==== | ||
<pre>$ dpkg --contents PACKAGE.deb</pre> | <pre>$ dpkg --contents PACKAGE.deb</pre> | ||
=== installing the Debian package === | ==== installing the Debian package ==== | ||
<pre>$ sudo dpkg --install PACKAGE.deb</pre> | <pre>$ sudo dpkg --install PACKAGE.deb</pre> | ||
== dpkg-query == | === dpkg-query === | ||
* https://manpages.debian.org/unstable/dpkg/dpkg-query.1.en.html | * https://manpages.debian.org/unstable/dpkg/dpkg-query.1.en.html | ||
=== which packages are installed (together with a '''couple''' of details)? === | ==== which packages are installed (together with a '''couple''' of details)? ==== | ||
<pre>$ dpkg-query --list</pre> | <pre>$ dpkg-query --list</pre> | ||
=== is there an installed package, that sounds like XYZ? === | ==== is there an installed package, that sounds like XYZ? ==== | ||
<pre>$ dpkg-query --list | fgrep XYZ</pre> | <pre>$ dpkg-query --list | fgrep XYZ</pre> | ||
=== details of an installed package (that you know the name of, e.g. PACKAGE) === | ==== details of an installed package (that you know the name of, e.g. PACKAGE) ==== | ||
<pre>$ dpkg-query --list PACKAGE</pre> | <pre>$ dpkg-query --list PACKAGE</pre> | ||
=== all details of specified package === | ==== all details of specified package ==== | ||
<pre>$ dpkg-query --status PACKAGE</pre> | <pre>$ dpkg-query --status PACKAGE</pre> | ||
=== what's the content of an installed package (e.g. PACKAGE) === | ==== what's the content of an installed package (e.g. PACKAGE) ==== | ||
<pre>$ dpkg-query --listfiles PACKAGE</pre> | <pre>$ dpkg-query --listfiles PACKAGE</pre> | ||
=== which installed package includes a certain FILE (utility, ...)? === | ==== which installed package includes a certain FILE (utility, ...)? ==== | ||
<pre>$ dpkg-query --search FILE</pre> | <pre>$ dpkg-query --search FILE</pre> | ||
== dpkg-deb -- Debian package archive (.deb) manipulation tool == | === dpkg-deb -- Debian package archive (.deb) manipulation tool === | ||
* https://manpages.debian.org/unstable/dpkg/dpkg-deb.1.en.html | * https://manpages.debian.org/unstable/dpkg/dpkg-deb.1.en.html | ||
Line 89: | Line 89: | ||
Use '''dpkg''' to install and remove packages from your system. | Use '''dpkg''' to install and remove packages from your system. | ||
= dpkg-source -- Debian source package (.dsc) manipulation tool = | |||
* https://manpages.debian.org/unstable/dpkg-dev/dpkg-source.1.en.html | * https://manpages.debian.org/unstable/dpkg-dev/dpkg-source.1.en.html | ||
Line 99: | Line 99: | ||
* *.orig.tar.* | * *.orig.tar.* | ||
= rpm2deb -- converting packages from ... to ... = | |||
* https://en.wikipedia.org/wiki/Rpm_(software) | * https://en.wikipedia.org/wiki/Rpm_(software) | ||
Line 109: | Line 109: | ||
* https://unix.stackexchange.com/questions/9714/what-is-the-need-for-fakeroot-command-in-linux#9720 ('''important''') | * https://unix.stackexchange.com/questions/9714/what-is-the-need-for-fakeroot-command-in-linux#9720 ('''important''') | ||
== alien --to-deb ... == | |||
this command line creates a Debian package from an RPM package | this command line creates a Debian package from an RPM package | ||
(using that e-mail address for the (local Debian) package maintainer).<br/> | (using that e-mail address for the (local Debian) package maintainer).<br/> | ||
Line 116: | Line 116: | ||
some command line parameters can only get passed to "alien" as environment variables. | some command line parameters can only get passed to "alien" as environment variables. | ||
== fakeroot ... == | |||
you do not have root priviliges, | you do not have root priviliges, | ||
but you need to pretend to have them for achieving certain goals like creating a Debian package: | but you need to pretend to have them for achieving certain goals like creating a Debian package: | ||
<pre>$ fakeroot --unknown-is-real ...</pre> | <pre>$ fakeroot --unknown-is-real ...</pre> | ||
== special issues == | |||
=== fiddling with the tree before creating the .deb === | |||
Because you actually do create real files (to be owned by root), you now do need to make use of sudo instead of only fakeroot: | Because you actually do create real files (to be owned by root), you now do need to make use of sudo instead of only fakeroot: | ||
<pre>$ sudo env EMAIL='john.doe@COMPANY.com' alien --to-deb --keep-version ... | <pre>$ sudo env EMAIL='john.doe@COMPANY.com' alien --to-deb --keep-version ... | ||
Line 130: | Line 130: | ||
</pre> | </pre> | ||
== open questions == | |||
* how to deal with dependencies specified within the RPM package? | * how to deal with dependencies specified within the RPM package? | ||
* … | * … | ||
= history of this article = | |||
This blog article got created 1st, but then the content got moved here to the wiki: | This blog article got created 1st, but then the content got moved here to the wiki: |
Revision as of 09:04, 30 May 2018
APT
- the Debian APT = Advanced Packaging Tool
- apt-cache
- apt-get
- ...
apt-cache -- query the APT cache
apt-get -- APT package handling utility -- command-line interface
- https://manpages.debian.org/unstable/apt/apt-get.8.en.html
- https://manpages.debian.org/experimental/apt/apt-get.8.en.html
APT: resynchronising the package index files from their sources
$ sudo apt-get update
APT: installing ... =
$ sudo apt-get install PACKAGE # do not *really* install the PACKAGE, # just download it to the default cache directory: $ sudo apt-get install --download-only PACKAGE # do not *really* install the PACKAGE, # just download it to the cache directory being specified (instead of /var/cache/apt/archives/): $ sudo apt-get install --download-only --option dir::cache=$HOME/tmp PACKAGE
APT: installing the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list
$ sudo apt-get upgrade $ sudo apt-get dist-upgrade
APT: removing ...
$ sudo apt-get remove PACKAGE $ sudo apt-get autoremove PACKAGE
dpkg, dpkg-query, dpkg-deb
dpkg
what's the official package name?
$ dpkg --info PACKAGE.deb
which files are included? will be created from this package file?
$ dpkg --contents PACKAGE.deb
installing the Debian package
$ sudo dpkg --install PACKAGE.deb
dpkg-query
which packages are installed (together with a couple of details)?
$ dpkg-query --list
is there an installed package, that sounds like XYZ?
$ dpkg-query --list | fgrep XYZ
details of an installed package (that you know the name of, e.g. PACKAGE)
$ dpkg-query --list PACKAGE
all details of specified package
$ dpkg-query --status PACKAGE
what's the content of an installed package (e.g. PACKAGE)
$ dpkg-query --listfiles PACKAGE
which installed package includes a certain FILE (utility, ...)?
$ dpkg-query --search FILE
dpkg-deb -- Debian package archive (.deb) manipulation tool
dpkg-deb packs, unpacks and provides information about Debian archives.
Use dpkg to install and remove packages from your system.
dpkg-source -- Debian source package (.dsc) manipulation tool
$ dpkg-source --extract ....dsc
needs a:
- *.dsc
- *.debian.tar.*
- *.orig.tar.*
rpm2deb -- converting packages from ... to ...
- https://en.wikipedia.org/wiki/Rpm_(software)
- https://en.wikipedia.org/wiki/Alien_(software)
- https://manpages.debian.org/unstable/alien/alien.1p.en.html
- https://manpages.debian.org/unstable/pseudo/fakeroot.1.en.html
- https://manpages.debian.org/unstable/fakeroot-ng/fakeroot.1.en.html
- https://www.howtoforge.com/converting_rpm_to_deb_with_alien : alien -k ... (important)
- https://unix.stackexchange.com/questions/9714/what-is-the-need-for-fakeroot-command-in-linux#9720 (important)
alien --to-deb ...
this command line creates a Debian package from an RPM package
(using that e-mail address for the (local Debian) package maintainer).
CAVEAT: won't actually work, because creating a Debian package requires running this as root
$ env EMAIL='john.doe@COMPANY.com' alien --to-deb --keep-version ...
some command line parameters can only get passed to "alien" as environment variables.
fakeroot ...
you do not have root priviliges, but you need to pretend to have them for achieving certain goals like creating a Debian package:
$ fakeroot --unknown-is-real ...
special issues
fiddling with the tree before creating the .deb
Because you actually do create real files (to be owned by root), you now do need to make use of sudo instead of only fakeroot:
$ sudo env EMAIL='john.doe@COMPANY.com' alien --to-deb --keep-version ... $ cd ... # here you want to change a few bits $ sudo env EMAIL='john.doe@COMPANY.com' debian/rules binary
open questions
- how to deal with dependencies specified within the RPM package?
- …
history of this article
This blog article got created 1st, but then the content got moved here to the wiki: