[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
--2023-01-28 14:30:34-- https://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... failed: Name or service not known.
wget: unable to resolve host address ‘mirrors.aliyun.com’
解决方法 :
登录root用户,用vim /etc/resolv.conf ,打开rsolv.conf,添加DNS地址
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 223.5.5.5
nameserver 223.6.6.6
若未解决,查看网络配置,使用ifconfig
或 ip addr
查看网卡名,用 vim
/etc/sysconfig/network-scripts/ifcfg-(网卡名),查看网络参数是否正常
解决Linux(Loaded plugins: fastestmirror Please use /usr/bin/yum --help)--
yum命令出现Loaded plugins: fastestmirror
vi /etc/yum/pluginconf.d/fastestmirror.conf
把enabled=1改为0
vi /etc/yum.conf
把plugins=1改为0
yum>
sed -i "s/plugins=1/plugins=0" /etc/yum.conf
yum clean all
yum安装时出现错误[Errno 14] curl#6 - “Could not resolve host: mirrors.aliyuncs.com; Unknown e解决办法。
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/6d0c3a488c282fe537794b5946b01e28c7f44db79097bb06826e1c0c88bad5ef-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection timed out"
Trying other mirror.
vi /etc/resolv.conf
向resolv.conf文件中添加下面内容
nameserver 114.114.114.114