Observations Regarding Debian/Ubuntu Apt Repository Access

A useful but old link

Good old wikipedia...

Semi-Useful Links

Typically one takes all the non-comment lines originally put in their /etc/apt/sources.list, and replaces the hostname with mirror.csclub.uwaterloo.ca and adds the resulting lines at the front. Typiclally it appears that the release is specified explictly, e.g. lucid, precise, trusty, xenial (or non-LTS versions). However, a release of "stable" is allowed, which would appear to dynamically change the release considered over time.

The following claims to be for installing packages not in Ubuntu repositories. It ends up showing how to set up a "local mini-repository".

deb file:/usr/local/mydebs ./

In particular, see...

man dpkg-scanpackages

We have also observed the "trusty-backports" elements being put in more recent 14.04 installations, and think this is related to those installations running version 4 kernels while older more established hosts do not so automatically upgrade.

Information on standard filesystem hierarchy, related to creation of valid deb pkgs

really that belongs in one of the software-specific wikis.

Apparently https://en.wikipedia.org/wiki/Wikipedia:WikiProject_Computer_science is sufficiently respected that this page has not got all sorts of "too technical", "too much like a manual entry" flags.

There should be man pages...

arpepper@cscfpcXX:/tmp/tztmp$ man -k deb-
deb-control (5)      - Debian packages' master control file format
deb-extra-override (5) - Debian archive extra override file
deb-old (5)          - old style Debian binary package format
deb-override (5)     - Debian archive override file
deb-shlibs (5)       - Debian shared library information file
deb-split (5)        - Debian multi-part binary package format
deb-src-control (5)  - Debian source packages' master control file format
deb-substvars (5)    - Debian source substitution variables
deb-symbols (5)      - Debian's extended shared library information file
deb-triggers (5)     - package triggers
deb-version (5)      - Debian package version number format
arpepper@cscfpcXX:/tmp/tztmp$ 

arpepper@cscfpcXX:~$ man -k dpkg-
dh_makeshlibs (1)    - automatically create shlibs file and call dpkg-gensymbols
dpkg-architecture (1) - set and determine the architecture for package building
dpkg-buildflags (1)  - returns build flags to use during package build
dpkg-buildpackage (1) - build binary or source packages from sources
dpkg-checkbuilddeps (1) - check build dependencies and conflicts
dpkg-deb (1)         - Debian package archive (.deb) manipulation tool
dpkg-distaddfile (1) - add entries to debian/files
dpkg-divert (8)      - override a package's version of a file
dpkg-genchanges (1)  - generate Debian .changes files
dpkg-gencontrol (1)  - generate Debian control files
dpkg-gensymbols (1)  - generate symbols files (shared library dependency info...
dpkg-maintscript-helper (1) - works around known dpkg limitations in maintain...
dpkg-mergechangelogs (1) - 3-way merge of debian/changelog files
dpkg-name (1)        - rename Debian packages to full package names
dpkg-parsechangelog (1) - parse Debian changelog files
dpkg-preconfigure (8) - let packages ask questions prior to their installation
dpkg-query (1)       - a tool to query the dpkg database
dpkg-reconfigure (8) - reconfigure an already installed package
dpkg-scanpackages (1) - create Packages index files
dpkg-scansources (1) - create Sources index files
dpkg-shlibdeps (1)   - generate shared library substvar dependencies
dpkg-source (1)      - Debian source package (.dsc) manipulation tool
dpkg-split (1)       - Debian package archive split/join tool
dpkg-statoverride (8) - override ownership and mode of files
dpkg-trigger (1)     - a package trigger utility
dpkg-vendor (1)      - queries information about distribution vendors
Dpkg::Changelog::Parse (3) - generic changelog parser for dpkg-parsechangelog
Dpkg::Control::Changelog (3) - represent info fields output by dpkg-parsechan...
Dpkg::Version (3)    - handling and comparing dpkg-style version numbers
arpepper@cscfpcXX:~$ 

Building debian packages, references git-buildpackage

There should be man pages (revisited) ...

After a while you realize the dh_ set of commands are fundamental to Debian packaging. But there are rather too many to usefully list here.

   arpepper@cscfpcXX:~$ man -k dh_ | wc
        91     799    5991
   arpepper@cscfpcXX:~$ man -k dh_ | grep '^dh_' | wc
        74     666    4980
   arpepper@cscfpcXX:~$ 

One command, dh_make command, creates a mockup of a debian (small letters) directory, which can be used as the basis for a source package. This is related to the DEBIAN directory needed for the dpkg-deb -b command, but different in many ways. For instance, the control file contains a superset of the information needed for the control file in the DEBIAN directory. (Notably, comments, and Build-Depends:).

I find dh_make confusingly named, because it does not do anything like the make compilation process. A confusing aspect of Debian source packaging is that whatever makefiles you would logically have seem to disappear into the source package file debian/rules.

Note that an architecture-independent package consisting of only interpreted scripts is still considered a binary package. (= "indep binary" =).

Similarly sloppiness seems to apply in the various commands to "build packages".

    dpkg-buildpackage (1) - build binary or source packages from sources
    debuild (1)          - build a Debian package
    dpkg-deb -b

dpkg and related command examples

Perhaps also see:

Crude look at .deb file contents

   ar tv _file.deb_
Contents are always one file, plus two compressed tars. The tar files can be examined using tar.

Inspect contents of a .deb without unpacking

Control information:
   dpkg --info _file.deb_
   dpkg -I _file.deb_
Date/files:
   dpkg --contents _file.deb_
   dpkg -c _file.deb_

A deb view of the current machine architecture

   dpkg-architecture
This requires the dpkg-dev package.

Fundamental command to build a .deb package file

   dpkg-deb -b . debfile
Directory must contain DEBIAN directory with appropriate contents (which become the control.tar.gz ), and a number of trees of files to install. This contstructs the ar format .deb file from those current directory contents; it does not run any compilers or makefiles, etc.

Reveal where apt-get will fetch a package from

   apt-get --print-uris download _packagename_

Reveal where apt-get will fetch package source from

   apt-get --print-uris source _packagename_
Typically three files, plus a note about the maintenance repository.

Consequently, obtain .deb file or source

   apt-get download _packagename_
   apt-get source _packagename_
apt-get source actually clutters the current directory with files and a directory having old time stamps. So you want to cd to an appropriate directory first.

Also

   apt-get --download-only source _packagename_
will suppress the expansion of the tar files. Note that the "expansion of tar files" is not simple.

And to download source and unpack and compile it

   apt-get --compile source _packagename_

file and directory locations related to dpkg and apt

/var/lib/dpkg/status

* This is the registry of installed packages. It is immensely useful. It is actually the raw material for dpkg-query --list

/var/lib/dpkg/

* There is more stuff here, but the previous is the most useful.

/etc/apt/sources.list

* File containing information on what repositories apt-get will use.

/etc/apt/sources.list.d

* Directory analogous to previous, with many files to be processed.

/etc/apt/

* There is other related information under /etc/apt

-- AdrianPepper - 2016-05-27

Edit | Attach | Watch | Print version | History: r12 | r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r8 - 2016-05-30 - AdrianPepper
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback