Centos iso 镜像挂载离线 yum 源

本贴最后更新于 1651 天前,其中的信息可能已经物是人非

准备阶段

1.查看系统版本

[root@centos73-1611 ~]# cat /etc/redhat-release   
CentOS Linux release 7.3.1611 (Core)

2.下载与系统版本一致的 iso 镜像 http://mirror.nsc.liu.se/centos-store/

配置 yum 本地源

1.准备挂载路径 mkdir /mnt/iso

2.挂载 iso 镜像

[root@centos73-1611 xqzhang]# mount CentOS-7.3-x86_64-DVD-1611.iso /mnt/iso  
mount: /dev/loop0 is write-protected, mounting read-only

3.添加本地源 vim CentOS-Media.repo

# CentOS-Media.repo
#
#  This repo can be used with mounted DVD media, verify the mount point for
#  CentOS-7.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c7-media [command]
#
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c7-media [command]

[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///media/cdrom/
        file:///media/cdrecorder/
        file:///mnt/iso/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

增加本地源 file:///mnt/iso/,修改 enabled=1
4.重建 yum 缓存
yum clean all
yum makecache

测试

yum install ftp

  • Linux

    Linux 是一套免费使用和自由传播的类 Unix 操作系统,是一个基于 POSIX 和 Unix 的多用户、多任务、支持多线程和多 CPU 的操作系统。它能运行主要的 Unix 工具软件、应用程序和网络协议,并支持 32 位和 64 位硬件。Linux 继承了 Unix 以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。

    914 引用 • 930 回帖 • 1 关注
  • CentOS

    CentOS(Community Enterprise Operating System)是 Linux 发行版之一,它是来自于 Red Hat Enterprise Linux 依照开放源代码规定释出的源代码所编译而成。由于出自同样的源代码,因此有些要求高度稳定的服务器以 CentOS 替代商业版的 Red Hat Enterprise Linux 使用。两者的不同在于 CentOS 并不包含封闭源代码软件。

    238 引用 • 224 回帖 • 1 关注
  • yum
    19 引用 • 7 回帖

相关帖子

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...