In this installment of our Linux package management basics tutorial, we will be covering how to install packages to your system. This will teach you how to install the packages & applications you located from our previous steps. We will also cover how to install packages you downloaded from other places.
* 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.
Installing new packages:
Installing a new package via yum is very straight forward. You simply need to know the package name, which can be obtained from the yum list commands above.
To install a package to your system, from the system's yum repository, use this command:
yum install PACKAGENAME;
Where 'PACKAGENAME' in the above command is simply the name of the package you noticed in the yum list (enter it in the case it's shown). This command should also try to resolve any required dependencies that are missing & automatically add them to the list of packages to install.
If you want to install multiple packages at one time, you can space separate them in the same command. For example, if you have 3 packages to install, your command would look like this:
yum install PACKAGENAME1 PACKAGENAME2 PACKAGENAME3;
If you have already downloaded an .rpm package from some other source, which is not part of your available system's yum repository, you would use this yum command to install it.
yum localinstall FILENAME;
Where 'FILENAME' is the given file name or path to the given .rpm file you are trying to install. Again yum should also resolve any required dependencies that are missing & automatically add them to the list of packages to install.
If you have multiple .rpm packages to install, you can space separate them in the same command. For example, if you have 3 .rpm files, your command would look like this:
yum localinstall FILENAME1 FILENAME2 FILENAME3;
Just so it's noted, you can also install .rpm files using 'rpm', but it will only validate if you have all of the required dependencies & install it of those requirements are met.
rpm -ivh FILENAME;
Where 'FILENAME' is the given file name or path to the given .rpm file you are trying to install. And this good to note that you can list more then one filename, if you really wanted to manually install multiple .rpm files at one time.
In the next installment, we will cover how to obtain a list of just those packages you have installed to your system.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.