rmp and yum software management


There are several ways to install the software:
Mode 1: compile and install
the program source code to compile on demand, after the installation
Disadvantages:
the installation process is complicated and very slow
advantages:
the installation process control, according to the real needs of the installation (the installation location, installation modules can be selected)

mode 2: rpm installation (with rpm to install rpm suffix installation package)
advantages:
the installation and uninstallation process is very easy
drawbacks:
the installation process is not controllable (mounting position, mounting those functional modules)
dependent rpm package very complex relationship

mode 3: yum install
yum install, in fact, automatic dependency analysis rpm package, then follow the desired order and then click install

mode 4: green install

rpm Introduction

this is a database management tool, you can read the database to determine software It 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 Penalty for Manager

rpm can complete the operation
to install the software
uninstall software
query software information
upgrades, downgrades
test
Packager

rpm is only able to manage the program in line with the rpm format packages, programs can not manage source code format

program format
1) Source format program: all in a compressed manner presented (suffix are .tar.gz | bz2)
program 2) rpm format: this is a program (.rpm suffix are later compiled)

First, install the rpm package
format: rpm -ivh package names
option
-i: Install the software
-v: display the installation process
-h: with # indicate the installation progress (# 2%)
-vv: display more detailed installation information
-vvv : show more and more detailed information about the installation procedure

Second, uninstall the rpm package
format: rpm -e name of the software
options:
-e: uninstall the software

example: Uninstall packages hao
# rpm -e hao

Third, the inquiry has been installed rpm package
format: rpm -q name of the software
options:
-q: View a software has been installed
-a: View all software installed All
the -l: displays the generated file list (all files after the software installation is complete ) list
-i: View related information package info
-d: the software displays a list of documents generated by the nature of docfiles
-c: Check the software generated list of profiles configfiles
--scripts: View software-related script

added:
Pre-installation scripts (preinstall)
after installation script (postinstall)
pre-uninstall script (preuninstall)
uninstall script (postunistall)

example: View hao is installed
# rpm hao -q

example: View the current system for all installed software
# rpm -qa

Example: Which software to view files generated
rpm -qf / path / to / file

five or upgrade software
options
-U: upgrade or install software
-F: just upgrade

using the format;
RPM package names -Fvh
rpm -Uvh software package name

software management yum

is also a rpm package management tool that can be achieved automatically resolve dependencies rpm package (installed automatically rely order to install the rpm package)

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

works of yum
1. You need to create a yum repository (rpm package warehouses, depots)
1) warehouse is actually a directory
2) warehouse store is the rpm package
3) warehouse also save a file, the file records all metadata rpm packages of the warehouse information
4) the metadata information includes the
software name
software version
whether the software has been installed
dependencies software

2. from the warehouse to look for software with yum install process (for example, to install the software a, a and B depend on C, B-dependent CD)
1) yum will first scan save metadata information file, check whether a is already installed, if installed, it prompts have been installed
2) If a is not already installed, then the dependency information a scan will find a depends on B and C
3) yum scans again metadata files, detect BC is installed, if you have 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 will scan again 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

yum repository
locally: a directory of the local yum repository is made, only the current system
network : through a network directory on the server as a yum repository, all hosts in the network can be a

way to use yum repository is a change in the profile of yum

yum configuration file
main: /etc/yum.conf
child: / etc / . yum.repos.d / * repo (*: name be named, ending .repo)

/etc/yum.conf file
cachedir = / var / cache / yum / $ basearch / $ releasever
specify where to save the file caching, default: / var / cache / yum / the x86_64 /. 7 /
keepcache = 0
Indicates whether to keep cache file

using yum software installation process will be downloaded from a plurality of resources and cache repository yum
1) will yum repository metadata files cached profile The specified path
2) software and its dependent software will be installed together with the configuration file cache to the specified directory

constitute yum configuration file
[localRpm] <<< designated yum repository id, can easily write, but the middle No 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 the rpm package to do to verify the legitimacy and integrity of the source, 0 means no verification ; 1 represents must be done to verify
gpgkey = <<< specified public key file (if gpgcheck = 1, then this can not be omitted)
baseurl = <<< designated yum repository url

url yum repository of representation

Note: yum designated warehouse when, in fact not point to the directory rpm package, but performs repodata directory where

local yum repository
file: //
example: For example my yum repository / myrpm, this time representation yum repository is File: /// myrpm
yum network warehouse
http: //

create local yum repository
using the CD-ROM rpm package yum repository as
a first step: mount the CD
# mount / dev / cdrom / media

Step two: backup comes with yum configuration file
# cd / etc / yum .repos.d
# mkdir BAK
# mv * .RE BAK

step Three: create a profile yum, yum uses discs as the warehouse
# vim 1.repo
[myrepo]
name = My repo
Enabled = 1
gpgcheck = 0
baseurl = file: /// media

The fourth step: execution command detection result yum
# yum clean all <<< clear all cached data yum
# yum repolist <<< yum check how many available warehouse rpm packages

yum use
1. Install the software
yum -y install software software 1 2 3 .... software

uninstall the software
yum -y remove software 1 software software 3 .... 2

3. management pack group
grouplist: all package groups to see the system
groupinfo package group name: Specifies a package group information (packet group effect, comprising the software)
groupinstall package group name: install the specified packet group
groupremove package group name: uninstall specified packet group

4. the cache data management yum
Clean [packages | Metadata | All]
All: Clear all data
packages: just remove rpm package
metadata: just clear the cache metadata

5. Review all installed and not yet installed rpm package
yum list all or yum list list all packages

6. yum list available: You can install only display but not yet installed rpm package

7. yum list installed: show only installed rpm package
@: that is already installed rpm

8. Check yum repository of information
yum repolist

use network yum source of

domestic mainstream network yum repository address
mirrors.aliyun.com
mirrors.163.com
mirrors.sohu.com

RPM source of yum
centos provided
epel provided:

Example: Using epel and centos aliyun provided the source yum
CD /etc/yum.repos.d
mkdir BAK
Music Videos * .repo BAK
Vim new.repo
[CentOS]
name = CentOS the repo
Enabled. 1 =
gpgcheck = 0
BaseURL = HTTP: //mirrors.163.com

[EPEL]
EPEL repo = name
Enabled = 1
Enabled = 1
baseurl = HTTP: // xxxx

make a network yum source
ideas: prepare a host on the network, which is installed in a web server software (such as apache), and then create a directory, in this directory prepared on all the resources yum repository, if the user has access to this directory through the network to the host, then this directory will become a network yum repository

implementation process
Step 1: configure yum source host
1) install apache configuration
Slightly
2) configured yum repository resources
1. Create a directory as a storage resource yum directory
# mkdir / usr / local / the Apache / htdocs / MySource
2. mount the CD
# Mount / dev / cdrom / mnt
3. The CD-ROM replication resource to the directory you created earlier at
# cp / mnt / * / usr / local / the Apache / htdocs / MySource -rvf
4. accessed with a browser look yum repository, check whether you can see the relevant documents
http: // ip / mysource

Step: client host configuration
modify yum configuration
1) the original backup configuration file
# mkdir BAK
# * Music Videos .repo BAK
# Vim a.repo
[my_repo]
name = my_repo
Enabled = 1
gpgcheck = 0
BaseURL = HTTP: // ip / MySource
2) test
# yum repolist

Guess you like

Origin www.cnblogs.com/hao6/p/10958786.html