yum本地仓库和远程仓库搭建

一、【本地yum搭建】

[root@jin ~]# mkdir  /dvd

1)挂载的方式一:

[root@jin ~]# mount  /dev/sr0  /dvd/

2)挂载的方式二:

[root@jin ~]# umount  /dvd/

[root@jin ~]# mount  /dev/cdrom  /dvd/

#

[root@jin ~]# cd /etc/yum.repos.d/

[root@jin yum.repos.d]# rm  -f  *

[root@jin yum.repos.d]# vim  dvd.repo

扫描二维码关注公众号,回复: 4591331 查看本文章

[rhel]

name=rhel 7.4

baseurl=file:///dvd

enaled=1

gpgcheck=0

#

[root@oldjin ~]# yum  clean  all

[root@oldjin ~]# yum  repolist

二、【远程yum搭建】                #可以先搭建本地yum服务,安装ftp

#搭建ftp服务

[root@jin ~]# yum  -y  install  vsftpd

[root@jin ~]# systemctl  start  vsftpd

[root@jin ~]# systemctl  enable  vsftpd

#

[root@jin ~]# cd  /var/ftp/

[root@jin ftp]# mkdir  rhel

[root@jin ftp]# mount  /dev/sr0  rhel/

#

[root@jin ~]# cd  /etc/yum.repos.d/

[root@jin yum.repos.d]# rm  -f  *

[root@jin yum.repos.d]# vim  dvd.repo

[rhel]

name=rhel 7.4

baseurl=ftp://192.168.2.100/rhel

enaled=1

gpgcheck=0

#

[root@jin ~]# yum  clean  all

[root@jin ~]# yum  repolist

猜你喜欢

转载自blog.51cto.com/10627336/2333753