- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
YUM是一种安装软件包的工具,这个工具可以自行解决rpm软件包之间的依赖关系,可以实现快速安装软件包。
(1)、挂载光驱,将光盘 ISO文件挂载到目录 /mnt/sr0
[root@localhost /]# mkdir /mnt/sr0
[root@localhost /]# mount /dev/sr0 /mnt/sr0/
mount: block device /dev/sr0 is write-protected, mounting read-only
创建本地目录,用来copy光盘包。
[root@localhost ~]# mkdir -p /CentOS/local_repo
copy RPM 包到指定目录。
[root@localhost media]# cd /mnt/sr0/Packages/
[root@localhost Packages]# cp * /CentOS/local_repo/
安装 createrepo 包,该软件用来解析依赖关系。
[root@localhost Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:deltarpm ########################################### [100%]
[root@localhost Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:python-deltarpm ########################################### [100%]
[root@localhost Packages]# rpm -ivh createrepo-0.9.9-18.el6.noarch.rpm
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
创建 repo 数据库。
[root@localhost Packages]# createrepo -d /CentOS/local_repo/
进入yum.repos.d 目录下会有4个文件,编辑CentOS-Media.repo这个文件。编辑后将CentOS-
Base.repo该名,下面是在源文件后面加个后缀.BAK。如果不将此文件改名或移除系统将默认通过
该文件找YUM源。
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
总用量 16
-rw-r--r--. 1 root root 1926 11月 27 2013 CentOS-Base.repo.BAK
-rw-r--r--. 1 root root 638 11月 27 2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 581 5月 25 21:59 CentOS-Media.repo
-rw-r--r--. 1 root root 3664 11月 27 2013 CentOS-Vault.repo
[root@localhost yum.repos.d]# vim CentOS-Media.repo
# CentOS-Media.repo
# This repo can be used with mounted DVD media, verify the mount point for
# CentOS-6. 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=c6-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c6-media [command]
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///CentOS/local_repo/
gpgcheck=1
enabled=1
gpgkey=file:///mnt/src/RPM-GPG-KEY-CentOS-6
测试仓库
[root@localhost ~]# yum clean all
Loaded plugins: fastestmirror, security
Cleaning repos: c6-media
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost ~]# yum repolist
Loaded plugins: fastestmirror, security
Determining fastest mirrors
c6-media | 2.9 kB 00:00 ...
c6-media/primary_db | 3.3 MB 00:00 ...
repo id repo name status
c6-media CentOS-6 - Media 3,995
repolist: 3,995
[root@localhost ~]#
售前咨询
售后咨询
备案咨询
二维码
TOP