LinuxCommandLibrary

pkcon

Manage software packages

TLDR

Install a package

$ pkcon install [package]
copy

Remove a package
$ pkcon remove [package]
copy

Refresh the package cache
$ pkcon refresh
copy

Update packages
$ pkcon update
copy

Search for a specific package
$ pkcon search [package]
copy

List all available packages
$ pkcon get-packages
copy

SYNOPSIS

pkcon [OPTIONS] COMMAND [ARGUMENTS]

PARAMETERS

install <package>
    Installs one or more specified packages.

remove <package>
    Removes one or more specified packages.

update
    Checks for and applies available system updates. Typically requires root privileges.

refresh
    Refreshes the local package metadata cache from configured repositories (similar to apt update or dnf makecache).

search <keyword>
    Searches for packages matching the given keyword in their names or descriptions.

get-details <package>
    Displays detailed information about a specific package, including description, version, and dependencies.

get-updates
    Lists all available updates without installing them.

repo-list
    Lists all currently configured software repositories and their status.

--noninteractive
    Runs the command without prompting for user input, useful for scripting.

--force
    Forces the operation to proceed, overriding some checks or warnings.

--only-download
    For update operations, downloads packages but does not install them.

DESCRIPTION

pkcon is the command-line utility for interacting with PackageKit, a cross-distribution package management system. PackageKit provides a consistent, high-level API for managing software, abstracting away the complexities and differences of native package managers such as APT (Debian/Ubuntu), DNF/YUM (Red Hat/Fedora), and Zypper (openSUSE).

Through pkcon, users and scripts can perform common software management tasks like searching for, installing, updating, and removing packages, as well as managing software repositories, using a single, unified interface. This makes it invaluable in diverse Linux environments or for automated scripting where the underlying package manager may vary. It communicates with the packagekitd daemon and leverages PolicyKit for secure privilege escalation.

CAVEATS

pkcon relies on the PackageKit daemon being active; if the daemon is not running, commands will fail. While convenient, it might not expose all fine-grained options or provide the same performance as native package managers for specific operations. Error messages can sometimes be generic, requiring investigation with the underlying system's package manager.

POLICYKIT INTEGRATION

pkcon extensively uses PolicyKit (now often referred to as polkit) for privilege management. This allows non-root users to perform administrative package operations after authentication, typically through a graphical password prompt or via sudo if configured, ensuring secure access to system-level package management functions.

UNDERLYING DAEMON

All pkcon operations are processed by the packagekitd system daemon. pkcon acts as a client, sending requests to this daemon, which then translates them into actions using the specific package manager (e.g., apt-get, dnf) configured for the distribution.

HISTORY

PackageKit, and consequently pkcon, was created by Richard Hughes, with its initial release in 2007. The primary goal was to provide a standardized, cross-distribution software management framework, abstracting the complexities of diverse package systems. It gained adoption through integration into major desktop environments like GNOME and KDE, with pkcon serving as its direct command-line interface for system administrators and power users.

SEE ALSO

apt(8), dnf(8), yum(8), zypper(8), pacman(8), policykit(8), systemctl(1)

Copied to clipboard