Linux 创建本地YUM Repo
来源:互联网 发布:网络综合布线品牌 编辑:程序博客网 时间:2024/05/20 08:45
一配置本地 YUM 源
--1.1 实验环境
RHEL6:虚拟机
--1.1 实验环境
RHEL6:虚拟机
--1.2 挂载光驱
[root@redhat6 yum.repos.d]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
备注:将光盘 ISO 文件挂载到目录 /mnt
--1.3 创建本地目录,用来 copy 光盘包
[root@redhat6 local_repo]# mkdir -p /opt/rpm/local_repo
--1.4 copy RPM 包到指定目录
[root@redhat6 log]# cd /mnt/Packages/
[root@redhat6 Packages]# cp * /opt/rpm/local_repo
--1.5 安装 createrepo 包
[root@redhat6 local_repo]# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
warning: createrepo-0.9.8-4.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
备注:createrepo 包安装成功
--1.6 创建 repo 数据库
[root@redhat6 local_repo]# createrepo -d /opt/rpm/local_repo
1944/2804 - MAKEDEV-3.24-6.el6.i686.rpm
iso-8859-1 encoding on Ville Skytt?ville.skytta@iki.fi> - 2.8.2-2
1944/2804 - MAKEDEV-3.24-6.el6.i686.rpm
iso-8859-1 encoding on Ville Skytt?ville.skytta@iki.fi> - 2.8.2-2
2804/2804 - perl-Archive-Extract-0.38-119.el6_1.1.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
备注:这个步骤需要点时间。
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
备注:这个步骤需要点时间。
--1.7 编写 /etc/yum.repos.d/local_repo.repo 文件
文件 /etc/yum.repos.d/local_repo.repo 内容如下。
[rhel-source]
name=Red Hat Enterprise Linux Local repo ##仓库描述
baseurl=file:///opt/rpm/local_repo ##软件仓库位置
enabled=1 ##是否启用
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ##签名秘钥
name=Red Hat Enterprise Linux Local repo ##仓库描述
baseurl=file:///opt/rpm/local_repo ##软件仓库位置
enabled=1 ##是否启用
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ##签名秘钥
--1.8 测试
[root@localhost yum.repos.d]# yum search vim
Loaded plugins: fastestmirror, rhnplugin, security
Repository base is listed more than once in the configuration
Repository update is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository addons is listed more than once in the configuration
Repository rhel-source is listed more than once in the configuration
This system is not registered with RHN.
RHN support will be disabled.
Determining fastest mirrors
addons | 1.9 kB 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/primary | 1.3 MB 00:25
base 3667/3667
extras | 2.1 kB 00:00
extras/primary_db | 173 kB 00:00
rhel-source | 1.9 kB 00:00
rhel-source/primary_db | 2.0 MB 00:00
update | 1.9 kB 00:00
update/primary_db | 764 kB 00:15
=============================== Matched: vim ===============================
vim-X11.x86_64 : The VIM version of the vi editor for the X Window System.
vim-common.x86_64 : The common files needed by any version of the VIM
: editor.
vim-enhanced.x86_64 : A version of the VIM editor which includes recent
: enhancements.
vim-minimal.x86_64 : A minimal version of the VIM editor.
[root@localhost yum.repos.d]# cd /opt/rpm/local_repo
[root@localhost local_repo]# ls | grep vim
vim-common-7.0.109-7.el5.x86_64.rpm
vim-enhanced-7.0.109-7.el5.x86_64.rpm
vim-minimal-7.0.109-7.el5.x86_64.rpm
vim-X11-7.0.109-7.el5.x86_64.rpm
Loaded plugins: fastestmirror, rhnplugin, security
Repository base is listed more than once in the configuration
Repository update is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository addons is listed more than once in the configuration
Repository rhel-source is listed more than once in the configuration
This system is not registered with RHN.
RHN support will be disabled.
Determining fastest mirrors
addons | 1.9 kB 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/primary | 1.3 MB 00:25
base 3667/3667
extras | 2.1 kB 00:00
extras/primary_db | 173 kB 00:00
rhel-source | 1.9 kB 00:00
rhel-source/primary_db | 2.0 MB 00:00
update | 1.9 kB 00:00
update/primary_db | 764 kB 00:15
=============================== Matched: vim ===============================
vim-X11.x86_64 : The VIM version of the vi editor for the X Window System.
vim-common.x86_64 : The common files needed by any version of the VIM
: editor.
vim-enhanced.x86_64 : A version of the VIM editor which includes recent
: enhancements.
vim-minimal.x86_64 : A minimal version of the VIM editor.
[root@localhost yum.repos.d]# cd /opt/rpm/local_repo
[root@localhost local_repo]# ls | grep vim
vim-common-7.0.109-7.el5.x86_64.rpm
vim-enhanced-7.0.109-7.el5.x86_64.rpm
vim-minimal-7.0.109-7.el5.x86_64.rpm
vim-X11-7.0.109-7.el5.x86_64.rpm
1 0
- Linux 创建本地YUM Repo
- linux创建本地yum服务
- Linux创建本地yum源
- linux本地创建yum源
- Linux创建本地yum源
- yum 设置本地 repo 源
- Centos7 配置本地Yum repo
- linux yum配置文件repo
- Redhat Linux创建本地YUM源
- linux小记10 创建本地yum源
- [Fedora 6] yum本地repo安装
- [转][fedora 6]yum本地repo安装
- 使用DVD做本地的yum repo
- 创建本地YUM源
- 创建本地yum源
- 创建本地yum源
- 创建本地源yum
- yum本地源创建
- 机器学习之概率论与数理统计基础知识-(2)随机变量和数字特征
- .htaccess
- 对AngularJS模板的理解
- 如何测试一个网页登陆界面
- Lucene中文分词Demo
- Linux 创建本地YUM Repo
- CoVH之柯南开锁_vijos 1204_匹配
- JS交互的方法(上)UIWebView
- split large file linux
- Ubuntu 16.04更新软件提示"需要安装不能信任的软件包" http://archive.ubuntukylin.com:10006/ubuntukylin xenial InRelease
- 项目47-用文件保存的学生名单
- WSDL 详解
- HTTP状态码查询
- 解决Ubuntu下Sublime Text 3无法输入中文