Yum server configuration
of Redhat Red Hat Enterprise 5.2
Requirements(需求)
Server:
yum-3.2.8-9.el5
yum-rhn-plugin-0.5.3-6.el5
yum-metadata-parser-1.1.2-2.el5
yum-updatesd-0.9-2.el5
createrepo-0.4.11-3.el5.noarch.rpm
yum-arch-2.2.2-2.el5.noarch.rpm
client:
yum-3.2.8-9.el5
yum-metadata-parser-1.1.2-2.el5
Install(安装)
Server:
Install and config yum
One after another RPM package install, especially” yum-arch-2.2.2-2.el5.noarch.rpm”,
[root@localhost ~]#mkdir /rleh5 [root@localhost ~]#cp -R /mnt/dvd/Server /rhel5 [root@localhost rleh5]# cp /mnt/dvd/RPM-GPG-KEY-redhat-release Server |
[root@localhost ~]# yum-arch /rleh5/Server …… ignoring bad rpm: kde-i18n-Norwegian-Nynorsk-3.5.4-1.noarch.rpm Digesting rpms 100 % complete: yum-aliases-1.1.10-9.el5.noarch.rpmError opening rpm
yum-aliases-1.1.10-9.el5.noarch.rpm - error public key not available
ignoring bad rpm: yum-aliases-1.1.10-9.el5.noarch.rpm
Total: 2223 Used: 0 Src: 0
Writing header.info file |
Mayb show error, ignore!
[root@localhost ~]# createrepo /rleh5/Server 2223/2223 - yum-aliases-1.1.10-9.el5.noarch.rpm m Saving Primary metadata Saving file lists metadata Saving other metadata |
Install apache
[root@localhost rleh5]# rpm -icvh apr-1.2.7-11.i386.rpm [root@localhost rleh5]# rpm -icvh postgresql-libs-8.1.11-1.el5_1.1.i386.rpm [root@localhost rleh5]# rpm -icvh apr-util-1.2.7-7.el5.i386.rpm [root@localhost rleh5]# rpm -icvh httpd-2.2.3-11.el5_1.3.i386.rpm |
[root@localhost rleh5]# cd /etc/httpd/conf [root@localhost conf]# vi httpd.conf
DocumentRoot "/rleh5"
<Directory "/rleh5">
[root@localhost conf]# service httpd restart Stopping httpd: [FAILED] Starting httpd: Syntax error on line 291 of /etc/httpd/conf/httpd.conf: Invalid command 'rlehrlehrlehrlehrlehrlehrleh5#', perhaps misspelled or defined by a
module not included in the server configuration [FAILED] [root@localhost conf]# vi httpd.conf [root@localhost conf]# service httpd restart Stopping httpd: [FAILED] Starting httpd: [ OK ] [root@localhost conf]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ]
|
Command ‘Ntsysv’ config httpd to auto
Client:
[root@localhost yum.repos.d]# mkdir -p /etc/yum.repos.d/backup [root@localhost yum.repos.d]# mv *.repo backup [root@localhost yum.repos.d]# cp backup/rhel-debuginfo.repo server.repo [root@localhost yum.repos.d]# cat server.repo [rhel-debuginfo] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=http://10.155.2.75/Server/ enabled=1 gpgcheck=1 gpgkey=http://10.155.2.75/Server/RPM-GPG-KEY-redhat-release |
Test
Command:
yum install dasher 安装dasher
yum -y install firefox 安装自动应答为yes
yum remove httpd 删除软件包
yum clean all 清空下载的软件包的缓存
yum list 列出所有的软件包(包括已安装和在YUM服务器上存在的)
yum upgrade 升级软件包
yum update 升级软件包
yum list installed 列出所有已经安装的软件包
yum list available 列出所有可用的软件包
yum list updates 列出所有可升级的软件包
[root@localhost yum.repos.d]# yum install dasher Loading "security" plugin Loading "rhnplugin" plugin This system is not registered with RHN. RHN support will be disabled. rhel-debuginfo 100% |=========================| 951 B 00:00 primary.xml.gz 100% |=========================| 774 kB 00:00 rhel-debug: ################################################## 2223/2223 Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package dasher.i386 0:4.2.0-2.el5 set to be updated --> Finished Dependency Resolution
Dependencies Resolved
============================================================================= Package Arch Version Repository Size ============================================================================= Installing: dasher i386 4.2.0-2.el5 rhel-debuginfo 6.0 M
Transaction Summary ============================================================================= Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s)
Total download size: 6.0 M Is this ok [y/N]: y Downloading Packages: (1/1): dasher-4.2.0-2.el5 100% |=========================| 6.0 MB 00:05 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186 Importing GPG key 0x37017186 "Red Hat, Inc. (release key) <security@redhat.com>" from
http://10.155.2.75/Server/RPM-GPG-KEY-redhat-release Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: dasher ######################### [1/1]
Installed: dasher.i386 0:4.2.0-2.el5 Complete! |
安装yum原因主要是因为上次配置cacti服务器,对rpm安装包依赖关系的郁闷。Yum还可以基于ftp和本地文件的方式安装,基本大同小异,时间有限,就没有安装,特别感谢http://www.itqun.net/content-detail/143537.html