收藏文章 楼主

搭建本地yum

版块:linux   类型:普通   作者:小绿叶技术博客   查看:1878   回复:0   获赞:2   时间:2019-05-23 09:42:08

 mv /etc/yum.repos.d/* /home/

   19  vi /etc/yum.repos.d/yum.repo

   20  yum clean all

   21  yum list

   22  systemctl stop firewalld

   23  systemctl disable firewalld

   24  yum install iaas-xiandian -y

   25  poweroff 

   26  vi /etc/sysconfig/network-scripts/ifcfg-eno16777736 

   27  systemctl restart netw9ork

   28  systemctl restart network

   29  ip add

   30  mv /etc/yum.repos.d/* ./h

   31  mv /home/* /etc/yum.repos.d/

   32  ll /etc/yum.repos.d/

   33  yum install -y yum-utils   device-mapper-persistent-data   lvm2

   34  yum-config-manager     --add-repo     https://download.docker.com/linux/centos/docker-ce.repo

   35  yum-config-manager --enable docker-ce-nightly

   36  yum install -y wget

   37  wget ftp://10.32.18.211/k8s/kubernetes.repo

   38  mv kubernetes.repo  /etc/yum.repos.d/

   39  yum clean all

   40  yum list

   41  history 

   42  yum help

   43  yum -y install  --downloadonly  --downloaddir=/opt/yum docker-ce

   44  mkdir /opt/yum


#==========================脚本=========================================

#!/bin/bash

cat >> /etc/yum.repos.d/kubernetes.repo << EOF

[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


yum clean all

yum install -y expect

#"Is this ok [y/N]:

touch yum-list.sh

cat >> yum-list.sh << EOF

#!/usr/bin/expect

sleep 5

spawn yum list

expect {

"Is this ok" {send "y\r"; exp_continue}

}

EOF

#这是交互界面,用于在提示操作信息的时候自动输入,在expect{}里面添加多个匹配输入并回答

chmod +x yum-list.sh

./yum-list.sh

#1.1、设置kubernetes国内安装源

yum install yum-plugin-downloadonly

#在这个程序执行后自动y  再等待3秒后再输入y

yum install --downloadonly --downloaddir=/tmp RPM_Name

yum -y install createrepo

createrepo /opt/yum/

yum install -y wget

wget ftp://10.32.18.211/k8s/harbor-offline-installer-v1.7.5.tgz


提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:搭建本地yum

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息