apt.package
— Classes for package handling¶
The Package class¶
The Version class¶
Dependency Information¶
Origin Information¶
-
class
Origin
¶ The
Origin
class provides access to the origin of the package. It allows you to check the component, archive, the hostname, and even if this package can be trusted.-
archive
¶ The archive (eg. unstable)
-
component
¶ The component (eg. main)
-
label
¶ The Label, as set in the Release file
-
origin
¶ The Origin, as set in the Release file
-
site
¶ The hostname of the site.
-
trusted
¶ Boolean value whether this is trustworthy. An origin can be trusted, if it provides a GPG-signed Release file and the GPG-key used is in the keyring used by apt (see apt-key).
-
The Record class¶
Examples¶
import apt
cache = apt.Cache()
pkg = cache['python-apt'] # Access the Package object for python-apt
print('python-apt is trusted:', pkg.candidate.origins[0].trusted)
# Mark python-apt for install
pkg.mark_install()
print('python-apt is marked for install:', pkg.marked_install)
print('python-apt is (summary):', pkg.candidate.summary)
# Now, really install it
cache.commit()