Debian package management: Difference between revisions

From wiki
Jump to navigation Jump to search
imported>Johayek
No edit summary
imported>Johayek
mNo edit summary
Line 18: Line 18:
<pre>$ sudo apt-get remove PACKAGE</pre>
<pre>$ sudo apt-get remove PACKAGE</pre>


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


* https://manpages.debian.org/unstable/dpkg/dpkg.1.en.html
* https://manpages.debian.org/unstable/dpkg/dpkg.1.en.html
Line 31: Line 31:
<pre>$ sudo dpkg --install PACKAGE.deb</pre>
<pre>$ sudo dpkg --install PACKAGE.deb</pre>


== dealing with installed packages (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
Line 53: Line 53:
<pre>$ dpkg-query --search FILE</pre>
<pre>$ dpkg-query --search FILE</pre>


== ... (dpkg-source) ==
== 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


...
<pre>$ dpkg-source --extract ....dsc</pre>
<pre>$ dpkg-source --extract ....dsc</pre>
needs a:
needs a:
Line 64: Line 63:
* *.orig.tar.*
* *.orig.tar.*


== rpm2deb ==
== rpm2deb -- convert packages from ... to ... ==


* https://en.wikipedia.org/wiki/Rpm_(software)
* https://en.wikipedia.org/wiki/Rpm_(software)

Revision as of 12:44, 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

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-source -- Debian source package (.dsc) manipulation tool

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

needs a:

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

rpm2deb -- convert packages from ... to ...

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: