Debian package management: Difference between revisions

From wiki
Jump to navigation Jump to search
imported>Johayek
imported>Johayek
m (improved formatting)
Line 1: Line 1:
: # 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 and upgrade]
:$ sudo apt-get update   # update is used to resynchronize the package index files from their sources
<pre>
:$ 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 update # update is used to resynchronize the package index files from their sources
$ 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
</pre>


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


: # what's the official package name?
what's the official package name?
: $ dpkg --info PACKAGE.deb
<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?
: $ dpkg --contents PACKAGE.deb
<pre>$ dpkg --contents PACKAGE.deb</pre>


: # ...
...
: $ ...
<pre>$ ...</pre>


== dealing with installed packages ==
== dealing with installed packages ==


: # which packages are installed (together with details)?
which packages are installed (together with details)?
: $ dpkg-query --list
<pre>$ dpkg-query --list</pre>


: # is there an installed package, that sounds like XYZ?
is there an installed package, that sounds like XYZ?
: $ dpkg-query --list | fgrep XYZ
<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)
: $ dpkg-query --list PACKAGE
<pre>$ dpkg-query --list PACKAGE</pre>


: # what's the content of an installed package (e.g. PACKAGE)?
what's the content of an installed package (e.g. PACKAGE)?
: $ dpkg-query --listfiles PACKAGE
<pre>$ dpkg-query --listfiles PACKAGE</pre>


: # ...
...
: $ ...
<pre>$ ...</pre>


== rpm2deb ==
== rpm2deb ==
Line 43: Line 45:
(using that e-mail address for the package creator (?)).<br/>
(using that e-mail address for the package creator (?)).<br/>
CAVEAT: won't actually work, because creating a Debian package requires running this as root
CAVEAT: won't actually work, because creating a Debian package requires running this as root
: $ env EMAIL='jochen.hayek@ext.COMPANY.com' alien --to-deb --keep-version ...
<pre>$ env EMAIL='jochen.hayek@COMPANY.com' alien --to-deb --keep-version ...</pre>
some command line parameters can only get passied to "alien" as environment variables.
some command line parameters can only get passied to "alien" as environment variables.


Line 49: Line 51:
you do not have root priviliges,<br/>
you do not have root priviliges,<br/>
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:
: $ fakeroot --unknown-is-real ...
<pre>$ fakeroot --unknown-is-real ...</pre>


=== open questions ===
=== open questions ===

Revision as of 08:43, 20 April 2018

$ sudo apt-get update  # update is used to resynchronize the package index files from their sources
$ 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

dealing with packages files (.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

...

$ ...

dealing with installed packages

which packages are installed (together with 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

what's the content of an installed package (e.g. PACKAGE)?

$ dpkg-query --listfiles PACKAGE

...

$ ...

rpm2deb

alien --to-deb ...

this command line creates a Debian package from an RPM package
(using that e-mail address for the package creator (?)).
CAVEAT: won't actually work, because creating a Debian package requires running this as root

$ env EMAIL='jochen.hayek@COMPANY.com' alien --to-deb --keep-version ...

some command line parameters can only get passied 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 ...

open questions

  • how to deal with dependencies specified within the RPM package?

history of this article

The blog article got created 1st, but then the content got moved here: