LinuxCommandLibrary

checkupdates

Check for available package updates

TLDR

Synchronize the database and list pending updates

$ checkupdates
copy

List pending updates without syncing the database
$ checkupdates [[-n|--nosync]]
copy

Display the list of pending updates if it differs from the last time this option was used
$ checkupdates [[-c|--change]]
copy

List pending updates and download the packages to the pacman cache (/var/cache/pacman/pkg)
$ checkupdates [[-d|--download]]
copy

List pending updates using a specific pacman database
$ CHECKUPDATES_DB=[path/to/directory] checkupdates
copy

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

SYNOPSIS

checkupdates

DESCRIPTION

checkupdates is a lightweight utility from the pacman-contrib package, designed for Arch Linux and its derivatives. It compares the locally installed packages against the synchronized remote package repositories to list any available updates. Unlike pacman -Syu, which synchronizes databases, downloads, and installs updates, checkupdates performs only the query and outputs a list of upgradable packages without altering the system.

To ensure accurate results, run pacman -Sy first to update the sync databases, as checkupdates does not sync them itself. The command outputs one line per upgradable package in the format: package-name current-version -> new-version. This concise output is perfect for parsing in scripts, update notifiers like checkupdates-prepare-threshold.service, or pre-upgrade verification workflows.

It runs efficiently as a non-root user, querying the existing databases without needing elevated privileges or downloading package files. Exit status indicates: 0 if updates found, 1 if none available, or higher for errors. Widely used in automated maintenance, CI/CD pipelines, and desktop notification tools, it enhances pacman's flexibility for proactive system management.

CAVEATS

Databases must be synced first with pacman -Sy.
No automatic sync performed.
Non-root execution recommended; works with current local sync dbs.

OUTPUT FORMAT

One line per package:
pkg-name old-version -> new-version
Example:
linux 6.1.50-1 -> 6.1.52-1

EXIT CODES

0: Updates available
1: No updates
2+: Error (e.g., invalid db)

HISTORY

Introduced in the pacman-contrib package around 2007 as part of Arch Linux's ecosystem to provide a simple, script-friendly way to detect updates without full upgrades. Evolved with pacman to support modern repo structures and remains a staple for automation.

SEE ALSO

pacman(8), pacman.conf(5), paccache(8)

Copied to clipboard