You can get the advice from IT HELP DESK

SYSTEM[LINUX] rpm and yum commands for installation package

Robert
14 Jan 2019
<head>Disk Management, Server Monitoring, System management, server monitoring, server management, system management, system monitoring, </head>

[LINUX] rpm and yum commands for installation package

Hello ~!

Today we'll look at rpm and yum commands!


It is common for rpm and yum to install packages from CentOS.

Before yum appeared, rpm was used mainly, but since yum contains the concept and function of rpm, yum is mainly used in the latest version of CentOS.



1. rpm

rpm is an abbreviation of Redhat Package Manager and it was very complicated to install Linux early days program. To make up for this, we have created an installation file on Redhat that can be run immediately after installing the program, similar to windows "setup.exe". The extension name of the installed installation file is called "* .rpm" or package.



  1.1 Package Installation

#rpm -Uvh [Package file.rpm]

U: If there is no existing package installed, it will be upgraded if it is a general installation or if the existing package is installed.

v: Verifying the installation process

h: Print the installation process with a '#' symbol.



1.2 Removing a Package

#rpm -e [package name]

When deleting a package, the package name (.rpm) should be used instead of the package file name.

If you can not delete the dependency error when you delete it, you can force delete with --nodeps option. However, be careful when using forced deletion.


Example: #rpm -e sendmail-devel-8.11.6-27.73

     > remove sendmail-devel-8.11.6-27.73 rpm package



  1.3 Package Search

#rpm -qa [Package file .rpm]

This is a command to check if the package is installed on the system. The "q" option specifies the name and version of the package. You can find the installed rpm query.

q: Displays the package name and version.

a: Shows a list of all packages installed on the system. If you do not know the package name  | It is useful to use grep [package name].


#rpm -ql [package file.rpm]

This command checks which files are included in a specific package.

q: Displays the package name and version.

l: Show all files included in the package. The correct filename is required for use with p.

p: Shows information about the files in the package. You must enter the correct name to search.


#rpm -qi [package file .rpm]

This command displays the details of the installed package. Package information can be checked.

q: Displays the package name and version.

i: Shows the information of the installed package. The exact filename is required to use with p.


#rpm -qf [absolute path to * .rpm]

This command checks which package contains the installed files. Outputs the associated rpm file information.

q: Displays the package name and version.

f: Outputs the package (rpm) that contains the specified file.


#rpm -qlp [package file.rpm]

This command checks which file is included in the package file. Indicates information about package files that are not yet installed.

q: Displays the package name and version.

l: Show all files included in the package. The correct filename is required for use with p.

p: Shows information about the files in the package. You must enter the correct name to search.


#rpm -qip [ package file.rpm ]

This command displays the details of the package file to be installed. Indicates information about package files that are not yet installed.

q: Displays the package name and version.

i: Shows the information of the installed package. The exact filename is required to use with p.

p: Shows information about the files in the package. You must enter the correct name to search.


However, the rpm command has a huge drawback. It's just a dependency problem. For example, the centOS default web browser, Firefox, runs only on x-windows. If you run firefox without x-windows installed, it will not install because of dependency. It is yum that came out to solve this problem.



2. yum  
 
 


It completely solves the package dependency problem of the rpm command. It automatically downloads and installs all necessary files from the repository via the Internet. However, it must be able to communicate with an external repository server. 

yum stands for Yellow Updater Modified, which automatically installs other package files with dependencies. However, since Internet access is essential, there may be occasions when it is not possible to use it in a closed network environment.



  2.1 Package Identification

#yum list

A command to check the package list. You can see installed and installable packages.


#yum list installed

A command to check the list of installed packages.


#yum search [package_name]

You can search for the required library or software. Only one word is searchable. 



  2.2 Package Updates

#yum list updates

Update packages installed on the server. 


#yum update

Update all packages. 


  2.3 Installing the Package

#yum install [package_name]

Install the package. At this time, only root or "sudo" users can be installed. You can install it unchecked without confirmation using the "y" option.


#yum info [package_name]

Package information can be checked.


  2.4 Removing Packages

#yum remove [package_name]

Delete the package. At this time, only root or sudo users can be installed. You can install it unchecked without confirmation using the y option.