This module provides tools to manage Debian/Ubuntu packages and repositories.
See also
Install one or more packages.
If update is True, the package definitions will be updated first, using update_index().
Extra options may be passed to apt-get if necessary.
Example:
import fabtools
# Update index, then install a single package
fabtools.deb.install('build-essential', update=True)
# Install multiple packages
fabtools.deb.install([
'python-dev',
'libxml2-dev',
])
# Install a specific version
fabtools.deb.install('emacs', version='23.3+1-1ubuntu9')
Remove one or more packages.
If purge is True, the package configuration files will be removed from the system.
Extra options may be passed to apt-get if necessary.
Enable unattended package installation by preseeding debconf parameters.
Example:
import fabtools
# Unattended install of Postfix mail server
fabtools.deb.preseed_package('postfix', {
'postfix/main_mailer_type': ('select', 'Internet Site'),
'postfix/mailname': ('string', 'example.com'),
'postfix/destinations': ('string', 'example.com, localhost.localdomain, localhost'),
})
fabtools.deb.install('postfix')
Get the state of dkpg selections.
Returns a dict with state => [packages].
Trust packages signed with this public key.
Example:
import fabtools
# Varnish signing key from URL and verify fingerprint)
fabtools.deb.add_apt_key(keyid='C4DEFFEB', url='http://repo.varnish-cache.org/debian/GPG-key.txt')
# Nginx signing key from default key server (subkeys.pgp.net)
fabtools.deb.add_apt_key(keyid='7BD9BF62')
# From custom key server
fabtools.deb.add_apt_key(keyid='7BD9BF62', keyserver='keyserver.ubuntu.com')
# From a file
fabtools.deb.add_apt_key(keyid='7BD9BF62', filename='nginx.asc'