In this installment of our Linux package management basics tutorial, we will be covering the listing of available packages. This will teach you how see what packages (i.e. applications) are available & can select from.
* NOTE: All of the example commands below assume you are performing them as 'root' or some other authorized administrative user. You can also perform these commands through 'sudo', if you do not wish to login directly as 'root'. To do this via 'sudo', simple prepend the word 'sudo', followed by a space, before the given command.
List available packages:
You can obtain a list of all available packages, regardless whether they are installed or not, by entering this command:
The output should tell you the package's name, version/architecture & the repository it's from [if not installed] &/or if it's currently installed. The yum output format may vary slightly based on the version of yum & Linux distro you are using. However the aforementioned package data is present in all versions of yum. Anything else you may see there is likely specific to your version of yum & Linux distro.
You can limit the results to specific packages, by applying something of the package name to match against. For example to see all packages starting with 'perl', you could use this command:
yum list perl\*;
Alternatively, you can pipe the output to 'grep', to match any line of the results which contain a given word/phrase. For example to see all packages which have the word 'perl' anywhere in it, you could use this command:
yum list grep 'perl';
You can also pipe the output to 'more' or 'less', to review larger results one page at a time. For example:
yum list | more;
yum list | less;
Beyond that, you can mix the above commands together to further restrict the results. For example:
yum list gnome* | grep 'x86_64' more;
The above command would list all packages that begin with 'gnome', but limit the results to only those lines which have 'x86_64' in it. And if the resulting list is too large for the screen, it would show the resulting data one page at a time.
In the next installment, we will cover how to search for & get descriptions of packages.If you like this site or any of its content, please help promote it. Use the social media buttons below to help spread the word. Don't forget to post in the comments section.