转载:http://www.mvpbang.com/articles/2017/12/22/1513948827684.html

rhel7.x配置本地yum

环境: centos7.4 vmareworkstation11

01、加载iso 虚拟机–可移动设备–连接

02、挂载iso mount /dev/sr0 /mnt

03、移动yum源 mkdir /local_yum cp -a /mnt/{Packages,repodata,RPM-GPG-KEY-CentOS-7} /local_yum/

04、设置yum源

cd /etc/yum.repo.d/ mkdir bak

ls |grep -v bak |xargs -i mv {} bak/ #备份存在的yum

vim local.repo

[local_yum]

name=centos7.4

baseurl=file:///local_yum

enable=1

gpgcheck=1

gpgkey=file:///local_yum/RPM-GPG-KEY-CentOS-7

05、测试yum [root@lab-222 ~]# yum repolist

Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile repo id repo name status local_yum centos7.4 3,894 repolist: 3,894

centos7.4 http://mirrors.ustc.edu.cn/centos/7.4.1708/isos/x86_64/

相关文章:

  • 2021-10-09
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2021-06-10
  • 2021-11-16
  • 2021-03-26
  • 2021-10-28
  • 2021-05-08
相关资源
相似解决方案