Configuration of yum
Yum (Yellow dog Updater, Modified) is a Shell front-end package manager in Fedora and RedHat as well as in CentOS. Based on RPM package management, RPM packages can be downloaded and installed automatically from designated servers, dependencies can be automatically dealt with, and all dependent software packages can be installed at one time without tedious downloading and installation.
After installing the operating system (except as if minimized), you will have the following files in the / etc/yum.repo.d/ directory.
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
This is the configuration file of the system source and can be used directly without modifying its contents and network access. Of course, you can also download and use other network sources manually.
Download the network yum repository
# wget http://mirrors.aliyun.com/repo/Centos-7.repo-C / etc/yum.repo.d/
# wget http://mirrors.aliyun.com/repo/epel-7.repo-C / etc/yum.repo.d/
# yum clean all / / clear yum cache
# yum repolist / / list installation packages
Configure the local yum repository
Generally speaking, the package in the CD image can meet our basic use.
Here are the steps for building a local yum repository:
Mkdir-p / xxx/xxx / / create a CD mount point, and of course you can copy CD files to that path.
Mount / dev/sr0 / xxx/xxx / / Mount CD
Vim / etc/yum.repo.d/xxx.repo
[xxx]
Name=xxx
Baseurl= file:///xxx/xxx / / File path
Enabled=1 / / whether to enable the source (1 on, 0 off). The system enables the source application by default, and you can leave this item unwritten.
Gpgcheck=0 / / whether to authenticate the source with key (1 on, 0 off). Because it is a CD source, I turn off authentication.
# yum clean all
# yum repolist
Use yum
Install / update
Format: yum install/update package
Install / / installation
-- installroot=/some/path / / install the software in / some/path instead of using the default path.
Update / / Update
-y / / avoid confirmation prompts during installation
List / / list package
Remove / / Delete
Deplist / / list associated packages
Common commands:
Yum-y install package
Yum-y update package
Yum clean all
Yum repolist
Yum deplist package