发布时间:2014-09-05 13:17:55作者:知识屋
[root@rh5rac1 ~]#mkdir -p /mnt/cdrom
[root@rh5rac1 ~]#mount /dev/cdrom /mnt/cdrom
因为创建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
[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
[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 |
[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
[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
测试成功。
[root@rh5rac1 Server]# yum clean all
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Cleaning up Everything
本文作者:黎俊杰(网名:踩点),从事”系统架构、操作系统、存储设备、数据库、中间件、应用程序“六个层面系统性的性能优化工作
欢迎加入 系统性能优化专业群,共同探讨性能优化技术。群号:258187244
linux一键安装web环境全攻略 在linux系统中怎么一键安装web环境方法
Linux网络基本网络配置方法介绍 如何配置Linux系统的网络方法
Linux下DNS服务器搭建详解 Linux下搭建DNS服务器和配置文件
对Linux进行详细的性能监控的方法 Linux 系统性能监控命令详解
linux系统root密码忘了怎么办 linux忘记root密码后找回密码的方法
Linux基本命令有哪些 Linux系统常用操作命令有哪些
Linux必学的网络操作命令 linux网络操作相关命令汇总
linux系统从入侵到提权的详细过程 linux入侵提权服务器方法技巧
linux系统怎么用命令切换用户登录 Linux切换用户的命令是什么
在linux中添加普通新用户登录 如何在Linux中添加一个新的用户
2012-07-10
CentOS 6.3安装(详细图解教程)
Linux怎么查看网卡驱动?Linux下查看网卡的驱动程序
centos修改主机名命令
Ubuntu或UbuntuKyKin14.04Unity桌面风格与Gnome桌面风格的切换
FEDORA 17中设置TIGERVNC远程访问
StartOS 5.0相关介绍,新型的Linux系统!
解决vSphere Client登录linux版vCenter失败
LINUX最新提权 Exploits Linux Kernel <= 2.6.37
nginx在网站中的7层转发功能