Product SiteDocumentation Site

Chapter 9. PackageKit CLI

9.1. pkcon
9.1.1. Documentation
9.1.2. Searches
9.1.3. Install, update and remove packages
9.1.4. Packages Info
9.1.5. General Update
9.1.6. Available Updates
9.1.7. Groups
9.1.8. Repositories
9.1.9. Downloading Packages
9.1.10. Use of Filters
9.1.11. Transactions
9.2. gpk-install-local-file
9.3. gpk-install-catalog
9.4. pkmon
This manual has deepened in the YUM system as a native tool for software management in the command line, but it is interesting to note that PackageKit CLI suite offers the promise of universal commands at command line across multiple Linux distributions. PackageKit CLI has relatively little documentation and it is not the main focus of PackageKit and project development, so we will give an overview of their current capabilities.

9.1. pkcon

pkcon is the PackageKit's command line interface or software management CLI.
In general, actions that require privileges will require you to provide the root password at the graphical environment, something not so orthodox as we are using a CLI tool. You can also use sudo on the command line to run pkcon to gain the privileges or simply run the command directly as root with the help of su or after a root shell login via a virtual console or other remote console mechanism.

Basically examples

Because there is no further documentation, the most of the text below are examples of use for common operations. Also note that some subcommands simply do not work.

9.1.1. Documentation

Online Help
Usage:
  pkcon [OPTION...] PackageKit Console Program

PackageKit Console Interface

Subcommands:
  get-actions
  get-groups
  get-filters
  get-transactions
  get-time
  search [name|details|group|file] [data]
  install [packages]
  install-local [files]
  download [directory] [packages]
  install-sig [type] [key_id] [package_id]
  remove [package]
  update <package>
  refresh [--force]
  resolve [package]
  get-updates
  get-depends [package]
  get-requires [package]
  get-details [package]
  get-distro-upgrades
  get-files [package]
  get-update-detail [package]
  get-packages
  repo-list
  repo-enable [repo_id]
  repo-disable [repo_id]
  repo-set-data [repo_id] [parameter] [value];
  what-provides [search]
  get-categories


Help Options:
  -h, --help               Show help options
  --help-all               Show all help options
  --help-debug             Show debugging options

Application Options:
  --version                Show the program version and exit
  --filter                 Set the filter, e.g. installed
  --root                   Set the install root, e.g. '/' or '/mnt/ltsp'
  -n, --nowait             Exit without waiting for actions to complete
  -y, --noninteractive     Install the packages without asking for confirmation
  --background             Run the command using idle network bandwidth and also using less power
  -p, --plain              Print to screen a machine readable output, rather than using animated widgets
  -v, --verbose            Show debugging information for all files

9.1.2. Searches

Search by Name
Search by pattern matching in the package name.
search [name|details|group|file] [data]
$ pkcon search name octa

Transaction:\tSearching by name
Status: \tStarting
Status: \tQuerying
Package:\tGMT-octave-4.5.3-3.fc14.x86_64
Package:\toctave-6:3.2.4-3.fc14.i686
Package:\toctave-6:3.2.4-3.fc14.x86_64
...
Package:\tpfstools-octave-1.8.1-1.fc14.2.x86_64
Package:\tplplot-octave-5.9.6-5.fc14.x86_64
Package:\tqtoctave-0.9.1-2.fc14.x86_64
...
Available    pfstools-octave-1.8.1-1.fc14.2.x86_64
Available    plplot-octave-5.9.6-5.fc14.x86_64
Available    qtoctave-0.9.1-2.fc14.x86_64

9.1.3. Install, update and remove packages

Install packages from the repositories
$ su -c "pkcon install qtoctave"

Password: 
Transaction:\tInstalling
Status: \tWaiting for authentication
Percentage:\t0
Status: \tRunning
Status: \tResolving dependencies
Percentage:\t10
Status: \tDownloading packages
Percentage:\t40
Status: \tChecking signatures
Status: \tTesting changes
Package:\tsuitesparse-3.4.0-2.fc12.x86_64
Status: \tInstalling packages
Percentage:\t70
Package:\toctave-6:3.2.4-3.fc14.x86_64
Percentage:\t80
Package:\tqtoctave-0.9.1-2.fc14.x86_64
Percentage:\t100
Status: \tScanning applications
Status: \tGetting information
Results:
Installed    octave-6:3.2.4-3.fc14.x86_64
Installed    qtoctave-0.9.1-2.fc14.x86_64
Installed    suitesparse-3.4.0-2.fc12.x86_64

Install packages from rpm files
$ su -c "pkcon install-local /home/makerpm/rpmbuild/RPMS/x86_64/fox-1.6.38-1.fc13.x86_64.rpm"
Password: 
Transaction:\tInstalling files
Status: \tWaiting for authentication
Status: \tStarting
Percentage:\t0
Status: \tRunning
Transaction:\tInstalling files
Status: \tWaiting for authentication
Percentage:\t0
Status: \tRunning
Status: \tResolving dependencies
Status: \tTesting changes
Package:\tfox-1.6.38-1.fc13.x86_64
Status: \tInstalling packages
Percentage:\t100
Results:
Installed    fox-1.6.38-1.fc13.x86_64

Update packages
$ su -c "pkcon update binutils"

Password: 
Transaction:\tUpdating packages
Status: \tWaiting for authentication
Status: \tChecking applications in use
Percentage:\t0
Status: \tRunning
Status: \tResolving dependencies
Percentage:\t10
Status: \tDownloading packages
Status: \tTesting changes
Package:\tbinutils-2.20.51.0.7-6.fc14.x86_64
Status: \tInstalling updates
Percentage:\t60
Percentage:\t70
Package:\tbinutils
Status: \tCleaning up packages
Status: \tChecking applications in use
Status: \tGetting information
Results:
Updated      binutils-2.20.51.0.7-6.fc14.x86_64

Remove packages
$ su -c "pkcon remove suitesparse"

Password: 
Transaction:\tRemoving
Status: \tWaiting for authentication
Status: \tStarting
Percentage:\t0
Status: \tRunning
Status: \tResolving dependencies
Status: \tTesting changes
Package:\tqtoctave
Percentage:\t70
Status: \tRemoving packages
Package:\toctave
Package:\tsuitesparse
Percentage:\t100
Results:
Removed      octave
Removed      qtoctave
Removed      suitesparse

9.1.4. Packages Info

Listing all packages
$ pkcon get-packages
Transaction:    Getting packages
Status:         Starting
Status:         Querying
Package:        libconfig-1.4.5-1.fc14.x86_64
Package:        clucene-core-0.9.21b-2.fc14.x86_64
Package:        ncurses-5.7-8.20100703.fc14.x86_64
Package:        fontconfig-2.8.0-2.fc14.x86_64
Package:        telepathy-filesystem-0.0.2-1.fc12.noarch
Package:        python-libs-2.7-8.fc14.1.x86_64
...
Available    Frodo-gui-4.1b-6.fc11.x86_64
Installed    GConf2-2.31.91-1.fc14.x86_64
Installed    GConf2-2.31.91-1.fc14.i686
Available    GConf2-devel-2.31.91-1.fc14.x86_64
Available    GConf2-devel-2.31.91-1.fc14.i686
Installed    GConf2-gtk-2.31.91-1.fc14.x86_64
Available    GLC_Player-2.0.0-2.fc12.x86_64
...
Installed    zziplib-0.13.49-8.fc12.x86_64
Available    zziplib-0.13.49-8.fc12.i686
Available    zziplib-devel-0.13.49-8.fc12.i686
Available    zziplib-devel-0.13.49-8.fc12.x86_64
Available    zziplib-utils-0.13.49-8.fc12.x86_64
Available    zzuf-0.13-1.fc13.x86_64

Package Details
$ pkcon get-details fwsnort

Transaction:\tGetting details
Status: \tStarting
Status: \tGetting information
Results:
Package description
  package:     fwsnort-1.0.6-8.fc14.noarch
  license:     GPLv2+
  group:       other
  description: fwsnort translates Snort rules into equivalent iptables rules and generates
a Bourne shell script that implements the resulting iptables commands.

In addition, fwsnort (optionally) uses the IPTables::Parse module to parse the
iptables ruleset on the machine to determine which Snort rules are applicable
to the specific iptables policy.

fwsnort is able to translate approximately 60% of all rules from the
Snort-2.3.3 IDS into equivalent iptables rules.
  size:        5246625 bytes
  url:         http://www.cipherdyne.org/fwsnort/

Update details of a package
It is not necessary to have the package previously installed to see this information.
$ pkcon get-update-detail fwsnort

Transaction:\tGetting update details
Status: \tStarting
Status: \tGetting information
Results:
Details about the update:
 Package: fwsnort-1.0.6-8.fc14.noarch
 Updates: fwsnort;1.0.6-8.fc14;noarch;installed
 Obsoletes: 
 Vendor: https://admin.fedoraproject.org/updates/F14/FEDORA-2010-16198;Fedora 14 Update FEDORA-2010-16198
 Bugzilla: 
 CVE:
 Update text: Minor spec adjust for improved perl packaging guidelines compliance.
 Changes: 
 State: stable
 Issued: 2010-10-13T06:08:15
 Updated: 

9.1.5. General Update

$ su -c "pkcon update"
Password: 
Transaction:	Updating system
Status: 	Starting
Status: 	Downloading repository information
Status: 	Downloading list of packages
Percentage:	0
Status: 	Running
Status: 	Resolving dependencies
Percentage:	10
Status: 	Downloading packages
Percentage:	40
...
Package:	ncurses-libs-5.7-9.20100703.fc14.i686
Package:	selinux-policy-targeted-3.9.7-18.fc14.noarch
Package:	git-gui-1.7.3.4-1.fc14.noarch
Package:	cronie
Status: 	Cleaning up packages
Package:	cronie-anacron
Package:	ncurses
Package:	ncurses-libs
Package:	ImageMagick-perl
Package:	ImageMagick-c++
Package:	ncurses-libs
Percentage:	80
...\
Updated      cronie-anacron-1.4.5-4.fc14.x86_64
Cleaned up   cronie-anacron
Updated      git-1.7.3.4-1.fc14.x86_64
Cleaned up   git
Updated      git-gui-1.7.3.4-1.fc14.noarch
Cleaned up   git-gui
Updated      gitk-1.7.3.4-1.fc14.noarch
Cleaned up   gitk
...\
Updated      perl-Git-1.7.3.4-1.fc14.noarch
Cleaned up   perl-Git
Updated      selinux-policy-3.9.7-18.fc14.noarch
Cleaned up   selinux-policy
Updated      selinux-policy-targeted-3.9.7-18.fc14.noarch
Cleaned up   selinux-policy-targeted
Session restart required: cronie-1.4.5-4.fc14.x86_64
Please logout and login to complete the update.

9.1.6. Available Updates

$ pkcon get-updates

Transaction:\tGetting updates
Package:\tbinutils-2.20.51.0.7-6.fc14.x86_64
Package:\ttelepathy-logger-0.1.7-1.fc14.x86_64
Package:\tmdadm-3.1.3-0.git20100804.2.fc14.x86_64
Package:\tlibicu-4.4.1-6.fc14.x86_64
Results:
Bug fix      binutils-2.20.51.0.7-6.fc14.x86_64
Bug fix      libicu-4.4.1-6.fc14.x86_64
Bug fix      mdadm-3.1.3-0.git20100804.2.fc14.x86_64
Bug fix      telepathy-logger-0.1.7-1.fc14.x86_64

9.1.7. Groups

Listing Groups
$ pkcon get-groups

admin-tools
desktop-gnome
desktop-kde
desktop-other
desktop-xfce
education
fonts
games
graphics
internet
legacy
localization
multimedia
office
other
programming
publishing
servers
system
virtualization
collections
newest

9.1.8. Repositories

Listing Repositories
$ pkcon repo-list

Transaction:\tGetting repositories
Status: \tStarting
Results:
 Disabled   rpmfusion-nonfree-updates-testing RPM Fusion for Fedora 14 - Nonfree - Test Updates
 Disabled   _local                    Automatic local repo. (manged by the "local" yum plugin).
 Disabled   updates-debuginfo         Fedora 14 - x86_64 - Updates - Debug
 Disabled   rawhide-source            Fedora - Rawhide - Source
 Disabled   updates-testing           Fedora 14 - x86_64 - Test Updates
 Disabled   updates-testing-source    Fedora 14 - Test Updates Source
 Enabled    fedora                    Fedora 14 - x86_64
 Disabled   fedora-latam              Fedora Latam 14 - x86_64
 Enabled    fedora-chromium           Chromium web browser and deps
 Disabled   updates-source            Fedora 14 - Updates Source
 Disabled   rawhide-debuginfo         Fedora - Rawhide - Debug
 Disabled   fedora-debuginfo          Fedora 14 - x86_64 - Debug
 Disabled   updates-testing-debuginfo Fedora 14 - x86_64 - Test Updates Debug
 Disabled   rawhide                   Fedora - Rawhide - Developmental packages for the next Fedora release
 Disabled   fedora-source             Fedora 14 - Source
 Disabled   rpmfusion-free-updates-debuginfo RPM Fusion for Fedora 14 - Free - Updates Debug
 Disabled   rubyera                   Rubyera repo
 Enabled    updates                   Fedora 14 - x86_64 - Updates

Enable a Repository
$ pkcon repo-enable rubyera

Transaction:\tEnabling repository
Status: \tWaiting for authentication
Status: \tStarting
Status: \tGetting information
Results:
Disable a Repository
$ pkcon repo-disable rubyera

Transaction:\tEnabling repository
Status: \tWaiting for authentication
Status: \tStarting
Results:

9.1.9. Downloading Packages

You must specify a directory where to download, and the package name.
$ pkcon download . fwsnort
Transaction:\tDownloading packages
Status: \tStarting
Package:\tfwsnort-1.0.6-8.fc14.noarch
Percentage:\t0
Status: \tDownloading packages
Percentage:\t100
Status: \tCopying files
Percentage:\t70
Percentage:\t100
Results:
Downloaded   fwsnort-1.0.6-8.fc14.noarch
$ ls
fwsnort-1.0.6-8.fc14.noarch.rpm

9.1.10. Use of Filters

Listing available Filters
$ pkcon get-filters
\t
installed
devel
gui
free
basename
newest
arch
Using an example filter
Available updates for GUI graphical applications.
$ pkcon --filter=gui get-updates
Transaction:\tGetting updates
Bug fix\tgoffice-0.8.10-1.fc13.x86_64            \tGoffice support libraries

9.1.11. Transactions

Listing Transactions
$ pkcon get-transactions

Transaction:\tGetting transactions
Results:
Transaction: /5107_dcbacbcc_data
 System time: 2010-12-08T07:47:51.024966Z
 Succeeded: True
 Role: update-system
 Duration: 53 (seconds)
 Command line: pkcon
 User ID: 0
 Username: root
 Real name: root
 Affected packages:
 - updating binutils-2.20.51.0.7-6.fc14.x86_64
 - updating mdadm-3.1.3-0.git20100804.2.fc14.x86_64
 - updating libicu-4.4.1-6.fc14.x86_64
 - updating telepathy-logger-0.1.7-1.fc14.x86_64
 - cleanup binutils
 - cleanup mdadm
 - cleanup libicu
 - cleanup telepathy-logger
Transaction: /5092_bbcceeab_data
 System time: 2010-12-08T07:10:02.594755Z
 Succeeded: True
 Role: remove-packages
 Command line: pkcon
 User ID: 0
 Username: root
 Real name: root
 Affected packages:
 - removing qtoctave
 - removing octave
 - removing suitesparse
Transaction: /5089_daabbacb_data
 System time: 2010-12-08T07:05:05.794247Z
 Succeeded: True
 Role: update-packages
 Duration: 192 (seconds)
 Command line: pkcon
 User ID: 0
 Username: root
 Real name: root
 Affected packages:
 - updating binutils-2.20.51.0.7-6.fc14.x86_64
 - cleanup binutils
...