加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

搭建本地yum仓库

发布时间:2020-12-15 09:10:21 所属栏目:安全 来源:网络整理
导读:如果处在局域网中,主机不能访问外网,这时我们可以搭建一个本地的yum源,解决安装问题: 1、挂载镜像到/mnt目录,我这里使用的是安装镜像 #mkdir /mnt/cdrom#mount /dev/cdrom /mnt/cdrom # df -hT/dev/sr0 iso9660 4.1G 4.1G 0 100% /mnt/cdrom cp -r /etc/

如果处在局域网中,主机不能访问外网,这时我们可以搭建一个本地的yum源,解决安装问题:

1、挂载镜像到/mnt目录,我这里使用的是安装镜像

#mkdir  /mnt/cdrom
#mount /dev/cdrom /mnt/cdrom
# df -hT
/dev/sr0            iso9660   4.1G  4.1G     0 100% /mnt/cdrom
cp -r /etc/yum.repos.d /etc/yum.repos.d.bak
rm -f /etc/yum.repos.d/*

vim /etc/yum.repos.d/dvd.repo

#内容如下

[dvd]
name=install dvd
baseurl=file:///mnt/cdrom
enable=1
gpgcheck=0
yum clean all
 yum makercache
[root@aiker01 yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id                                     repo name                                        status
dvd                                         install dvd                                      enabled: 3,831
repolist: 3,831

#yum list 查看yum中的安装包如下图

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读