1. 程式人生 > >vmware centos7建立虛擬機器,搭建本地yum源和阿里雲yum源

vmware centos7建立虛擬機器,搭建本地yum源和阿里雲yum源

一.做本地的的yum源進行備份處理

mkdir /repo
cd /etc/yum.repos.d/
mv * /repo (備份所有的本地yum原始檔)

2.搭建本地的yum源

在這裡插入圖片描述
右擊選擇設定,選項

在這裡插入圖片描述
選擇跟自己對應的映象檔案

2.本地掛載使用

mount /dev/cdrom /mnt/

3.編寫yum配置檔案

[[email protected] ~]# vim /etc/yum.repos.d/bendi.repo
name=bash
baseurl=file:///mnt/
enabled=1
gpgcheck=0
:wq

4.清理快取,把新的yum源快取到本地 ,檢視yum源列表

yum clean all (清理快取)
yum makecache (將yum快取本地)
yum repolist (檢視yum的快取數目)

二.搭建阿里yum源

1.檢視一下是否有wget命令,沒有就需要安裝

yum -y install wget

2.下載對應版本的阿里yum源,這裡採用的是7版本

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.清理快取,把新的yum源快取到本地 ,檢視yum源列表

yum clean all (清理快取)
yum makecache (將yum快取本地)
yum repolist (檢視yum的快取數目)

最終的效果

在這裡插入圖片描述

有這個yum的,可以足夠用了。