一、 yum install报错

[root@i8-k8smaster-dev redis]# sudo yum install lrzsz
CentOS-8 - AppStream                                                                                                                                                                                                                          0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'AppStream':
  - Curl error (7): Couldn't connect to server for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Failed to connect to mirrorlist.centos.org port 80: Connection refused]
Error: Failed to download metadata for repo 'AppStream': Cannot prepare internal mirrorlist: Curl error (7): Couldn't connect to server for http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=stock [Failed to connect to mirrorlist.centos.org port 80: Connection refused]

二、解决方法

1. 显示当前网络连接
nmcli connection show

[root@i8-k8smaster-dev redis]# nmcli connection show
NAME     UUID                                  TYPE      DEVICE  
ens192   03da7500-2101-c722-2438-d0d006c28c73  ethernet  ens192  
docker0  e7e0ed7e-99e2-4cdf-a199-163deae96aa8  bridge    docker0 
virbr0   a50c17d8-f0c1-4f6a-b001-42cba6fe6018  bridge    virbr0  

2.改当前网络连接对应的DNS服务器,这里的网络连接可以用名称或者UUID来标识
nmcli con mod ens192 ipv4.dns "114.114.114.114 8.8.8.8"

3.将dns配置生效
nmcli con up ens192 

[root@i8-k8smaster-dev redis]# nmcli con mod ens192 ipv4.dn. "114.114.114.114 8.8.8."
[root@i8-k8smaster-dev redis]# nmcli con up ens192
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐