LinuxCommandLibrary

updpkgsums

Update package checksums in PKGBUILD file

TLDR

Update the checksums in a PKGBUILD

$ updpkgsums
copy

Display help
$ updpkgsums [[-h|--help]]
copy

Display version
$ updpkgsums [[-v|--version]]
copy

SYNOPSIS

updpkgsums [options]

PARAMETERS

-h, --help
    Displays a help message and exits.

-v, --version
    Shows version information and exits.

DESCRIPTION

updpkgsums is an Arch Linux utility designed to simplify the maintenance of PKGBUILD files. It automates the process of updating source checksums (MD5, SHA1, SHA256, SHA512, B2) when upstream source files for a package change. This command is particularly useful when makepkg fails during the integrity check step, indicating that the locally stored checksums in the PKGBUILD no longer match the downloaded source files. By executing updpkgsums in the directory containing the PKGBUILD, it fetches the new checksums directly from the sources and updates the PKGBUILD file in place. This eliminates the need for manual inspection and recalculation of checksums, streamlining the package building process for developers and users of the Arch User Repository (AUR). It relies on makepkg to perform the actual source fetching and checksum calculation, then parses the output to modify the PKGBUILD.

CAVEATS

updpkgsums modifies the PKGBUILD file directly and in-place. It is highly recommended to back up your PKGBUILD before running the command, especially for critical or complex build files. The utility requires the PKGBUILD file to be present in the current working directory or accessible. It also relies on the source URLs in the PKGBUILD being valid and accessible for fetching new checksums. If a source URL has changed or is no longer available, updpkgsums may fail to update the checksums correctly. Ensure you have an active internet connection if sources are remote.

INTERACTION WITH MAKEPKG AND SRCINFO

Internally, updpkgsums executes makepkg --printsrcinfo to generate a .SRCINFO file, which contains the calculated checksums for the sources. It then parses this .SRCINFO output to extract the correct checksums and updates the corresponding md5sums, sha1sums, sha256sums, sha512sums, or b2sums arrays within the PKGBUILD. This method ensures consistency with how makepkg itself verifies integrity.

COMMON USE CASE

This command is invaluable for anyone managing packages from the Arch User Repository (AUR). When an AUR package fails to build with a 'validating source files with checksum... FAILED' error, updpkgsums is often the first command to try. Running it in the package's directory typically resolves the checksum mismatch, allowing makepkg to proceed with the build.

HISTORY

updpkgsums is part of the pacman-contrib package, a collection of useful scripts and tools complementing the pacman package manager in Arch Linux. Its development is closely tied to the Arch Linux ecosystem's philosophy of source-based packaging via PKGBUILDs. It was introduced to address the common challenge faced by package maintainers and users of the Arch User Repository (AUR) when upstream software updates lead to checksum mismatches, simplifying the maintenance workload.

SEE ALSO

makepkg(8), PKGBUILD(5), pacman(8), mksrcinfo(1)

Copied to clipboard