合 Linux配置网络和本地yum源
Tags: OSyum源挂载ISO文件本地yum源网络yum源解压
网络yum源
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | # 阿里云 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bk curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo # sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo # 阿里云 epel源 mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.repo_bk yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm sed -i 's|^#baseurl=https://download.fedoraproject.org/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel* sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel* wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo # 华为云 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bk curl -o /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-8-reg.repo wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-8-reg.repo wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-6-reg.repo wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-5-reg.repo # 华为云epel yum install -y https://repo.huaweicloud.com/repository/epel/epel-release-latest-8.noarch.rpm wget -O /etc/yum.repos.d/epel.repo https://repo.huaweicloud.com/repository/conf/epel-7-reg.repo wget -O /etc/yum.repos.d/epel.repo https://repo.huaweicloud.com/repository/conf/epel-6-reg.repo wget -O /etc/yum.repos.d/epel.repo https://repo.huaweicloud.com/repository/conf/epel-5-reg.repo yum clean all yum makecache fast rpm --rebuilddb rm -rf /var/run/yum.pid yum --disablerepo=epel -y update ca-certificates |
rhel 或 CentOS配置本地yum源
已在CentOS 、Redhat 5.5、6.5和7.8上测试通过。
挂载ISO文件
直接在外部系统挂载iso镜像文件
一般在iso文件挂载后,在OS内部为/dev/sr0
或 /dev/cdrom
或 /dev/hdc
(5.5版本),若没有这几个文件,则可能需要重启OS来挂载光盘:
1 2 3 4 5 | [root@lhrdocker ~]# ll /dev/sr0 brw-rw----+ 1 root cdrom 11, 0 Dec 3 14:37 /dev/sr0 [root@lhrdocker ~]# ll /dev/cdrom lrwxrwxrwx 1 root root 3 Dec 3 14:37 /dev/cdrom -> sr0 [root@lhrdocker ~] |