forked from aqzt/kjyw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
|
||
#非阿里云ECS用户会出现 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影响使用。用户也可自行修改相关配置 | ||
#sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo | ||
|
||
mkdir -p /opt/repo/bak | ||
mv /etc/yum.repos.d/*.repo /opt/repo/bak/ | ||
|
||
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo | ||
|
||
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | ||
|
||
cat <<EOF > /etc/yum.repos.d/kubernetes.repo | ||
[kubernetes] | ||
name=Kubernetes | ||
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/ | ||
enabled=1 | ||
gpgcheck=1 | ||
repo_gpgcheck=1 | ||
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg | ||
EOF | ||
|
||
rpm -Uvh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm | ||
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 | ||
|
||
##yum makecache | ||
yum makecache fast -y | ||
|
||
echo ok |