本地yum源配置
在我们新安装的 REDHAT 7 系统中并不存在配置源,我们使用的系统中为了节省空间,提高运行的效率,往往有非常多的包是没有安装的;当我们发现有包缺失时,需要我们自行安装;安装就需要运用到yum源;配置本地源可以在没有网络的情况下进行包的安装。
用 df -h 对磁盘容量察看,发现没有 sr0 ,所以第一步就要先对磁盘进行挂载处理。
温馨提示:如果没有 sr0 就无法使用本地源
[root@deng- order]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda2 10G 1.3G 8.8G 13% /
devtmpfs 286M 0 286M 0% /dev
tmpfs 296M 0 296M 0% /dev/shm
tmpfs 296M 8.8M 287M 3% /run
tmpfs 296M 0 296M 0% /sys/fs/cgroup
/dev/sda3 9.6G 33M 9.5G 1% /data
/dev/sda1 497M 112M 385M 23% /boot
tmpfs 60M 0 60M 0% /run/user/0
/dev/sdb1 976M 2.6M 907M 1% /d1
把 sr0 挂载到根目录 iso 目录下 :mount /dev/sr0 /iso
[root@deng- order]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/sda2 10G 1.3G 8.8G 13% /
devtmpfs 286M 0 286M 0% /dev
tmpfs 296M 0 296M 0% /dev/shm
tmpfs 296M 8.8M 287M 3% /run
tmpfs 296M 0 296M 0% /sys/fs/cgroup
/dev/sda3 9.6G 33M 9.5G 1% /data
/dev/sda1 497M 112M 385M 23% /boot
/dev/sr0 3.8G 3.8G 0 100% /iso
tmpfs 60M 0 60M 0% /run/user/0
/dev/sdb1 976M 2.6M 907M 1% /d1
挂载完成后对 /etc/yum.repos.d/base.repo 进行修改
[root@deng- ~]# vim /etc/yum.repos.d/base.repo
[base]
name=base
baseurl=file:///iso
enabled=1
gpgcheck=0
在此本地源的配置以完成
yum网络源配置
如果在 REDHAT 7 系统中,单纯只有本地源往往是不够的,本地源的安装包有限,然而就需要用到我们的网络源。运用网络源的前提,必须要有网络。
网络源的地址:
阿里巴巴开源镜像站 :https://mirrors.aliyun.com
网易开源镜像站 : https://mirrors.163.com
[base]
name=base
baseurl=file:///iso
enabled=1
gpgcheck=0
[163.com]
name=163.com
baseurl= https://mirrors.163.com/centos/7/os/x86_64/
enabled=1
gpgcheck=0
[aliyun]
name=aliyun
baseurl= https://mirrors.aliyun.com/centos/7/os/x86_64/
enabled=1
gpgcheck=0
源可以放在下方进行添加,当第一个源没有包的时候会选择第二个源,源可以多选。