VERCMP(8)

✨ VERCMP(8) ✨

okay bestie, welcome to vercmp β€” the version comparison utility, straight out of the Pacman Manual. she's tiny, she's fierce, and she is literally the reason your package manager knows which version is newer. no cap. πŸ’…


🌸 NAME 🌸

vercmp β€” version comparison utility


πŸ¦‹ SYNOPSIS πŸ¦‹

vercmp [-h] [--help] <version1> <version2>

πŸ’– DESCRIPTION πŸ’–

so what does she actually do? vercmp takes two version numbers and tells you how they relate to each other. the output is literally just a number, and here's the decoder ring:

  • < 0 : if ver1 < ver2
  • = 0 : if ver1 == ver2
  • > 0 : if ver1 > ver2

that's it. that's the whole vibe check. ✨

πŸŽ€ how the comparison actually works πŸŽ€

Version comparison operates like this, and yes you're gonna wanna screenshot this:

Alphanumeric:

1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1

Numeric:

1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0

πŸ‘‘ epochs, aka the ones who overrule everything πŸ‘‘

plot twist: version strings can also carry an epoch value, and that epoch will straight up overrule any version comparison β€” unless the epoch values are equal. she said "my rules, my house." 🏠

it's written in an epoch:version-rel format. for example, 2:1.0-1 is always greater than 1:3.6-1. always always. πŸ”₯

πŸ“ the pkgrel tea πŸ“

ngl this part trips people up, so listen: the pkgrel is only compared if it is available on both versions you hand to this tool. fr fr.

  • comparing 1.5-1 and 1.5 will yield 0
  • comparing 1.5-1 and 1.5-2 will yield < 0 as expected

why tho? this is mainly for supporting versioned dependencies that do not include the pkgrel. so it's a feature, not a bug, periodt. πŸ’…


✨ OPTIONS ✨

  • -h, --help β€” Display summary of the available return codes. Must be the first option specified. (yes, literally first, don't try to be cute and put it anywhere else πŸ™ˆ)

🌈 EXAMPLES 🌈

here's her in action, looking iconic:

$ vercmp 1 2
-1

$ vercmp 2 1
1

$ vercmp 2.0-1 1.7-6
1

$ vercmp 2.0 2.0-13
0

$ vercmp 4.34 1:001
-1

that last one? epoch doing epoch things. ate. πŸ‘‘


πŸ’œ SEE ALSO πŸ’œ

pacman(8), makepkg(8), libalpm(3)

See the pacman website at https://archlinux.org/pacman/ for current information on pacman and its related tools.


😭 BUGS 😭

Bugs? You must be kidding; there are no bugs in this software. πŸ’€ (iconic confidence, honestly.)

But if we happen to be wrong β€” and, like, hypothetically we could be β€” please report them to the issue tracker at https://gitlab.archlinux.org/pacman/pacman/-/issues with specific information such as your command-line, the nature of the bug, and even the package database if it helps. give us the receipts bestie 🧾🫢


🧚 AUTHORS 🧚

Current maintainers:

  • Allan McRae <allan@archlinux.org>
  • Andrew Gregory <andrew.gregory.8@gmail.com>
  • Morgan Adamiec <morganamilo@archlinux.org>

Past major contributors:

  • Judd Vinet <jvinet@zeroflux.org>
  • Aurelien Foret <aurelien@archlinux.org>
  • Aaron Griffin <aaron@archlinux.org>
  • Dan McGee <dan@archlinux.org>
  • Xavier Chantry <shiningxc@gmail.com>
  • Nagy Gabor <ngaba@bibl.u-szeged.hu>
  • Dave Reisner <dreisner@archlinux.org>
  • Eli Schwartz <eschwartz@archlinux.org>

For additional contributors, use git shortlog -s on the pacman.git repository.


and that's the whole page, babe. go forth and compare versions responsibly. πŸ¦‹

Pacman 7.1.0 β€” dated 2026-10-15 β€” signing off, mwah πŸ’–

πŸ“¦ where this page comes from