挂载yum源
我们需要一些yum源和iaas源
每次挂在太麻烦直接写脚本
执行前需要把centos的镜像和iaas的镜像 上传到/root上,如果其他地方,可以去脚本里修改目录
#!/bin/bash
mkdir -p /mnt/iaas
mkdir -p /mnt/centos
mount -o loop /root/chinaskills_cloud_iaas.iso /mnt/iaas
mount /dev/sr0 /mnt/centos
mv /etc/yum.repos.d/* /mnt
yum install epel-release -y
cat > /etc/yum.repos.d/Centos.repo <<EOF
[iaas]
name = iaas
baseurl = file:///mnt/iaas/iaas-repo
gpgcheck = 0
enabled = 1
[centos]
name = centos
baseurl = file:///mnt/centos
gpgcheck = 0
enabled = 1
EOF
yum clean all
yum makecache
yum repolist
以上执行也能包含epel源
wget -O repo.sh https://www.xiongan.host/sh/repo.sh && sh repo.sh
kubernetes镜像
wget -O kubernetes.sh https://www.xiongan.host/sh/kubernetes.sh && sh kubernetes.sh
Centos7远程源
mv /etc/yum.repos.d/* /mnt && wget -O /etc/yum.repos.d/Centos-XA-Base.repo https://www.xiongan.host/sh/Centos-XA-Base.repo
执行完成后清理一下缓存
yum clean all
执行缓存
yum makecache
2 条评论
测试代理
|´・ω・)ノ