Tags:
tag this topic
create new tag
view all tags
---+!! Package Management using apteryx %TOC% <img src="%ATTACHURLPATH%/Apteryx_owenii_0.jpg" alt="Apteryx_owenii_0.jpg" width="310" height="307" align="right"/> LCFG package management on Debian/Ubuntu machines is done using a combination of the _apt_ component and the _apteryx_ utility. Although _apteryx_ is designed to be called via the component (e.g. =om apt run=) it can be used in an entirely standalone way which is described here. The design of _apteryx_ is somewhat unusual amongst Debian package managers in that you may specify any version you require for a package, it fully supports downgrades as well as upgrades. It also fully supports multi-arch and, for compatibility, can translate several Redhat architecture names into their Debian equivalent (e.g. =x86_64= becomes =amd64= and =noarch= becomes =all=). It also supports several <a href=#flags">flags</a> which can be associated with packages that control when a package should be installed/upgraded/removed (e.g. only at boot-time). _apteryx_ can operate in a fully-managed mode where all packages (and their versions) must be specified in the LCFG profile for the machine, this is the equivalent of the way we manage Redhat machines using the =updaterpms= tool. In this mode, any packages which are manually installed and are not listed in the profile would be automatically removed. In this mode you also need to specify all dependencies in the profile. For ease of porting to new platforms, _apteryx_ can alternatively be configured to work in a semi-managed mode where it will manage the packages listed in the LCFG profile but ignore anything which is installed manually (which would normally be automatically removed). In this mode it can be configured to automatically upgrade all packages (similar to the unattended-upgrades utility) and remove dependency packages which are no longer required (similar to running the =apt autoremove= command). _apteryx_ is written in Python 3 and uses just the [[https://apt-team.pages.debian.net/python-apt/][python-apt]] and YAML modules. There are, intentionally, no dependencies on the LCFG libraries which makes bootstrapping new platforms easier. ---++ Configuration Options Like other apt/dpkg utilities the _apteryx_ configuration uses the apt-config(8) system with the files usually being stored in =/etc/apt/apt.conf.d/= (see apt.conf(5) manual page for more details). _apteryx_ supports the following options: $ =Apteryx::Keep-Auto= : Keep automatically-installed dependency packages when no longer required. Default value is _true_. $ =Apteryx::Keep-Unknown= : Keep packages which are not listed in the YAML file. Default value is _true_. $ =Apteryx::Auto-Upgrade= : Automatically upgrade packages when new versions are available. Default value is _true_. $ =Apteryx::Auto-Deps= : Automatically install any dependency packages. Default value is _true_. $ =Apteryx::Full-Upgrade= : Do a _full upgrade_ instead of just a standard upgrade. May be overridden on the command-line. Default value is _false_. $ =Apteryx::Run-Mode= : One of (_auto_, _verify_ or _dryrun_). See <a href="#runmodes">below</a> for a full description of the run modes. May be overridden on the command-line. Default value is _auto_. $ =Apteryx::PkgsFile= : The YAML packages file to use. May be overridden on the command-line. See <a href="#pkgfile">below</a> for a description of how the packages file should be formatted. $ =Apteryx::SysLog= : The syslog facility to which all output should be logged. By default logging only goes to the console. $ =Apteryx::LogFile= : The name of a file to which all output should be logged. By default logging only goes to the console. The configuration for a *fully-managed* machine might look something like: <verbatim> Apteryx::Keep-Auto "false"; Apteryx::Keep-Unknown "false"; Apteryx::Auto-Upgrade "false"; Apteryx::Auto-Deps "false"; Apteryx::Full-Upgrade "false"; Apteryx::Run-Mode "auto"; Apteryx::PkgsFile "/var/lib/lcfg/conf/profile/packages/foo.example.org.yaml"; Apteryx::LogFile "/var/log/lcfg/apt"; </verbatim> The configuration for a *semi-managed* machine might look something like: <verbatim> Apteryx::Keep-Auto "false"; Apteryx::Keep-Unknown "true"; Apteryx::Auto-Upgrade "true"; Apteryx::Auto-Deps "true"; Apteryx::Full-Upgrade "false"; Apteryx::Run-Mode "auto"; Apteryx::PkgsFile "/var/lib/lcfg/conf/profile/packages/foo.example.org.yaml"; Apteryx::LogFile "/var/log/lcfg/apt"; </verbatim> ---+++ <a name="runmodes">Run Modes</a> $ _verify_ : Verify that the user wishes to proceed before making any required changes. If there is no stdin attached (i.e. _apteryx_ is not being called in an interactive session by a user) then there will be no verification and it will be handled in the same way as _auto_ mode. $ _dryrun_ : Show what changes would be made but do not actually apply them. $ _auto_ : Automatically apply any required changes. ---++ Command Line Options $ =--full_upgrade= : Do a _full upgrade_ instead of just a standard upgrade. $ =--verify= / =--no-verify=: Enable or disable the _verify_ run mode. $ =--dryrun= : Enable the _dryrun_ run mode (this will override any use of the =--verify= option). $ =--quiet= : Reduce the amount of logging. $ =--debug= : Enable extra debugging. Also, the packages YAML file may be specified on the command-line. For example: <verbatim> apteryx --full-upgrade --verify /tmp/my_packages.yaml </verbatim> ---++ <a name="pkgfile">Package File</a> ---++ <a name="flags">Package Flags</a> $ _boot only_ (=b=) : Only install, upgrade or remove this package when doing a _full upgrade_. This is typically used for updates to the kernel or glibc packages where there is a risk of problems occurring if the packages are changed during a normal upgrade. $ _not boot_ (=B=) : Only install, upgrade or remove this package when doing a normal upgrade. This is mostly useful for avoiding altering a package during boot-time where there is the risk of some of the scripts not working correctly. $ _reboot_ (r) : Indicates that a reboot is required after installing or upgrading this package. Similarly to the _boot only_ flag, this is mostly for changes to important packages such as the kernel or glibc. $ _ignore_ (i) : Ignore any version of this package which is already installed. In the fully-managed mode this is useful if you have packages installed that cannot be updated automatically and you need _apteryx_ to ignore them. -- %USERSIG{squinney - 2019-11-07}%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
M
ore topic actions
Topic revision: r1 - 2019-11-07
-
squinney
Home
Site map
LCFG web
Main web
Sandbox web
TWiki web
LCFG Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
E
dit
A
ttach
Copyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback