REM 判断目录是否存在,如果不存在则创建 REM 此处.\aaa为相对路径。 可以使用绝对路径,例如D:\aaa REM 注意不可用斜杠(/)做间隔符,会提示 “语法命令不正确” SET logFolder=D:\app\extra_work_log\test-3d\%computername% IFNOTEXIST%logFolder% ( REM 创建.\aaa目录 (在当前位置创建aaa目录) ECHO%logFolder%目录不存在,已创建该目录! MD%logFolder% ) ELSE ( ECHO%logFolder%目录已存在 )
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo
4、运行以下命令重新创建缓存。
1
yum clean all && yum makecache
yum源和epel源切换完成后,即可使用yum install命令在实例上安装您所需要的软件包。
可能会报错
1 2 3 4 5
[root@k8smaster ~]# yum clean all && yum makecache
Errors during downloading metadata for repository 'epel-archive': - Curl error (6): Couldn't resolve host name for http://mirrors.cloud.aliyuncs.com/epel-archive/8/Everything/x86_64/repodata/repomd.xml [Could not resolve host: mirrors.cloud.aliyuncs.com] 错误:为仓库 'epel-archive' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
运行以下命令替换repo文件中的链接,就是这一步出错了 官方提供的命令:
1 2
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo
sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' /etc/yum.repos.d/epel-archive-8.repo
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.'