我们需要一些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
wget -O kubernetes.sh https://www.xiongan.host/sh/kubernetes.sh && sh kubernetes.sh
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
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有