LinuxCommandLibrary

upgradepkg

TLDR

Upgrade a package

$ sudo upgradepkg [path/to/package.tgz]
copy

Upgrade a package, installing it if not already present
$ sudo upgradepkg --install-new [path/to/package.tgz]
copy

Reinstall a package (even if the same version is already installed)
$ sudo upgradepkg --reinstall [path/to/package.tgz]
copy

Preview what would happen without actually upgrading
$ upgradepkg --dry-run [path/to/package.tgz]
copy

Upgrade a package and show detailed progress
$ sudo upgradepkg --verbose [path/to/package.tgz]
copy

SYNOPSIS

upgradepkg [options] package.txz [package.txz …]

PARAMETERS

-i, --install-new
    Install new packages without prompting.

-u
    Upgrade only; ignore new packages.

-f, --force
    Force upgrade even if new package is older.

-r, --reinstall
    Reinstall package even if versions match.

-v, --verbose
    Enable verbose output.

--dry-run
    Simulate upgrade without changes.

--help
    Show usage information.

--version
    Display version info.

DESCRIPTION

upgradepkg is a core utility in Slackware Linux's pkgtools suite for upgrading existing packages or installing new ones from .txz archives.

It examines /var/log/packages/ to check for installed packages with matching names. If an older version exists, it performs an upgrade: removes old files (excluding modified configs, which get .new suffixes), verifies the new package, and installs it. New packages are installed by default unless -u is used.

Salient features include config file preservation, integrity checks via MD5 sums, and verbose logging. It prompts before installing new packages (overridable with -i). Unlike RPM or APT, it lacks automatic dependency resolution—users must handle prerequisites manually.

Ideal for Slackware's minimalist philosophy, upgradepkg prioritizes simplicity and control, making it reliable for full system upgrades from official media or mirrors. Always run as root.

CAVEATS

No automatic dependency resolution; install prerequisites first.
Run as root only.
Slackware-specific; incompatible with other distros.
Modified configs need manual review of .new files.

CONFIG HANDLING

Unchanged configs overwritten; changed ones saved as filename.new for merging.

LOGS & VERIFICATION

Updates /var/log/packages/ and /var/log/scripts/; verifies package integrity with MD5.

HISTORY

Created by Patrick Volkerding for Slackware 1.0 in 1993 as part of pkgtools. Evolved minimally for stability; supports .txz since Slackware 13.0 (2009). Remains unchanged in core functionality across versions.

SEE ALSO

Copied to clipboard