Home Command line utilities Find If A Package Is Available For Your Linux Distribution
Find If A Package Is Available For Your Linux Distribution

Find If A Package Is Available For Your Linux Distribution

By sk
12 Views

Some times, you might wonder how to find if a package is available for your Linux distribution. Or, you simply wanted to know what version of package is available for your distribution. If so, well, it's your lucky day. I know a tool that can get you such information. Meet "Whohas" - a command line tool that allows querying several package lists at once. Currently, it supports Arch, Debian, Fedora, Gentoo, Mandriva, openSUSE, Slackware, Source Mage, Ubuntu, FreeBSD, NetBSD, OpenBSD, Fink, MacPorts and Cygwin. Using this tool, the package maintainers can easily find ebuilds, pkgbuilds and similar package definitions from other distributions. Whohas is free, open source and written in Perl programming language.

Find If A Package Is Available For Your Linux Distribution

Installing Whohas

Whohas is available in the default repositories of Debian, Ubuntu, Linux Mint. If you're using any one of the DEB-based system, you can install it using command:

$ sudo apt-get install whohas

For Arch-based systems, it is available in AUR. You can use any AUR helper programs to install it.

Using Yay:

$ yay -S whohas

In other Linux distributions, download Whohas utility source from here and manually compile and install it.

Usage

The main objective of Whohas tool is to let you know,

  • Which distribution provides packages on which the user depends.
  • What version of a given package is in use in each distribution and/or in each release of a distribution.

Let us find which distributions contains a specific package, for example vim. To do so, run:

$ whohas vim

This command will show all distributions that contains the vim package with the available version of the given package, its size, repository and the download URL.

Find If A Package Is Available For Your Linux Distribution

Find If A Package Is Available For Your Linux Distribution

You can even sort the results in alphabetical order by distribution using by piping the output to "sort" command like below.

$ whohas vim | sort

Please note that the above commands will display all packages that starts with name vim, for example vim-spell, vimcommander,  vimpager etc. You can narrow down the search to the exact package by using grep command and space before or after or on both sides of your package like below.

$ whohas vim | sort | grep " vim"
$ whohas vim | sort | grep "vim "
$ whohas vim | sort | grep " vim "

The space before the package name will display all packages that ends with search term. The space after the package name will display all packages whose names begin with your search term. The space on both sides of the search will display the exact match.

Alternatively, you could simply use "--strict" option like below.

$ whohas --strict vim

Sometimes, you want to know if a package is available for a specific distribution only. For example, to find if vim package is available in Arch Linux, run:

$ whohas vim | grep "^Arch"

The distribution names are abbreviated as "archlinux", "cygwin", "debian", "fedora", "fink", "freebsd", "gentoo", "mandriva", "macports", "netbsd", "openbsd", "opensuse", "slackware", "sourcemage", and "ubuntu".

You can also get the same results by using -d option.

$ whohas -d archlinux vim

This command will search vim packages for Arch Linux distribution only.

To search for multiple distributions, for example arch linux, ubuntu, use the following command instead.

$ whohas -d archlinux,ubuntu vim

You can even find which distributions have "whohas" package.

$ whohas whohas

For more details, refer the man pages.

$ man whohas

Also read:


All package managers can easily find the available package versions in the repositories. However, Whohas can help you to get the comparison of available versions of packages across different distributions and which even has it available now.

Resource:

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

2 comments

MarkDubya June 7, 2018 - 8:48 pm

It appears to be broken. I tried emailing the developer, but the email address bounces. I built it from the AUR on Manjaro Linux.

$ whohas whohas | sort
Tried fetching “http://www.macports.org/ports.php?by=name&substr=whohas” five times. Giving up.
Tried fetching “http://ftp.openbsd.org/pub/OpenBSD/5.7/packages/i386/” five times. Giving up.
Tried fetching “http://www.freebsd.org/cgi/ports.cgi?query=whohas&stype=all” five times. Giving up.
Tried fetching “http://software.opensuse.org/search?q=whohas&baseproject=openSUSE&lang=en&exclude_debug=true” five times. Giving up.
Tried fetching “http://packages.debian.org/search?keywords=whohas&searchon=names&suite=all&section=all” five times. Giving up.
Tried fetching “http://dl.fedoraproject.org/pub/fedora/linux/releases/21/Everything/i386/os/Packages/w/” five times. Giving up.
Tried fetching “http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Everything/i386/os/Packages/w/” five times. Giving up.
Tried fetching “http://packages.ubuntu.com/search?keywords=whohas&searchon=names&suite=all&section=all” five times. Giving up.
Tried fetching “http://www.archlinux.org/packages/?q=whohas” five times. Giving up.
Tried fetching “http://aur.archlinux.org/packages.php?SeB=n&PP=1000&K=whohas” five times. Giving up.
Tried fetching “http://packages.slackware.com//?release=slackware-current&mode=package&result=100&extra=on&pasture=on&patches=on&slackware=on&source=on&testing=on&search=whohas” five times. Giving up.
NetBSD whohas 0.29nb6 190K 2017-11-23 misc http://pkgsrc.se/misc/whohas
Source Mage whohas 0.29.1 test
Source Mage whohas

Reply
hendrix June 8, 2018 - 1:42 pm

Yea, it seems broken. My computer freezed when tried “whohas cherrytree”. Couldn’t even restart X or change to tty but had to poweroff.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More