Installation operation and maintenance 19yum

I. Introduction
YUM is an acronym for "Yellow dog Updater, Modified", is a package manager, YUM automatically downloaded RPM package from the local (rpm package rpm address or local path related sites) specified and installed, well solving dependency problems.

Two ... yum related instruction

yum install package name to install
yum reinstall the package name reinstall
yum update update the package name
yum remove package name deleted
yum repolist view warehouse sum rpm package
yum repolist all View all warehouses (including enabling and disabling)
yum query is what the Provides warehouse which package provides
yum groups install the package group installation group names package
yum groups remove remove a group package
yum history about the history yum
yum history ID detailed info N query history execute the command yum
yum command um history undo N undo history have been executed
yum clean all clear all cache
yum clean packages to clean up all the cached rpm package

III. Configuring source

a source configuration:.
Base Source: Base Package -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget
EPEL Source: first party software wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
configure a source in two ways:
add a repo file 1. manual ( manual)
2. install a "release" of the package, the package provides a repo file (automatic)
arranged MongoDB a source of
vim /etc/yum.repos.d/mongodb.repo

[mongodb-org]
name = MongoDB Repository
baseurl = https://mirrors.aliyun.com/mongodb/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck = 0
enabled = 1
gpgkey = https://www.mongodb.org/static/pgp/server-3.6.asc

Install the software by yum localinstall locally
yum localinstall mongodb-org-3.6.0-1.el7.x86_64.rpm

. b enable or disable the warehouse
in two ways:
1. Locate the repo file repository, which will enable the modification is not enabled 1 0 start
2.gzip /etc/yum.repos.d/xx.repo compress the file, so invalidate the document

c. a packet mode cache rpm, yum modify global profile
Vim /etc/yum.conf
[main]
cacheDir = / var / Cache / yum / b a s e a r c h / basearch / the releasever
keepcache. 1 = start buffer #

IV. To build local yum repository

1. Prepare an iso image file, connect the virtual machine
2. Mount our CD to a directory under local
Mount / dev / cdrom / mnt
3. Comment out all the repo files, then add their own a new repo file ( add a local source)
the gzip /etc/yum.repos.d/*
Vim /etc/yum.repos.d/oldboy.repo
[local-Oldboy] # warehouse name can be freely expressed
description name = local Packages # warehouse may View repolist by yum
baseurl = File: /// mnt # our warehouse there, what protocol to use to access #http: // the FTP: // File: //
enabled = 1 # 1 indicates whether to enable the warehouse to start 0 means no enable
gpgcheck = 0 # if you want to verify the legitimacy of the package (0 not check)
4. use the yum command to install the software testing
yum install wget -y

Published 22 original articles · won praise 0 · Views 288

Guess you like

Origin blog.csdn.net/weixin_44648034/article/details/105079527