linux安装nginx报如下错误:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.163.com
* updates: mirrors.aliyun.com
No package nginx available.
Error: Nothing to do
修改yum源:
首先安装wget: yum -y install wget
在执行如下命令:
1. cd /etc/yum.repos.d
2. mv CentOS-Base.repo CentOS-Base.repo.backup
3. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
4. mv CentOS6-Base-163.repo CentOS-Base.repo
5.yum clean all
执行完后安装又报下面错误:
Loaded plugins: fastestmirror
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/4): base/7/x86_64/group_gz | 153 kB 00:00:00
(2/4): extras/7/x86_64/primary_db | 232 kB 00:00:01
(3/4): base/7/x86_64/primary_db | 6.1 MB 00:00:11
(4/4): updates/7/x86_64/primary_db | 7.1 MB 00:00:18
Determining fastest mirrors
No package nginx available.
Error: Nothing to do
执行命令:
yum install epel-release
后 重新安装:
yum install nginx
安装成功!