SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S




         Advanced Usage of the Debian Packaging System

                                         Richard Darst
                             With contributions from #debian-nyc



                                           September 15, 2010



      Prepared for
      New York Linux User’s Group
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                  Contents

      Debian Policy

      Packaging Nomenclature

      dpkg based tools

      APT utilities

      Advanced things

      Brief introduction to source packages

      Summary and future reference
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                          Goals of this talk



          • Show you what tools are available
          • There is not enough time to discuss these tools in detail
          • This is not designed to be a tutorial
          • Once you know what exists, you can read up on it yourself
              easily, and ask us for help.
                  • man programname
                  • /usr/share/doc/packagename/
                  • Things in this presentation which are uncited will usually come
                     up first on an Internet search.
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                       What is a package?




      Packages are the fundamental unit of a Debian installation
          • Every file on a system belongs to a package
          • ... but some are automatically generated or exceptions
          • Packages include files, but also
                • Control information (descriptions, dependencies, versions)
                • Installation/removal/upgrade scripts
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                        The Debian Policy



      The Debian Policy is rules which packages (and the system in
      general) must follow.
          • Debian’s quality-control document
          • Based on years of experience
          • Formed by convention and mailing list discussion
          • http://www.debian.org/doc/debian-policy/
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                               Examples of things in policy




          • Build interface for packages
          • Definitions of dependency levels
          • User interaction (GUI menu interface, defaults, ...)
          • Location of files (POSIX File Hierarchy Standard)
          • Installation/removal/upgrade scripts
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                     Policy leads to quality



      Policy is considered to be one of the strengths of Debian:
          • Makes things uniform, so we can...
          • Port to many architectures
          • Detect bugs by archive-wide automatic rebuilds
          • Consistent user interface
          • Have package upgrades that work
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                     Suites


      A suite is a section of the Debian archive of packages that go
      together.
        • Suites for releases:
                  • Stable - Unchanging released version
                  • Testing - More stable than unstable, becomes stable upon a
                     release
                  • Unstable - New packages go here, use at your own risk
          • These suites contain the same packages, but different versions
          • Specialized suites: security, experimental, volatile, backports
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                             Dependencies



      Dependencies indicate the relationship between two packages.
          • Depends, Pre-depends, Recommends, Suggests, Enhances,
              Breaks, Conflicts, Provides, Replaces
          • Names are intuitive here
          • Usually, “Recommends” of a package are automatically
              installed, while “Suggests” are not
                  • Depends on package manager
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                Source vs Binary packages



      Debian packages come in two main varities: binary and source
          • As a user, you always deal with binary packages
          • Binary packages are .deb files: compiled code.
          • Source packages are .dsc file, plus .orig.tar.gz, .diff.gz,
              and more: Source code.
          • Source packages are not installed directly
          • .udeb: installer, .tdeb: translation
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                      dpkg



      dpkg is the low-level package manager. Things which it handles
      include:
          • Ensures dependencies are met
          • Installs files from packages
          • Runs scripts for installation/removal/upgrade
          • Maintains database of installed packages
      dpkg operates on .deb files. Usually, you won’t download and
      install .debs yourself.
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                      APT



      APT is the high-level package management system
          • Maintains list of all available packages from the archive
          • Resolves dependencies
          • Downloads and hands install off to dpkg
          • Different frontends: aptitude, synaptic
          • APT replacements: cupt
      APT is what you use for most things you’ll install distributed by
      Debian.
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                  debconf
      Debian has a configuration management system for basic and
      medium customization.
        • debconf (as opposed to DebConf, the conference) is the
          configuration management system
        • Manages the configuration dialogs you see upon
          installation/upgrades.
        • Maintains database for configuration between upgrades
      $ debconf-get-selections
      # U p g r a d i n g from GRUB Legacy .
      grub          grub / migrate  _from  _legacy           note
      # Time zone :
      # Choices : Adelaide , Brisbane , Broken Hill , Canberra , Currie , Darw
      tzdata tzdata / Zones / Australia select
      # Do you want system - wide r e a d a b l e home d i r e c t o r i e s ?
      adduser adduser / homedir - permission                boolean true
      # What do you want to do about m o d i f i e d c o n f i g u r a t i o n file ?
      # Choices : install the package maintainer ’ s version , keep the loca
      ucf           ucf / changeprompt            select keep  _current
      # Keymap :
      # Choices : Programmer , latin1 , latin1 - no dead keys
      console - data          console - data / keymap / qwertz / german / standard / keymap
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                          Version numbers
      Version numbers are important since they indicate upgrades and
      preferred versions. Simple case:
                                   10.16.2 -                            1
                                upstream version debian revision

      Epoch fixes problematic upstream version changes:
                             1 : 10.16.2 -                                     1
                          epoch upstream version debian revision

      Extra modifier for stable updates, backports, other situations:
                            2 : 3.2.5 -4 lenny11
                         epoch upstream version                        extra modifier
                                                                     debian revision
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                          dpkg based tools

      For working and learning about installed packages or .deb files,
      use dpkg and its related tools.
          • dpkg installs files and runs scripts
          • Package naming convention:

                      python-numpy 1.3.0-4 amd64 .deb
                                                         vers. num. architecture
                          package name

          • dpkg state directories: /var/lib/dpkg/
              • /var/lib/dpkg/status
                  •
                      /var/lib/dpkg/info/packagename.{postinst,prerm,md5sums,conffiles,..
                  • /var/lib/dpkg/available
                  • /var/lib/dpkg/
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                dpkg state


      dpkg maintains a database of state of installed and partly installed
      packages.
          • A package can be: not-installed, installed, config-files,
              unpacked, half-installed, and some more.
          • dpkg --remove → leave config files
          • dpkg --purge → remove config files, too
          • The other states are various combinations of installation
              scripts partially run
          • man dpkg
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                      Examining .deb files

      If you have downloaded a .deb yourself, you can learn some about
      it before installing.
          • To extract a .deb: dpkg-deb -x
          • dpkg (really dpkg-deb) can look inside .deb files and tell you
              about them.
          • List files with in a package:
      $ dpkg -c python-numpy 1.3.0-4 amd64.deb
       drwxr - xr - x     root / root                   0    2009 -11 -19       02:19      ./
       drwxr - xr - x     root / root                   0    2009 -11 -19       02:19      ./ usr /
       drwxr - xr - x     root / root                   0    2009 -11 -19       02:19      ./ usr / bin /
       - rwxr - xr - x    root / root                 675    2009 -11 -19       02:19      ./ usr / bin / f2py2 .4
       - rwxr - xr - x    root / root                 675    2009 -11 -19       02:19      ./ usr / bin / f2py2 .5
       drwxr - xr - x     root / root                   0    2009 -11 -19       02:19      ./ usr / share /
       drwxr - xr - x     root / root                   0    2009 -11 -19       02:19      ./ usr / share / man /
       ...
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                      Examining .deb files

          • List control information:

      $ dpkg -I python-numpy 1.3.0-4 amd64.deb
        new debian package , version 2.0.
        size 1818486 bytes : control archive = 11769 bytes .
            1274 bytes ,       22 lines        control
           30246 bytes ,      363 lines        md5sums
             349 bytes ,       11 lines     * postinst                                               # !/ bin / sh
             280 bytes ,       10 lines     * preinst                                                # !/ bin / sh
            1219 bytes ,       47 lines     * prerm                                                  # !/ bin / sh
        Package : python - numpy
        Version : 1:1.3.0 -4
        Architecture : amd64
        Maintainer : Debian Python Modules Team
        < python - modules - team@lists . alioth . debian . org >
        Installed - Size : 7640
        ...
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                               Querying installed packages

      Once a package is installed, a different set of commands is
      necessary to examine them.
          • dpkg -s shows control information for a package
          • dpkg -l lists packages and states
      $ dpkg -l ’bash*’
      Desired = Unknown / Install / Remove / Purge / Hold
      | Status = Not / Inst / Cfg - files / Unpacked / Failed - cfg / Half - inst / trig - aWa
      |/ Err ?=( none )/ Hold / Reinst - required / X = both - problems ( Status , Err : u
      ||/ Name                 Version            Description
      +++ -============== -============== -================================
      ii bash                  3.2 -4             The GNU Bourne Again SHell
      ii bash - completio 20080705                programmable completion for the
      un bash - doc            < none >           ( no description available )
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                 List files within a package
      You can list the files in an installed package with dpkg -l
        • I often use this to get a hint about how to use a package after
          I install it
        • Will not list files that were automatically generated from the
          package’s scripts
      $ dpkg -L bash
      /.
      / bin
      / bin / bash
      / etc
      / etc / skel
      / etc / skel /. bashrc
      / etc / skel /. profile
      / etc / skel /. bash_logout
      / etc / bash . bashrc
      / usr
      / usr / share
      / usr / share / doc
      / usr / share / doc / bash
      / usr / share / doc / bash / CHANGES . gz
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                Backup package selections

      dpkg --get-selections lists installed packages.
          • Back up package installation states
          • Could be used to transfer selections to another computer
          • This does not backup the “automatic/manual” database.
      $ dpkg –get-selections
       a2ps                                                                                install
       acl                                                                                 install
       acpi                                                                                install
       acpi - support - base                                                               install
       acpid                                                                               install
       acx100 - source                                                                     install
       adduser                                                                             install
       alsa - base                                                                         install


          • Use with dpkg --set-selections
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                               Which package owns a file?


      If you are looking at a file and want to know what package put it
      there, use dpkg -S
          • These commands only search currently installed packages
          • Next section gives a better way to search for files
          • Will miss automatically generated files
      $ dpkg -S /etc/bash completion
       bash - completion : / etc / ba s h_ co mp l et io n

      $ dpkg -S /etc/debian version
       base - files : / etc / de bian_ver sion
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



 Other places to look for information on installed packages
      After installing a package, a common question is “How do I use
      it?”
          • It is usually worth it to take a bit of time to learn the Debian
              way of using a package, instead of rolling your own
              configuration.
          • List files in it: dpkg -l packagename
          • Per-package documentation:
              /usr/share/doc/packagename/
                  • /usr/share/doc/packagename/NEWS.Debian.gz - Major
                     changes you should be aware of
                  • /usr/share/doc/packagename/changelog.gz - upstream
                     changelog
                  • /usr/share/doc/packagename/changelog.Debian.gz -
                     Debian changelog
          • /etc/defaults/packagename - Sometimes useful for
              daemon-like packages
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                           APT: Advanced Packaging Tool



      APT is the companion to dpkg
          • APT is a higher level than dpkg
          • APT handles dependencies and downloading
          • Configure mirrors and suites in /etc/apt/sources.list
          • Stores it’s state in /var/cache/apt/
          • dpkg deals with what is installed, APT deals with what can be
              installed
      APT is a set of libraries with different frontends.
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                         Frontends to APT


      There are different frontends to APT , and they can have slightly
      behaviors:
          • apt-cache, apt-get
          • aptitude
              • Smarter at resolving dependencies
              • Installs recommends by default (aptitude
                --without-recommends to change)
              • The currently recommended distribution upgrade program
          • synaptic, KPackage, apt-rpm, and many more...
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                        APT cache utilities

      The first thing APT can do is search available packages
          • Run apt-get update to refresh the list of what is available.
          • Use apt-cache to search for packages and show packages
      $ apt-cache search calculator
       abakus - calculator for KDE
       allegro - examples - example programs and demo tools for the Allegro
       apcalc - common - Arbitrary precision calculator ( common files )
       apcalc - dev - Library for arbitrary precision arithmetic
       ...

      $ apt-cache show abakus
       Package : abakus
       Priority : optional
       Section : kde
       Installed - Size : 728
       ...
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                 APT dependency handling
      APT handles dependencies intelligently (downloading them), while
      dpkg just fails if dependencies are not met.
          • To find related programs, look at dependencies and reverse
              dependencies - you may find something that will help you
          • I always just do this from the aptitude user interface
      $ apt-cache depends units
       units
          Depends :       libc6
          Depends :       libncurses5
          Depends :       libreadline6
        | Depends :       dpkg
          Depends :       install - info

      $ apt-cache rdepends units
       units
       Reverse Depends :
         octave - miscellaneous
         ibid
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                 apt-file

      You can do archive-wide searches of files within packages.
          • dpkg -S only finds currently installed files
          • apt-file searches all the archive (using Contents.gz) for
              files
      $ aptitude install apt-file
      $ apt-file update
      $ apt-file search bin/host
       apt - file search bin / host
       bind9 - host : / usr / bin / host
       coreutils : / usr / bin / hostid
       host : / usr / bin / host
       hostap - utils : / usr / sbin / h o s t a p _ c r y p t _ c o n f
       hostap - utils : / usr / sbin / hostap_diag
       ...
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                Other APT package states
      APT has more states that dpkg . dpkg just looks at installed or
      not, but APT has more
        • Some APT frontends (aptitude was first, apt-get has it now,
           too) maintain a database of manually installed vs
           automatically installed as dependencies.
                  • If you uninstall a package, its dependencies are automatically
                     uninstalled, too.
                  • This is why I used to recommend always using aptitude. Use
                     “m”/“M” to adjust auto-flag.
                  • aptitude vs apt-get databases here
          • Hold - APT will never upgrade this package to a newer
            version.
          • Recommends vs suggests
                  • Recommends are usually automatically installed, suggests are
                     usually not.
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                   Pinning
      Pinning indicates package preferences:
        • If you mixed suites (Stable and Testing, backports), pinning
          can tell APT to prefer certain
                  •   suites
                  •   repositories
                  •   versions
                  •   and more
          • man apt preferences
          • Example (Use testing and unstable, but prefer testing):
              Package : *
              Pin : release a = testing
              Pin - Priority : 900

              Package : *
              Pin : release a = unstable
              Pin - Priority : 800
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                   Diversions and overrides
      You can tell dpkg to preserve certain custom modifications.
          • You want to change a file in a package, but have it not get
              overridden when you upgrade the package the next time
          • Diversion: Tell dpkg to install a file in a different location, so
              that your can replace it and not be squashed on upgrades
                  • dpkg-divert
          • Stat-override: tell dpkg to keep file permissions/owner at
              some value
                  • dpkg-statoverride
          • These are used by packaging scripts, too. Try listing
      $ dpkg-divert –divert /etc/dnsmasq.conf.dpkg –rename
      /etc/dnsmasq.conf
       Adding ’ local diversion of / etc / dnsmasq . conf to / etc / dnsmasq . conf .

      $ dpkg-statoverride –add richard richard 0755
      /etc/bash.bashrc $ dpkg-divert –list $ dpkg-statoverride
      –list
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                   equivs
      equivs lets you easily make meta-packages.
        • Sample uses:
                  • Meta-package to pull in programs you use often
                  • Fix broken dependency problem (your package Provides:
                     something)
                  • Let dpkg know about your local version
          • Can include dependencies, scripts, and files
          • equivs-control and equivs-build
      $ less rkd-standard-system
       ...
       Package : rkd - standard - system
       Version : 1.0
       Maintainer : Richard Darst < rkd@zgib . net >
       Depends : less ,
                 screen ,
                 python2 .5 ,
                 bash - completion ,
                 openssh - server ,
                 openssh - client
       ...
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                   The alternatives system
      Debian has many choices, and the alternatives system allows the
      user to choose among them.
        • Sometimes different packages can provide equivalent utilities.
        • Alternates system selects among them
        • /usr/bin/vim links to /etc/alternates/vim/ links to
           /usr/bin/vim.tiny
        • Different packages install alternates with different priorities
        • Select among them with update-alternatives. Handles
           things like man page links also.
        • GUI interface in package galternatives
        • You have to install the relevant packages first!
      $ sudo update-alternatives –list vim
      / usr / bin / vim . basic
      / usr / bin / vim . basic
      / usr / bin / vim . nox

      $ sudo update-alternatives –config vim
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                             dpkg-repack



      dpkg-repack undoes an installation in emergency situations.
          • Convert installed files back to the package it came from
          • includes control info, scripts, and files
          • Inherits changes that have been made to the files
          • Kind of a hack, use a native package if possible
          • rpm, deb, tgz, pkg
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                     alien




      You can convert between package formats with alien
          • Is not safe since different OSs have different conventions (e.g.
              Debian Policy vs Red Hat Policy)
          • But for small unobtrusive things it’s probably safe enough.
          • Do not use for major system utilities
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                 auto-apt




      auto-apt traces a program to figure out what packages it needs.
          • Run a program in auto-apt environment and it will trap
              system calls for missing files
          • Can automatically install packages providing the missing files
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                   Debtags
      To help people find what they are looking for, the Debtags system
      was developed
        • Free-form tags for packages
        • http://debtags.alioth.debian.org/ssearch.html -
          package search, enhanced by debtags
        • http://debtags.alioth.debian.org/cloud/ - interactive
          tag cloud
        • You can help tag packages online, too!
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



         Kernel help: make-kpkg and module-assistant

      There are tools which help create packages of kernel images and
      modules.
          • make-kpkg automates building and packaging kernels when
            you get the source from elsewhere
          • module-assistant automates building module packages
                  • The packagename-source packages use this
          • packagename-dkms (“Dynamic Kernel Module Support”)
              packages are another system for automatically compiling
              modules.
      $ aptitude install lustre-source –without-recommends
      $ module-assistant auto-install lustre
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                           reportbug and reportbug-ng
      If people help report bugs, Debian’s quality goes up.
         • http://bugs.debian.org
         • There isn’t a web interface to report bugs
         • reportbug and reportbug-ng make reporting easy, though.
           Gathers all information and submits.
      $ reportbug –email=MYEMAIL@zgib.net python-lzma
       Which of the following packages is the bug in ?
       Just press ENTER to exit reportbug .

      1 python - lzma                   Python bindings for liblzma

      2 python - lzma - dbg python - lzma debug symbols
      Select one of these packages : 1
      Please enter the version of the package this report applies to ( bl
      >
      Will send report to Debian ( per lsb_release ).
      Querying Debian BTS for reports on python - lzma ( source )...
      1 bug report found :

       Outstanding bugs -- Minor bugs ; Unclassified (1 bug )
         1) # 594943 python - lzma has d u p l i c a t e d c h a n g e l o g . gz
       Please briefly describe your problem ( max . 100 characters allowed ;
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                        Useful web services


      Over the years Debian has developed a lot of useful but
      undermarketed web services.
          • backports.debian.org - Find newer versions of packages
              for stable
          • snapshot.debian.org - Archive of every single debian
              package on the mirrors ever
          • bugs.debian.org - Search bug reports for a package
          • packages.debian.org - Web interface to some of these
              tools
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                     Source package layout

      Source packages contain buildable source code, and can be
      retrieved from the APT system.
         • debian/ directory should contain all Debian information
                  • debian/rules - build instructions (a Makefile)
                  • debian/control - Meta-information
                  • debian/changelog - Version number and changes
          • dpkg-source packs and unpacks source trees
          • dpkg-buildpackage builds binary packages
          • dpkg-deb packs and unpacks binary packages
          • Getting the source to any package
              • Make sure a deb-src line is in your /etc/apt/sources.list
              • apt-get source packagename
              • apt-get build-dep packagename
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                       Useful devscripts


      devscripts contains a lot of useful tools for packagers and
      developers.
          • rmadison queries versions of packages in all suites
          • debdiff intelligently diffs source or binary packages
          • aptitude install devscripts --without-recommends
                  • Has a lot of recommends
      $ rmadison bash
                 bash |               3.2 -4 |                 stable | source , alpha , amd64 , ar
                 bash |               4.1 -3 |                testing | source , amd64 , armel , hp
                 bash |               4.1 -3 |               unstable | source , alpha , amd64 , ar
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                   Fast package rebuliding




      The consistent build interface means it is easy to rebuild packages:
      $ apt-get source bash
      $ sudo apt-get build-dep bash
      $ cd bash-VERSION/
      $ debuild
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                There is much, much more




          • We’ve gone over some basic utilities here
          • This list is biased towards what I know - there so much that I
              am missing
          • Debian-NYC has workshops which go into more detail about
              the development side of things
          • http://wiki.debian.org/DebianNYC
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                            More resources

      User resources:
          • http://www.debian.org/doc/manuals/reference/ -
              Debian user guide, highly recommended
          • http://www.debian.org/doc/manuals/refcard/
              refcard.en.pdf - Debian reference card
      Development resources:
          • http://www.debian.org/doc/developers-reference/ -
              Developer’s reference, useful for creating packages
          • http://www.debian.org/doc/debian-policy/ - Debian
              policy document
          • http://www.debian.org/doc/maint-guide/ - New
              Maintainer’s guide, first steps to making a package
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                                   The end




                                                   Thank you
Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S



                                  Presentation permissions
      You are free to use this presentation under the 3-clause BSD
      license.
      Copyright (c) Richard Darst, 2010
      All rights reserved.

      Redistribution and use in source and binary forms, with or without
      modification, are permitted provided that the following conditions are met:
          * Redistributions of source code must retain the above copyright
            notice, this list of conditions and the following disclaimer.
          * Redistributions in binary form must reproduce the above copyright
            notice, this list of conditions and the following disclaimer in the
            documentation and/or other materials provided with the distribution.
          * Neither the name of the <organization> nor the
            names of its contributors may be used to endorse or promote products
            derived from this software without specific prior written permission.

      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
      ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
      DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
      DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
      SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Mais conteúdo relacionado

Semelhante a Advanced Usage of the Debian Packaging System

How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.İbrahim UÇAR
 
Debian Packaging tutorial
Debian Packaging tutorialDebian Packaging tutorial
Debian Packaging tutorialnussbauml
 
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...Anne Nicolas
 
Presentation distro recipes-2013
Presentation distro recipes-2013Presentation distro recipes-2013
Presentation distro recipes-2013olberger
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Ahmed El-Arabawy
 
Distro Recipes 2013 : Debian and quality assurance
Distro Recipes 2013 : Debian and quality assuranceDistro Recipes 2013 : Debian and quality assurance
Distro Recipes 2013 : Debian and quality assuranceAnne Nicolas
 
Generating Linked Data descriptions of Debian packages in the Debian PTS
Generating Linked Data descriptions of Debian packages in the Debian PTSGenerating Linked Data descriptions of Debian packages in the Debian PTS
Generating Linked Data descriptions of Debian packages in the Debian PTSolberger
 
Understanding Debian Packages (2014)
Understanding Debian Packages (2014)Understanding Debian Packages (2014)
Understanding Debian Packages (2014)Miriam Ruiz
 
Effectively using Open Source with conda
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with condaTravis Oliphant
 
Distributions and package management in the containers era
Distributions and package management in the containers eraDistributions and package management in the containers era
Distributions and package management in the containers eranussbauml
 
Respositórios do Ubuntu, santo apt-get e outras coisas
Respositórios do Ubuntu, santo apt-get e outras coisasRespositórios do Ubuntu, santo apt-get e outras coisas
Respositórios do Ubuntu, santo apt-get e outras coisasQuefo.me
 
101 2.4 use debian package management
101 2.4 use debian package management101 2.4 use debian package management
101 2.4 use debian package managementAcácio Oliveira
 
Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Chef
 
Chef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & ChefChef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & Chefice799
 
Linux Package Management.pptx
Linux Package Management.pptxLinux Package Management.pptx
Linux Package Management.pptxHussienEndris1
 

Semelhante a Advanced Usage of the Debian Packaging System (20)

How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.
 
Debian Packaging tutorial
Debian Packaging tutorialDebian Packaging tutorial
Debian Packaging tutorial
 
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
 
Presentation distro recipes-2013
Presentation distro recipes-2013Presentation distro recipes-2013
Presentation distro recipes-2013
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management
 
Distro Recipes 2013 : Debian and quality assurance
Distro Recipes 2013 : Debian and quality assuranceDistro Recipes 2013 : Debian and quality assurance
Distro Recipes 2013 : Debian and quality assurance
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
Linuxconcepts
LinuxconceptsLinuxconcepts
Linuxconcepts
 
Generating Linked Data descriptions of Debian packages in the Debian PTS
Generating Linked Data descriptions of Debian packages in the Debian PTSGenerating Linked Data descriptions of Debian packages in the Debian PTS
Generating Linked Data descriptions of Debian packages in the Debian PTS
 
Understanding Debian Packages (2014)
Understanding Debian Packages (2014)Understanding Debian Packages (2014)
Understanding Debian Packages (2014)
 
$ make install
$ make install$ make install
$ make install
 
Effectively using Open Source with conda
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with conda
 
Distributions and package management in the containers era
Distributions and package management in the containers eraDistributions and package management in the containers era
Distributions and package management in the containers era
 
Respositórios do Ubuntu, santo apt-get e outras coisas
Respositórios do Ubuntu, santo apt-get e outras coisasRespositórios do Ubuntu, santo apt-get e outras coisas
Respositórios do Ubuntu, santo apt-get e outras coisas
 
RPM Packaging 101 (Old)
RPM Packaging 101 (Old)RPM Packaging 101 (Old)
RPM Packaging 101 (Old)
 
101 2.4 use debian package management
101 2.4 use debian package management101 2.4 use debian package management
101 2.4 use debian package management
 
Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015
 
Chef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & ChefChef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & Chef
 
Debian Packaging
Debian PackagingDebian Packaging
Debian Packaging
 
Linux Package Management.pptx
Linux Package Management.pptxLinux Package Management.pptx
Linux Package Management.pptx
 

Mais de Adam Gonnerman

Widening the Welcome of Your Congregation
Widening the Welcome of Your CongregationWidening the Welcome of Your Congregation
Widening the Welcome of Your CongregationAdam Gonnerman
 
Should the Unitarians and Universalists Merge?
Should the Unitarians and Universalists Merge?Should the Unitarians and Universalists Merge?
Should the Unitarians and Universalists Merge?Adam Gonnerman
 
A Conference Called Wonder - 2016 Program
A Conference Called Wonder - 2016 ProgramA Conference Called Wonder - 2016 Program
A Conference Called Wonder - 2016 ProgramAdam Gonnerman
 
Ethical Culture Leadership Training Handbook
Ethical Culture Leadership Training HandbookEthical Culture Leadership Training Handbook
Ethical Culture Leadership Training HandbookAdam Gonnerman
 
AEU Dialogue - Spring 2015
AEU Dialogue - Spring 2015AEU Dialogue - Spring 2015
AEU Dialogue - Spring 2015Adam Gonnerman
 
Ministério Social Beija-Flor - 2008/2009
Ministério Social Beija-Flor - 2008/2009Ministério Social Beija-Flor - 2008/2009
Ministério Social Beija-Flor - 2008/2009Adam Gonnerman
 
Reforma do parquinho na Missão Criança - 04/03/09
Reforma do parquinho na Missão Criança - 04/03/09Reforma do parquinho na Missão Criança - 04/03/09
Reforma do parquinho na Missão Criança - 04/03/09Adam Gonnerman
 
Café da Manhã Missão Criança - 14/12/08
Café da Manhã Missão Criança - 14/12/08Café da Manhã Missão Criança - 14/12/08
Café da Manhã Missão Criança - 14/12/08Adam Gonnerman
 
Visita a Comunidades Carentes de Uberlândia - 06/12/08
Visita a Comunidades Carentes de Uberlândia - 06/12/08Visita a Comunidades Carentes de Uberlândia - 06/12/08
Visita a Comunidades Carentes de Uberlândia - 06/12/08Adam Gonnerman
 

Mais de Adam Gonnerman (12)

Donald Trump Report
Donald Trump ReportDonald Trump Report
Donald Trump Report
 
Widening the Welcome of Your Congregation
Widening the Welcome of Your CongregationWidening the Welcome of Your Congregation
Widening the Welcome of Your Congregation
 
Should the Unitarians and Universalists Merge?
Should the Unitarians and Universalists Merge?Should the Unitarians and Universalists Merge?
Should the Unitarians and Universalists Merge?
 
A Conference Called Wonder - 2016 Program
A Conference Called Wonder - 2016 ProgramA Conference Called Wonder - 2016 Program
A Conference Called Wonder - 2016 Program
 
Ethical Culture Leadership Training Handbook
Ethical Culture Leadership Training HandbookEthical Culture Leadership Training Handbook
Ethical Culture Leadership Training Handbook
 
AEU Dialogue - Spring 2015
AEU Dialogue - Spring 2015AEU Dialogue - Spring 2015
AEU Dialogue - Spring 2015
 
Brazil 1997
Brazil 1997Brazil 1997
Brazil 1997
 
Ministério Social Beija-Flor - 2008/2009
Ministério Social Beija-Flor - 2008/2009Ministério Social Beija-Flor - 2008/2009
Ministério Social Beija-Flor - 2008/2009
 
Reforma do parquinho na Missão Criança - 04/03/09
Reforma do parquinho na Missão Criança - 04/03/09Reforma do parquinho na Missão Criança - 04/03/09
Reforma do parquinho na Missão Criança - 04/03/09
 
Café da Manhã Missão Criança - 14/12/08
Café da Manhã Missão Criança - 14/12/08Café da Manhã Missão Criança - 14/12/08
Café da Manhã Missão Criança - 14/12/08
 
Visita a Comunidades Carentes de Uberlândia - 06/12/08
Visita a Comunidades Carentes de Uberlândia - 06/12/08Visita a Comunidades Carentes de Uberlândia - 06/12/08
Visita a Comunidades Carentes de Uberlândia - 06/12/08
 
Brazil presentation
Brazil presentationBrazil presentation
Brazil presentation
 

Último

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Último (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Advanced Usage of the Debian Packaging System

  • 1. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Advanced Usage of the Debian Packaging System Richard Darst With contributions from #debian-nyc September 15, 2010 Prepared for New York Linux User’s Group
  • 2. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Contents Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages Summary and future reference
  • 3. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Goals of this talk • Show you what tools are available • There is not enough time to discuss these tools in detail • This is not designed to be a tutorial • Once you know what exists, you can read up on it yourself easily, and ask us for help. • man programname • /usr/share/doc/packagename/ • Things in this presentation which are uncited will usually come up first on an Internet search.
  • 4. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S What is a package? Packages are the fundamental unit of a Debian installation • Every file on a system belongs to a package • ... but some are automatically generated or exceptions • Packages include files, but also • Control information (descriptions, dependencies, versions) • Installation/removal/upgrade scripts
  • 5. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S The Debian Policy The Debian Policy is rules which packages (and the system in general) must follow. • Debian’s quality-control document • Based on years of experience • Formed by convention and mailing list discussion • http://www.debian.org/doc/debian-policy/
  • 6. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Examples of things in policy • Build interface for packages • Definitions of dependency levels • User interaction (GUI menu interface, defaults, ...) • Location of files (POSIX File Hierarchy Standard) • Installation/removal/upgrade scripts
  • 7. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Policy leads to quality Policy is considered to be one of the strengths of Debian: • Makes things uniform, so we can... • Port to many architectures • Detect bugs by archive-wide automatic rebuilds • Consistent user interface • Have package upgrades that work
  • 8. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Suites A suite is a section of the Debian archive of packages that go together. • Suites for releases: • Stable - Unchanging released version • Testing - More stable than unstable, becomes stable upon a release • Unstable - New packages go here, use at your own risk • These suites contain the same packages, but different versions • Specialized suites: security, experimental, volatile, backports
  • 9. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Dependencies Dependencies indicate the relationship between two packages. • Depends, Pre-depends, Recommends, Suggests, Enhances, Breaks, Conflicts, Provides, Replaces • Names are intuitive here • Usually, “Recommends” of a package are automatically installed, while “Suggests” are not • Depends on package manager
  • 10. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Source vs Binary packages Debian packages come in two main varities: binary and source • As a user, you always deal with binary packages • Binary packages are .deb files: compiled code. • Source packages are .dsc file, plus .orig.tar.gz, .diff.gz, and more: Source code. • Source packages are not installed directly • .udeb: installer, .tdeb: translation
  • 11. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S dpkg dpkg is the low-level package manager. Things which it handles include: • Ensures dependencies are met • Installs files from packages • Runs scripts for installation/removal/upgrade • Maintains database of installed packages dpkg operates on .deb files. Usually, you won’t download and install .debs yourself.
  • 12. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S APT APT is the high-level package management system • Maintains list of all available packages from the archive • Resolves dependencies • Downloads and hands install off to dpkg • Different frontends: aptitude, synaptic • APT replacements: cupt APT is what you use for most things you’ll install distributed by Debian.
  • 13. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S debconf Debian has a configuration management system for basic and medium customization. • debconf (as opposed to DebConf, the conference) is the configuration management system • Manages the configuration dialogs you see upon installation/upgrades. • Maintains database for configuration between upgrades $ debconf-get-selections # U p g r a d i n g from GRUB Legacy . grub grub / migrate _from _legacy note # Time zone : # Choices : Adelaide , Brisbane , Broken Hill , Canberra , Currie , Darw tzdata tzdata / Zones / Australia select # Do you want system - wide r e a d a b l e home d i r e c t o r i e s ? adduser adduser / homedir - permission boolean true # What do you want to do about m o d i f i e d c o n f i g u r a t i o n file ? # Choices : install the package maintainer ’ s version , keep the loca ucf ucf / changeprompt select keep _current # Keymap : # Choices : Programmer , latin1 , latin1 - no dead keys console - data console - data / keymap / qwertz / german / standard / keymap
  • 14. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Version numbers Version numbers are important since they indicate upgrades and preferred versions. Simple case: 10.16.2 - 1 upstream version debian revision Epoch fixes problematic upstream version changes: 1 : 10.16.2 - 1 epoch upstream version debian revision Extra modifier for stable updates, backports, other situations: 2 : 3.2.5 -4 lenny11 epoch upstream version extra modifier debian revision
  • 15. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S dpkg based tools For working and learning about installed packages or .deb files, use dpkg and its related tools. • dpkg installs files and runs scripts • Package naming convention: python-numpy 1.3.0-4 amd64 .deb vers. num. architecture package name • dpkg state directories: /var/lib/dpkg/ • /var/lib/dpkg/status • /var/lib/dpkg/info/packagename.{postinst,prerm,md5sums,conffiles,.. • /var/lib/dpkg/available • /var/lib/dpkg/
  • 16. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S dpkg state dpkg maintains a database of state of installed and partly installed packages. • A package can be: not-installed, installed, config-files, unpacked, half-installed, and some more. • dpkg --remove → leave config files • dpkg --purge → remove config files, too • The other states are various combinations of installation scripts partially run • man dpkg
  • 17. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Examining .deb files If you have downloaded a .deb yourself, you can learn some about it before installing. • To extract a .deb: dpkg-deb -x • dpkg (really dpkg-deb) can look inside .deb files and tell you about them. • List files with in a package: $ dpkg -c python-numpy 1.3.0-4 amd64.deb drwxr - xr - x root / root 0 2009 -11 -19 02:19 ./ drwxr - xr - x root / root 0 2009 -11 -19 02:19 ./ usr / drwxr - xr - x root / root 0 2009 -11 -19 02:19 ./ usr / bin / - rwxr - xr - x root / root 675 2009 -11 -19 02:19 ./ usr / bin / f2py2 .4 - rwxr - xr - x root / root 675 2009 -11 -19 02:19 ./ usr / bin / f2py2 .5 drwxr - xr - x root / root 0 2009 -11 -19 02:19 ./ usr / share / drwxr - xr - x root / root 0 2009 -11 -19 02:19 ./ usr / share / man / ...
  • 18. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Examining .deb files • List control information: $ dpkg -I python-numpy 1.3.0-4 amd64.deb new debian package , version 2.0. size 1818486 bytes : control archive = 11769 bytes . 1274 bytes , 22 lines control 30246 bytes , 363 lines md5sums 349 bytes , 11 lines * postinst # !/ bin / sh 280 bytes , 10 lines * preinst # !/ bin / sh 1219 bytes , 47 lines * prerm # !/ bin / sh Package : python - numpy Version : 1:1.3.0 -4 Architecture : amd64 Maintainer : Debian Python Modules Team < python - modules - team@lists . alioth . debian . org > Installed - Size : 7640 ...
  • 19. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Querying installed packages Once a package is installed, a different set of commands is necessary to examine them. • dpkg -s shows control information for a package • dpkg -l lists packages and states $ dpkg -l ’bash*’ Desired = Unknown / Install / Remove / Purge / Hold | Status = Not / Inst / Cfg - files / Unpacked / Failed - cfg / Half - inst / trig - aWa |/ Err ?=( none )/ Hold / Reinst - required / X = both - problems ( Status , Err : u ||/ Name Version Description +++ -============== -============== -================================ ii bash 3.2 -4 The GNU Bourne Again SHell ii bash - completio 20080705 programmable completion for the un bash - doc < none > ( no description available )
  • 20. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S List files within a package You can list the files in an installed package with dpkg -l • I often use this to get a hint about how to use a package after I install it • Will not list files that were automatically generated from the package’s scripts $ dpkg -L bash /. / bin / bin / bash / etc / etc / skel / etc / skel /. bashrc / etc / skel /. profile / etc / skel /. bash_logout / etc / bash . bashrc / usr / usr / share / usr / share / doc / usr / share / doc / bash / usr / share / doc / bash / CHANGES . gz
  • 21. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Backup package selections dpkg --get-selections lists installed packages. • Back up package installation states • Could be used to transfer selections to another computer • This does not backup the “automatic/manual” database. $ dpkg –get-selections a2ps install acl install acpi install acpi - support - base install acpid install acx100 - source install adduser install alsa - base install • Use with dpkg --set-selections
  • 22. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Which package owns a file? If you are looking at a file and want to know what package put it there, use dpkg -S • These commands only search currently installed packages • Next section gives a better way to search for files • Will miss automatically generated files $ dpkg -S /etc/bash completion bash - completion : / etc / ba s h_ co mp l et io n $ dpkg -S /etc/debian version base - files : / etc / de bian_ver sion
  • 23. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Other places to look for information on installed packages After installing a package, a common question is “How do I use it?” • It is usually worth it to take a bit of time to learn the Debian way of using a package, instead of rolling your own configuration. • List files in it: dpkg -l packagename • Per-package documentation: /usr/share/doc/packagename/ • /usr/share/doc/packagename/NEWS.Debian.gz - Major changes you should be aware of • /usr/share/doc/packagename/changelog.gz - upstream changelog • /usr/share/doc/packagename/changelog.Debian.gz - Debian changelog • /etc/defaults/packagename - Sometimes useful for daemon-like packages
  • 24. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S APT: Advanced Packaging Tool APT is the companion to dpkg • APT is a higher level than dpkg • APT handles dependencies and downloading • Configure mirrors and suites in /etc/apt/sources.list • Stores it’s state in /var/cache/apt/ • dpkg deals with what is installed, APT deals with what can be installed APT is a set of libraries with different frontends.
  • 25. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Frontends to APT There are different frontends to APT , and they can have slightly behaviors: • apt-cache, apt-get • aptitude • Smarter at resolving dependencies • Installs recommends by default (aptitude --without-recommends to change) • The currently recommended distribution upgrade program • synaptic, KPackage, apt-rpm, and many more...
  • 26. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S APT cache utilities The first thing APT can do is search available packages • Run apt-get update to refresh the list of what is available. • Use apt-cache to search for packages and show packages $ apt-cache search calculator abakus - calculator for KDE allegro - examples - example programs and demo tools for the Allegro apcalc - common - Arbitrary precision calculator ( common files ) apcalc - dev - Library for arbitrary precision arithmetic ... $ apt-cache show abakus Package : abakus Priority : optional Section : kde Installed - Size : 728 ...
  • 27. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S APT dependency handling APT handles dependencies intelligently (downloading them), while dpkg just fails if dependencies are not met. • To find related programs, look at dependencies and reverse dependencies - you may find something that will help you • I always just do this from the aptitude user interface $ apt-cache depends units units Depends : libc6 Depends : libncurses5 Depends : libreadline6 | Depends : dpkg Depends : install - info $ apt-cache rdepends units units Reverse Depends : octave - miscellaneous ibid
  • 28. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S apt-file You can do archive-wide searches of files within packages. • dpkg -S only finds currently installed files • apt-file searches all the archive (using Contents.gz) for files $ aptitude install apt-file $ apt-file update $ apt-file search bin/host apt - file search bin / host bind9 - host : / usr / bin / host coreutils : / usr / bin / hostid host : / usr / bin / host hostap - utils : / usr / sbin / h o s t a p _ c r y p t _ c o n f hostap - utils : / usr / sbin / hostap_diag ...
  • 29. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Other APT package states APT has more states that dpkg . dpkg just looks at installed or not, but APT has more • Some APT frontends (aptitude was first, apt-get has it now, too) maintain a database of manually installed vs automatically installed as dependencies. • If you uninstall a package, its dependencies are automatically uninstalled, too. • This is why I used to recommend always using aptitude. Use “m”/“M” to adjust auto-flag. • aptitude vs apt-get databases here • Hold - APT will never upgrade this package to a newer version. • Recommends vs suggests • Recommends are usually automatically installed, suggests are usually not.
  • 30. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Pinning Pinning indicates package preferences: • If you mixed suites (Stable and Testing, backports), pinning can tell APT to prefer certain • suites • repositories • versions • and more • man apt preferences • Example (Use testing and unstable, but prefer testing): Package : * Pin : release a = testing Pin - Priority : 900 Package : * Pin : release a = unstable Pin - Priority : 800
  • 31. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Diversions and overrides You can tell dpkg to preserve certain custom modifications. • You want to change a file in a package, but have it not get overridden when you upgrade the package the next time • Diversion: Tell dpkg to install a file in a different location, so that your can replace it and not be squashed on upgrades • dpkg-divert • Stat-override: tell dpkg to keep file permissions/owner at some value • dpkg-statoverride • These are used by packaging scripts, too. Try listing $ dpkg-divert –divert /etc/dnsmasq.conf.dpkg –rename /etc/dnsmasq.conf Adding ’ local diversion of / etc / dnsmasq . conf to / etc / dnsmasq . conf . $ dpkg-statoverride –add richard richard 0755 /etc/bash.bashrc $ dpkg-divert –list $ dpkg-statoverride –list
  • 32. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S equivs equivs lets you easily make meta-packages. • Sample uses: • Meta-package to pull in programs you use often • Fix broken dependency problem (your package Provides: something) • Let dpkg know about your local version • Can include dependencies, scripts, and files • equivs-control and equivs-build $ less rkd-standard-system ... Package : rkd - standard - system Version : 1.0 Maintainer : Richard Darst < rkd@zgib . net > Depends : less , screen , python2 .5 , bash - completion , openssh - server , openssh - client ...
  • 33. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S The alternatives system Debian has many choices, and the alternatives system allows the user to choose among them. • Sometimes different packages can provide equivalent utilities. • Alternates system selects among them • /usr/bin/vim links to /etc/alternates/vim/ links to /usr/bin/vim.tiny • Different packages install alternates with different priorities • Select among them with update-alternatives. Handles things like man page links also. • GUI interface in package galternatives • You have to install the relevant packages first! $ sudo update-alternatives –list vim / usr / bin / vim . basic / usr / bin / vim . basic / usr / bin / vim . nox $ sudo update-alternatives –config vim
  • 34. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S dpkg-repack dpkg-repack undoes an installation in emergency situations. • Convert installed files back to the package it came from • includes control info, scripts, and files • Inherits changes that have been made to the files • Kind of a hack, use a native package if possible • rpm, deb, tgz, pkg
  • 35. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S alien You can convert between package formats with alien • Is not safe since different OSs have different conventions (e.g. Debian Policy vs Red Hat Policy) • But for small unobtrusive things it’s probably safe enough. • Do not use for major system utilities
  • 36. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S auto-apt auto-apt traces a program to figure out what packages it needs. • Run a program in auto-apt environment and it will trap system calls for missing files • Can automatically install packages providing the missing files
  • 37. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Debtags To help people find what they are looking for, the Debtags system was developed • Free-form tags for packages • http://debtags.alioth.debian.org/ssearch.html - package search, enhanced by debtags • http://debtags.alioth.debian.org/cloud/ - interactive tag cloud • You can help tag packages online, too!
  • 38. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Kernel help: make-kpkg and module-assistant There are tools which help create packages of kernel images and modules. • make-kpkg automates building and packaging kernels when you get the source from elsewhere • module-assistant automates building module packages • The packagename-source packages use this • packagename-dkms (“Dynamic Kernel Module Support”) packages are another system for automatically compiling modules. $ aptitude install lustre-source –without-recommends $ module-assistant auto-install lustre
  • 39. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S reportbug and reportbug-ng If people help report bugs, Debian’s quality goes up. • http://bugs.debian.org • There isn’t a web interface to report bugs • reportbug and reportbug-ng make reporting easy, though. Gathers all information and submits. $ reportbug –email=MYEMAIL@zgib.net python-lzma Which of the following packages is the bug in ? Just press ENTER to exit reportbug . 1 python - lzma Python bindings for liblzma 2 python - lzma - dbg python - lzma debug symbols Select one of these packages : 1 Please enter the version of the package this report applies to ( bl > Will send report to Debian ( per lsb_release ). Querying Debian BTS for reports on python - lzma ( source )... 1 bug report found : Outstanding bugs -- Minor bugs ; Unclassified (1 bug ) 1) # 594943 python - lzma has d u p l i c a t e d c h a n g e l o g . gz Please briefly describe your problem ( max . 100 characters allowed ;
  • 40. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Useful web services Over the years Debian has developed a lot of useful but undermarketed web services. • backports.debian.org - Find newer versions of packages for stable • snapshot.debian.org - Archive of every single debian package on the mirrors ever • bugs.debian.org - Search bug reports for a package • packages.debian.org - Web interface to some of these tools
  • 41. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Source package layout Source packages contain buildable source code, and can be retrieved from the APT system. • debian/ directory should contain all Debian information • debian/rules - build instructions (a Makefile) • debian/control - Meta-information • debian/changelog - Version number and changes • dpkg-source packs and unpacks source trees • dpkg-buildpackage builds binary packages • dpkg-deb packs and unpacks binary packages • Getting the source to any package • Make sure a deb-src line is in your /etc/apt/sources.list • apt-get source packagename • apt-get build-dep packagename
  • 42. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Useful devscripts devscripts contains a lot of useful tools for packagers and developers. • rmadison queries versions of packages in all suites • debdiff intelligently diffs source or binary packages • aptitude install devscripts --without-recommends • Has a lot of recommends $ rmadison bash bash | 3.2 -4 | stable | source , alpha , amd64 , ar bash | 4.1 -3 | testing | source , amd64 , armel , hp bash | 4.1 -3 | unstable | source , alpha , amd64 , ar
  • 43. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Fast package rebuliding The consistent build interface means it is easy to rebuild packages: $ apt-get source bash $ sudo apt-get build-dep bash $ cd bash-VERSION/ $ debuild
  • 44. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S There is much, much more • We’ve gone over some basic utilities here • This list is biased towards what I know - there so much that I am missing • Debian-NYC has workshops which go into more detail about the development side of things • http://wiki.debian.org/DebianNYC
  • 45. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S More resources User resources: • http://www.debian.org/doc/manuals/reference/ - Debian user guide, highly recommended • http://www.debian.org/doc/manuals/refcard/ refcard.en.pdf - Debian reference card Development resources: • http://www.debian.org/doc/developers-reference/ - Developer’s reference, useful for creating packages • http://www.debian.org/doc/debian-policy/ - Debian policy document • http://www.debian.org/doc/maint-guide/ - New Maintainer’s guide, first steps to making a package
  • 46. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S The end Thank you
  • 47. Debian Policy Packaging Nomenclature dpkg based tools APT utilities Advanced things Brief introduction to source packages S Presentation permissions You are free to use this presentation under the 3-clause BSD license. Copyright (c) Richard Darst, 2010 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.