centos8.X ip 源配置

 

# 网络静态IP配置
    1修改配置文件 vi /etc/sysconfig/network-scripts/ifcfg-ens32
    2重启网卡要用:nmcli connection down/up ens32
    3 建议顺序
            nmcli connection modify ens32 ipv4.addresses 192.168.1.63/24 ipv4.method manual ipv4.gateway 192.168.1.1 ipv4.dns 192.168.1.1 
            nmcli connection down ens32
            nmcli connection up ens32
            ip a
            ping www.baidu.com
# 配置国内yum-dnf源
cd /etc/yum.repos.d/  && rm -f ./*
# 清华源:
curl -o CentOS-Base.repo https://raw.githubusercontent.com/hackyoMa/docker-centos/8/CentOS-Base.rep 

cat CentOS-Base.repo.qinghuang 
[BaseOS]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[AppStream]
name=CentOS-$releasever - AppStream
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[PowerTools]
name=CentOS-$releasever - PowerTools
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

# 阿里源:
cat >/etc/yum.repos.d/CentOS-AppStream.repo<<EOF
[AppStream]
name=CentOS-\$releasever - AppStream
baseurl=http://mirrors.aliyun.com/centos/\$releasever/AppStream/\$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
EOF

cat >/etc/yum.repos.d/CentOS-Base.repo<<EOF
[BaseOS]
name=CentOS-\$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/\$releasever/BaseOS/\$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
EOF

cat >/etc/yum.repos.d/CentOS-Epel.repo<<EOF
[epel]
name=CentOS-\$releasever - Epel
baseurl=http://mirrors.aliyun.com/epel/8/Everything/$\basearch
enabled=1
gpgcheck=0
EOF

 

posted on 2023-07-04 09:48  luokeli  阅读(28)  评论(0)    收藏  举报

导航