解决centos7.X 中使用yum安装时提示没有对应包

只想用yum安装nginx,不想使用源码包编译安装。可是yum安装时,提示yum仓库中找不到安装包。nginx


问题报错以下:vim

尝试安装nginxbash

yum install -y nginx
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package nginx available.
Error: Nothing to do

解决办法:
ide

1、扩展包更新(epel第三方软件库)url

yum install -y epel-release

2、更新yum源
spa

yum update

可能会出现以下报错:
源码

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

解决办法
it

vim /etc/yum.repos.d/epel.repo    把基础的恢复,镜像地址注释掉
#baseurl
mirrorlist             //修改成以下


baseurl
#mirrorlist

再执行 编译

yum update

3、从新安装nginx,没问题ast

yum install -y nginx
相关文章
相关标签/搜索