Getting a list of package version in linux

If you use any kind of configuration management tool, like say puppet, you’ll know that you can specify a version of a package to install in your code.

You may also want, for your own reasons to install a specific version of a package, maybe there is a bug in the current release and the old one worked ok ? Maybe the new software isn’t as efficient.

For whatever reason, there are some simple ways to check the version of a package.

On RHEL/CentOS/Fedora-like systems use the command

yum search <pacakage> --show-duplicates

For example, in this one I search for available version for the container-selinux package.

yum search container-selinux --show-duplicates

result:

2:container-selinux-2.107-1.el7_6.noarch : SELinux policies for container runtimes
2:container-selinux-2.107-3.el7.noarch : SELinux policies for container runtimes
2:container-selinux-2.119.1-1.c57a6f9.el7.noarch : SELinux policies for container runtimes
2:container-selinux-2.119.2-1.911c772.el7_8.noarch : SELinux policies for container runtimes
2:container-selinux-2.119.2-1.911c772.el7_8.noarch : SELinux policies for container runtimes

On Debian/Ubuntu based distros

apt-cache policy <package >

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *