Debian package management: Difference between revisions

From wiki
Jump to navigation Jump to search
imported>Johayek
imported>Johayek
No edit summary
Line 2: Line 2:


* the Debian [http://en.wikipedia.org/wiki/Advanced_Packaging_Tool APT = Advanced Packaging Tool]
* the Debian [http://en.wikipedia.org/wiki/Advanced_Packaging_Tool APT = Advanced Packaging Tool]
** [http://en.wikipedia.org/wiki/Advanced_Packaging_Tool#Update.2C_upgrade_and_dist-upgrade update and upgrade]
** [http://en.wikipedia.org/wiki/Advanced_Packaging_Tool#Update.2C_upgrade_and_dist-upgrade update, upgrade, ...]
* 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 ===
<pre>$ sudo apt-get update</pre>
 
=== 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 update  # update is used to resynchronize the package index files from their sources
$ sudo apt-get upgrade
$ sudo apt-get upgrade # upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list
$ sudo apt-get dist-upgrade
</pre>
</pre>
=== APT: removing ... ===
<pre>$ sudo apt-get remove PACKAGE</pre>


== dealing with packages files (dpkg ... .deb) ==
== dealing with packages files (dpkg ... .deb) ==


* https://manpages.debian.org/unstable/dpkg/dpkg.1.en.html
* https://manpages.debian.org/unstable/dpkg/dpkg.1.en.html
* http://man7.org/linux/man-pages/man1/dpkg.1.html
* https://www.systutorials.com/docs/linux/man/1-dpkg/


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>


install the Debian package:
=== installing the Debian package ===
<pre>$ sudo dpkg --install PACKAGE.deb</pre>
<pre>$ sudo dpkg --install PACKAGE.deb</pre>


Line 26: Line 34:


* https://manpages.debian.org/unstable/dpkg/dpkg-query.1.en.html
* https://manpages.debian.org/unstable/dpkg/dpkg-query.1.en.html
* http://man7.org/linux/man-pages/man1/dpkg-query.1.html
* https://www.systutorials.com/docs/linux/man/1-dpkg-query/


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>



Revision as of 09:42, 7 May 2018

APT

APT: resynchronising the package index files from their sources

$ sudo apt-get update

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

dealing with packages files (dpkg ... .deb)

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

dealing with installed packages (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-source)

...

$ dpkg-source --extract ....dsc

needs a:

  • *.dsc
  • *.debian.tar.*
  • *.orig.tar.*

rpm2deb

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: