redhat linux 5上创建本地yum源
来源:互联网 发布:车辆违章查询软件 编辑:程序博客网 时间:2024/05/18 12:37
1、挂载光驱
[root@rh5rac1 ~]#mkdir -p /mnt/cdrom
[root@rh5rac1 ~]#mount /dev/cdrom /mnt/cdrom
2、将redhat光盘内容复制至本地硬盘
因为创建yum源的目录,必须是可以写入的的目录,所以需要将光盘中的文件全部复制到本地目录,如果在/mnt/cdrom光驱挂载目录执行创建yum源,会报“Directory /mnt/cdrom must be writable.”错误
[root@rh5rac1 ~]#mkdir -p /soft/redhat
[root@rh5rac1 /]# cp -rp /mnt/cdrom/ /soft/redhat/
[root@rh5rac1 /]# cd /soft/redhat
[root@rh5rac1 redhat]# ls
cdrom
3、安装createrepo包
[root@rh5rac1 cdrom]# cd /soft/redhat/cdrom/Server/
[root@rh5rac1 Server]# ls -l |grep createrepo
-r--r--r-- 1 root root 60901 Apr 21 2008 createrepo-0.4.11-3.el5.noarch.rpm
[root@rh5rac1 Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
4、在/etc/yum.repos.d目录下创建server.repo文件
[root@rh5rac1 Server]# cd /etc/yum.repos.d/
[root@rh5rac1 yum.repos.d]# pwd
/etc/yum.repos.d
[root@rh5rac1 yum.repos.d]# vi server.repo
[Server]
name=Server
baseurl=file:///soft/redhat/cdrom/Server
enabled=1
gpgcheck=0
[Cluster]
name=Cluster
baseurl=file:///soft/redhat/cdrom/Cluster
enabled=1
gpgcheck=0
[ClusterStorage]
name=ClusterStorage
baseurl=file:///soft/redhat/cdrom/ClusterStorage
enabled=1
gpgcheck=0
[VT]
name=VT
baseurl=file:///var/redhat/cdrom/VT
enabled=1
gpgcheck=0
5、使用createrepo创建yum库
[root@rh5rac1 yum.repos.d]# cd /soft/redhat/cdrom/Server/
[root@rh5rac1 Server]# createrepo /soft/redhat/cdrom
3389/3389 - ClusterStorage/gfs-utils-0.1.20-10.el5.x86_64.rpm pm_64.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
6、安装测试
[root@rh5rac1 /]# rpm -qa |grep sysstat
[root@rh5rac1 /]#
[root@rh5rac1 /]# yum -y install sysstat
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Cluster | 1.5 kB 00:00
Cluster/primary | 6.5 kB 00:00
Cluster 32/32
ClusterStorage | 1.5 kB 00:00
ClusterStorage/primary | 8.7 kB 00:00
ClusterStorage 39/39
Server | 1.5 kB 00:00
Server/primary | 913 kB 00:00
Server 3261/3261
VT | 1.3 kB 00:00
VT/primary | 18 kB 00:00
VT 57/57
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================
Installing:
sysstat x86_64 7.0.2-11.el5 Server 187 k
Transaction Summary
=====================================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 187 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: sysstat 1/1
Cluster/productid | 1.7 kB 00:00
ClusterStorage/productid | 1.8 kB 00:00
Server/productid | 1.7 kB 00:00
duration: 661(ms)
Installed products updated.
Installed:
sysstat.x86_64 0:7.0.2-11.el5
Complete!
[root@rh5rac1 /]# rpm -qa |grep sysstat
sysstat-7.0.2-11.el5
测试成功。
7、删除yum源
[root@rh5rac1 Server]# yum clean all
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Cleaning up Everything
本文作者:黎俊杰(网名:踩点),从事”系统架构、操作系统、存储设备、数据库、中间件、应用程序“六个层面系统性的性能优化工作
欢迎加入 系统性能优化专业群,共同探讨性能优化技术。群号:258187244
- redhat linux 5上创建本地yum源
- Redhat Linux创建本地YUM源
- Redhat Linux RHEL6配置本地YUM源
- RedHat Linux 本地yum源的配置
- Redhat Linux RHEL6配置本地YUM源
- redhat linux配置本地yum源
- Linux创建本地yum源
- linux本地创建yum源
- Linux创建本地yum源
- Redhat 本地yum源配置
- Redhat本地yum源配置
- Redhat搭建本地Yum源
- redhat使用本地yum源
- RedHat Linux设置yum软件源为本地ISO
- redhat enterprise linux 下配置本地yum源
- redhat enterprise linux 下配置本地yum源
- linux小记10 创建本地yum源
- RedHat linux配置yum本地资源
- - -00.
- 浅谈Linux内存管理机制
- Struts2 中为acton注入值以及常量配置和常量介绍
- 33-Android标签页
- 数据库范式
- redhat linux 5上创建本地yum源
- 赢在投资网—微操盘 120放大资金 ,盈利随时提取
- argv 的用法
- 赢在投资网—微操盘 120放大资金 ,盈利随时提取
- servlet url pattern: /* 和 / 区别
- 接口原理
- ruby on rails学习笔记——Ubuntu下sudo apt-get update错误解决
- 基本概念
- [POJ 2407]Relatives(欧拉函数)