RPM and YUM of linux operation and maintenance example installation program method

Preface

Install software and other programs in the windows system because it is a graphical interface and only need to be installed in accordance with the graphical index. However, in Linux, there is no installation index due to the character interface. Therefore, a special installation method is required. There are two ways to install in Linux system, rpm and yum.

1. The relationship between applications and system commands

I said before that everything in a Linux system is a file, so so are applications. The commands executed by the driver are also files. Divided into system commands and application commands.

1 System and procedures

System command application
In the /bin or /sbin directory, or the shell internal command Usually in the /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin directory
Complete the basic configuration of the system Complete the function of the corresponding program
Character interface only Some need to run on the graphical interface according to needs
Consists of command word option parameters No specific format, defined by the developer

2 Directory of common programs

Insert picture description here

3 Common package types

RPM installation package The extension is .RPM, which is suitable for systems such as RHEL and Centos
DEB software package The extension is .deb, suitable for UBuntu.Dedian and other systems
Source code package Generally, it is a compressed package in a compressed format such as .tar.gz and tar.bz2. Contains the original code of the program, need to be compiled and installed
Package with installer The software extensions have different names, mostly in Tarball format. An executable program or script file for installation will be provided in the software package, such as install.sh set.up. During installation, you only need to run the installation file to install according to the prompts of the wizard.

2. Installation method

1. RPM package management tool

Proposed by Red Hat and adopted by many Linux distributions.
A unified file database can be established.
Detailed records of software package installation, uninstallation, and upgrade changes.
Automatic analysis of software package dependencies

2 Software dependencies

When installing certain software, it is necessary to establish and check the dependency relationship. The dependency relationship can be regarded as the pre-component of the software installation and operation, which provides the operating environment of the software.
When installing multiple software with multiple dependencies
1 The dependent software package needs to be installed first
2 You can specify multiple .rpm package files for installation at the same time When
uninstalling multiple software with
dependencies 1 Software packages that rely on other programs need to be installed first Uninstall
2 You can specify multiple software names to uninstall at the same time.
Ignore dependencies.
You can install it through the -nodeps command. Note that sometimes an error is displayed.

3. Installation method (instruction)

The command is the rpm option rpm installation package name
rpm -ivh rpm package is the most commonly used.
Common options
-i install a new RPM package
-u upgrade an installation package if the installation package is not installed, install it.
-F Upgrade a software package, if it has not been installed, abort the installation.
-h In the process of installing or upgrading the software package, the installation progress will be displayed with #.
-v displays detailed information during the installation process.
-Force Force the installation of a certain package, such as installing an older version.
In the installation, I need to specify the source first. Here I first choose the local cd installation, first mount the cd to the directory.
Insert picture description here

4 Check whether the installation package is installed

Query the software information of the installed RPM installation package
rpm -q[sub-option] Software name The
commonly used option is
Insert picture description here
Insert picture description here
sometimes it will show that it is not installed. You can use the grep command to see if it is really not installed.
rpm -qa | grep -i Installation package name

5 Uninstall the installation package

The installed package can be uninstalled, the instruction is rpm -e installation package name - nodeps can be uninstalled directly regardless of dependencies

6 Maintain RPM database

Used to rebuild the RPM database. This method can be used to repair the database when the database is damaged. The instructions are as follows
Insert picture description hereor rpm --initdb
import verification public key.
Before the public key file for digital signature verification is not imported, part of the RPM software package in the installation CD will report an error. The verification public key file located in the root directory of the CD or other storage medium needs to be imported into the rpm database.
The first mounted directory such as monut /dev/sr0 /mnt
rpm --import /mnt/RPM-public key

Three yum installation

The rpm installation method is only suitable for simple installation. If there are multiple installations and multiple dependencies, the operation will be very troublesome, so there is a yum source installation method.

1 specific method

First, configure the local yum source. When the source is available, the local source can also be a network source. Let me take the local source as an example.

Insert picture description here
First mount the local source to the directory, enter the /etc directory, create a bak directory under yum, move the mirror into the
Insert picture description here
Insert picture description here
directory, configure yum settings in the /etc directory,
Insert picture description here
Insert picture description here
delete the yum cache and update

yum list View yum security transfer list
Insert picture description here
partial list
Insert picture description here

Take the package in the figure as an example to install it. This shows that the installation has been completed. The
command is yum -y install file name

2 Common operating commands

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_49172531/article/details/113444013
Recommended