rpm and yum software management

A, rpm

Brief introduction

This is a database management tool, you can read the database to determine whether the software has been installed, if you have installed can read out the location of all the files, etc., and can be achieved delete these files.

rpm: RPM is Redhat Package Manager (recursive acronym)

rpm operation can be done

install software

Uninstall software

Query software information

Upgrade, downgrade

test

Packager

 

Rpm package only be able to manage in line with the rpm format, you can not manage their source code format program

First, the installation package rpm

Format: rpm -ivh package names

Options

-i: Install the software

-v: shows the installation process

-h: installation progress represented by # (# 2%)

-vv: display more detailed information during the installation

-vvv: show more detail of the installation process more information

Second, uninstall the rpm package

Format: rpm -e Software name

Options:

-e: Uninstall the software

 

Example: Uninstall packages ken

# Rpm -e ken

Third, the inquiry rpm package

Format: rpm -q Software name

Options:

-q: a viewing software already installed

-a: all View all software installed

-l: Displays generated file list (all files) list after the software installation is complete

-i: View information about packages info

-d: display a list of documents docfiles the nature of the software generated

-c: Check the software generated list of profiles configfiles

--scripts: View software-related scripts

Fourth, the query file which is generated by the software

-f: to / bin / ls file, for example

[root@localhost ~]# rpm -qf /bin/ls
coreutils-8.22-18.el7.x86_64

Fifth, upgrade software

Options

-U: upgrade or install software

-F: just upgrade

 

Use the format;

rpm -Fvh package names

rpm -Uvh package names

Two, yum

Brief introduction

yum rpm package is a management tool, it can be achieved automatically resolve dependencies rpm package (order dependent automatic installation package installed rpm)

 

Why would rpm package dependencies?

People make rpm, and in the production of the rpm package, this information will be dependent on the rpm of the software stored in the internal rpm package

yum works

To resolve dependencies yum rpm package by the source (local or network sources). In fact, the source is essentially a collection of the yum rpm package

  How to resolve dependencies it

Mounting process with yum (for example, to install the software A, A and B depend C, B-dependent CD)

1) yum will first scan save metadata information file, check whether A is already installed, if installed, it has been suggested installation

2) If A is not installed, then the A scan dependency information, the dependency will find A, B and C

3) yum again scans the metadata file, detects whether the installation of BC, if already installed, it will start to begin the installation A

4) If BC is not already installed, it will detect dependencies BC, you will find B depends CD

5) yum again scans the metadata file, detects whether the installation CD, if already installed, it will start to begin the installation B, and then install the C ,, and then install A

Source configuration yum

yum configuration file

The main configuration file: /etc/yum.conf

Child profile:. /Etc/yum.repos.d / * repo (yum.repos.d meaning in this directory, as long as the end of a .repo file will be identified as a profile)

Yum configuration content source

[LocalRpm] <<< designated yum repository id, can easily write, but without spaces

name = xxx <<< specify the name of yum repository, you can easily write

enabled = 0 | 1 <<< specify whether to use the yum repository, 0 is not used; 1 indicates use

gpgcheck = 0 | 1 <<< specify whether to make the rpm package integrity verification and source of legitimacy, 0 means no verification; 1 represents a verification must be done

gpgkey = <<< specified public key file (if gpgcheck = 1, then this can be omitted)

baseurl = <<< yum repository specified URL ( 1. Local yum Source file: // example baseurl = file: /// mnt

2. Network Source http: // example baseurl = https: //mirrors.aliyun.com/epel/7/x86_64/)

Configuration of the local source

Rpm packages using the CD-ROM as a yum repository

The first step: mount the CD

# mount /dev/cdrom /media

 

Step Two: Back up the configuration file that comes with yum

# cd /etc/yum.repos.d

# Mkdir look

# Mv * .repo behind

 

Step 3: Create yum configuration file, use the CD as a yum repository

# vim 1.repo

[myrepo]

name=my repo

enabled=1

gpgcheck=0

baseurl = file: /// media

 

Step Four: Execute the command yum detection results

All data # yum clean all <<< empty the cache yum

# Yum repolist <<< yum repository check how many rpm package available

2. Configuration of network sources

Domestic mainstream network yum repository address

mirrors.aliyun.com

mirrors.163.com

mirrors.sohu.com

 Enter the URL of the page until the child repodata page appears, copy the URL of the page into the back baseurl

The source rpm yum

centos provided

epel provided:

 

Examples: Use epel and centos aliyun source provided yum

cd /etc/yum.repos.d

mkdir look

etc. * .repo behind

vim new.repo

[Centos]

name=centos repo

enabled=1

gpgcheck=0

baseurl = https: //mirrors.aliyun.com/epel/7/x86_64/

 

[Warm]

name = warm repo

enabled=1

enabled=1

baseurl=http://xxxx

Guess you like

Origin www.cnblogs.com/tomsongqi/p/10772262.html