001、yum报错
(base) [root@PC1 yum.repos.d]# yum install httpd ## yum安装应用报错
。
002、解决方法
(base) [root@PC1 home]# cd /etc/yum.repos.d (base) [root@PC1 yum.repos.d]# ls CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo (base) [root@PC1 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo_bak (base) [root@PC1 yum.repos.d]# vim CentOS-Base.repo (base) [root@PC1 yum.repos.d]# vim CentOS-Base.repo ## 增加一下内容到改文件中,保存退出 (base) [root@PC1 yum.repos.d]# [base] name=CentOS-$releasever - Base baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 [updates] name=CentOS-$releasever - Updates baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 [extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
003、测试效果
(base) [root@PC1 yum.repos.d]# yum install httpd -y Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile base | 3.6 kB 00:00:00 extras | 2.9 kB 00:00:00 updates | 2.9 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package httpd.x86_64 0:2.4.6-99.el7.centos.1 will be installed --> Finished Dependency ResolutionDependencies Resolved==============================================================================================================================================================Package Arch Version Repository Size ============================================================================================================================================================== Installing:httpd x86_64 2.4.6-99.el7.centos.1 updates 2.7 MTransaction Summary ============================================================================================================================================================== Install 1 PackageTotal download size: 2.7 M Installed size: 9.4 M Downloading packages: httpd-2.4.6-99.el7.centos.1.x86_64.rpm | 2.7 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transactionInstalling : httpd-2.4.6-99.el7.centos.1.x86_64 1/1Verifying : httpd-2.4.6-99.el7.centos.1.x86_64 1/1Installed:httpd.x86_64 0:2.4.6-99.el7.centos.1Complete!
。
ref:
01、https://www.cnblogs.com/lhboke/p/18411189