CentOS /RHEL : YUM Installing Packages

How Do I install package using yum tool under CentOS /RHEL /Fedora system ? How To install a sinagle package and all of its non-installed dependencies? How to install multiple package at once on linux operating system?

You can use “yum install” command to install the latest version of a package or group of packages while ensureing that all dependencies are satisfied. if you just install single package, just specifying one package name , or specifing two or more package names as argument to “yum install” command, it will install multiple packages at once .

CentOS  Install A Sinagle Package

To Install a sinagle package , Yum tool will also install all dependency package that is not installed in current system, run the following command:

yum install <package name>

For example, install httpd package in your system, type:

#yum install httpd

Outputs:

[root@devops Desktop]# yum install httpd

Loaded plugins: fastestmirror, langpacks

base                                                                           | 3.6 kB  00:00:00

extras                                                                         | 3.4 kB  00:00:00

updates                                                                        | 3.4 kB  00:00:00

(1/2): extras/7/x86_64/primary_db                                              |  39 kB  00:00:02

(2/2): updates/7/x86_64/primary_db                                             | 5.4 MB  00:00:43

Loading mirror speeds from cached hostfile

* base: mirrors.nwsuaf.edu.cn

* extras: mirrors.nwsuaf.edu.cn

* updates: mirrors.nwsuaf.edu.cn

Resolving Dependencies

--> Running transaction check

---> Package httpd.x86_64 0:2.4.6-18.el7.centos will be installed

--> Processing Dependency: httpd-tools = 2.4.6-18.el7.centos for package: httpd-2.4.6-18.el7.centos.x86_64

--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-18.el7.centos.x86_64

--> Running transaction check

---> Package httpd-tools.x86_64 0:2.4.6-18.el7.centos will be installed

---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================

Package                 Arch               Version                         Repository           Size

======================================================================================================

Installing:

httpd                   x86_64             2.4.6-18.el7.centos             updates             2.7 M

Installing for dependencies:

httpd-tools             x86_64             2.4.6-18.el7.centos             updates              77 k

mailcap                 noarch             2.1.41-2.el7                    base                 31 k

Transaction Summary

======================================================================================================

Install  1 Package (+2 Dependent packages)

Total download size: 2.8 M

Installed size: 9.6 M

Is this ok [y/d/N]: y

Total                                                                  22 kB/s | 2.8 MB  00:02:11

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Installing : httpd-tools-2.4.6-18.el7.centos.x86_64                                             1/3

Installing : mailcap-2.1.41-2.el7.noarch                                                        2/3

Installing : httpd-2.4.6-18.el7.centos.x86_64                                                   3/3

Verifying  : mailcap-2.1.41-2.el7.noarch                                                        1/3

Verifying  : httpd-tools-2.4.6-18.el7.centos.x86_64                                             2/3

Verifying  : httpd-2.4.6-18.el7.centos.x86_64                                                   3/3

Installed:

httpd.x86_64 0:2.4.6-18.el7.centos

Dependency Installed:

httpd-tools.x86_64 0:2.4.6-18.el7.centos                mailcap.noarch 0:2.1.41-2.el7

Complete!

CentOS Install Multiple packages

To install two or more packages at once by passing multiple package names as arguments, issue the following command:

yum install<package name1> <package name2> ..

To install wget and httpd packages, enter:

yum install wget httpd

You can also use glob expressions to install multiple packages that matching the pattern, type:

yum install <pattern>

To install all packages that matched gcc* by running the following command:

yum install gcc*

Outputs:

[root@devops Desktop]# yum install gcc*

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: mirrors.nwsuaf.edu.cn

* extras: mirrors.nwsuaf.edu.cn

* updates: mirrors.nwsuaf.edu.cn

Resolving Dependencies

--> Running transaction check

---> Package gcc.x86_64 0:4.8.2-16.el7 will be updated

..

You might also like:

Sidebar



back to top