发布时间:2014-09-05 17:25:04作者:知识屋
为了解决软件包的依赖问题,红帽系列发行版最好的方式是利用yum,用rhel安装光盘文件里的文件构建yum源,这里以http方式(还可以本地光盘方式,本地文件方式),本文记录简要过程,仅供参考。
1.挂载安装光盘到系统
mount /dev/cdrom /media/
2.复制文件到web服务器rhel5目录下
cp -fr /media/* /var/www/htm/rhel5
3.重建记录分组文件
首先,确认系统已经安装createrepo包。
cd /var/www/htm/rhel5/Server
rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
然后重建rpm记录分组文件
createrepo -g /var/www/html/rhel5/VT/repodata/comps-rhel5-vt.xml /var/www/html/rhel5/VT
createrepo -g /var/www/html/rhel5/Cluster/repodata/comps-rhel5-cluster.xml /var/www/html/rhel5/Cluster
createrepo -g /var/www/html/rhel5/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /var/www/html/rhel5/ClusterStorage
createrepo -g /var/www/html/rhel5/Server/repodata/comps-rhel5-server-core.xml /var/www/html/rhel5/Server
4.在/etc/yum.repos.d目录下建立repo库文件 rhel5-http.repo
(注:此文件名任意,文件后缀名必须是repo)
cd /etc/yum.repos.d
vi rhel5-http.repo
#我的机器IP是为192.168.171.3
Quotation
[Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=http://192.168.171.3/rhel5/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - ClusterStorage
baseurl=http://192.168.171.3/rhel5/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Server
baseurl=http://192.168.171.3/rhel5/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[VT]
name=Red Hat Enterprise Linux $releasever - $basearch - VT
baseurl=http://192.168.171.3/rhel5/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
5.清除本机yum缓存
yum clean all
6.测试
yum -y install vim*
Quotation
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
Package 2:vim-minimal-7.0.109-4.el5_2.4z.i386 already installed and latest version
Package 2:vim-common-7.0.109-4.el5_2.4z.i386 already installed and latest version
Package 2:vim-enhanced-7.0.109-4.el5_2.4z.i386 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package vim-X11.i386 2:7.0.109-4.el5_2.4z set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================
===========================================================
Package Arch Version Repository Size
================================================================
=============================================================
Installing:
vim-X11 i386 2:7.0.109-4.el5_2.4z Server 1.4 M
Transaction Summary
================================================================
=============================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 1.4 M
Downloading Packages:
vim-X11-7.0.109-4.el5_2.4z.i386.rpm | 1.4 MB 00:00
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186
Importing GPG key 0x37017186 "Red Hat, Inc. (release key) " from /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : vim-X11 [1/1]
Installed: vim-X11.i386 2:7.0.109-4.el5_2.4z
Complete!
8.配置web服务器,默认目录指定到rhel 源位置.
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层转发功能