Author Topic: ลง yum on redhat 4 exterprise style golfreeze  (Read 9945 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ลง yum on redhat 4 exterprise style golfreeze
« on: มกราคม 24, 2011, 11:41:16 AM »
วันนี้ ลองลง yum ดูครับใน redhat 4 enterprise

ก่อนอื่นต้องมี package เหล่านี้ ก่อน

เราต้องโหลดไฟล์มาก่อนครับ ข้อควรปฏิบัติ ควรใช้ ให้เหมาะสมกับ python ที่รองรับ ใน os version นั้นๆ
ด้วยน่ะครับ

Install all the rpms:
rpm -Uvh {all rpm files}

The packages I used are:
yum-2.3.3-1.src.rpm
python-urlgrabber-2.9.6-1.src.rpm
python-sqlite-0.5.0-1.2.el4.rf.i386.rpm
python-elementtree-1.2.6-1.2.el4.rf.noarch.rpm
sqlite-2.8.16-1.2.el4.rf.i386.rpm
python-celementtree-1.0.2-1.2.el4.rf.i386.rpm

สำหรับพวกที่เป็น src.rpm ต้องมา จัดการโดย build มันก่อนครับ ให้มันมีอารมณ์ เหอๆ
#rpmbuild --rebuild {source-rpm-file}

ไฟล์ต่างๆ ผมหาโหลดจากเว็บนี้ ครับ มีครบเลย สำหรับตระกูล แพนกิล

http://dag.wieers.com/rpm/packages/

ลุยเลย

golfreeze[at]packetlove.com

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ลง yum on redhat 4 exterprise style golfreeze
« Reply #1 on: มกราคม 24, 2011, 11:41:28 AM »
วันนี้ มี ทริปเรื่องการใช้ งาน tool ในการลง package มาฝากเพื่อนๆ ครับ

เริ่มตั้งแต่ tool ที่ใช้กับ CentOS และ Redhat Enterprise version ต่างๆ น่ะครับ

ซึ่ง tool มีตั้งแต่ Yum , up2date , apt-get สำหรับตัวที่ผมชอบใช้ก็ คือ yum ครับ สำหรับการติดตั้ง
ก็อย่างข้างบน และสำหรับ การลง link นั้นก็คือ
เราต้องหา link ที่เขาเปิดให้เราไป update package มาไว้ในเครื่องครับ ซึ่งเป็นหลักการ ของการ round
robin คล้ายๆ apt-get ใน debian นั่นเอง

เริ่มต้น ก็

#cd /etc/yum.repos.d

สร้างไฟล์ สักตัวขึ้นมา ลงท้ายด้วย .repo

#vi list.repo

ใส่ค่า ในไฟล์ดังนี้ครับ

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.centos.org/centos/4/os/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#released updates
[update]
name=CentOS-$releasever - Updates

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror.centos.org/centos/4/updates/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://mirror.centos.org/centos/4/addons/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror.centos.org/centos/4/extras/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

baseurl=http://mirror.centos.org/centos/4/centosplus/i386/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror.centos.org/centos/4/contrib/i386/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

----------------------------------------------------------------------------------------

ถ้าใครใช้เป็น RHEL5 ก็เปลี่ยน 4 เป็น 5 ด้วยน่ะครับ
แล้วก็ ให้มัน update และลง package ใหม่ โดย
#yum update

ทำการค้นหา package ดังนี้
#yum search

ทำการ update เฉพาะ package xxx ก็
#yum update xxx*

อิอิ
golfreeze[at]packetlove.com

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ลง yum on redhat 4 exterprise style golfreeze
« Reply #2 on: มกราคม 24, 2011, 11:41:38 AM »
How to Install Source RPMs

Sometimes the packages you want to install need to be compiled in order to match your kernel
version. This requires you to use source RPM files:

* Download the source RPMs or locate them on your CD collection. They usually have a file
extension ending with (.src.rpm)
* Run the following commands as root:

Compiling and installing source RPMs with Fedora can be done simply with the rpmbuild command

[root@bigboy tmp]# rpmbuild --rebuild filename.src.rpm

Here is an example in which we install the tacacs plus package.

[root@bigboy rpm]# rpmbuild --rebuild tac_plus-4.0.3-2.src.rpm
Installing tac_plus-4.0.3-2.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.61594
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf tac_plus-4.0.3
+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/tac_plus-4.0.3.tgz
+ tar -xvvf -
...
...
...
+ umask 022
+ cd /usr/src/redhat/BUILD
+ rm -rf tac_plus-4.0.3
+ exit 0
[root@bigboy rpm]#

The compiled RPM file can now be found in one of the architecture subdirectories under
/usr/src/redhat/RPMS directory. For example, if you compiled an i386 architecture version of the RPM
it will placed in the i386 subdirectory.

You will then have to install the compiled RPMs found in their respective subdirectories as you
normally would.


RPM Installation Errors

Sometimes the installation of RPM software doesn't go according to plan and you need to take
corrective actions. This section shows you how to recover from some of the most common errors
you'll encounter.


Failed Dependencies

Sometimes RPM installations will fail giving Failed dependencies errors which really mean that a
prerequisite RPM needs to be installed. In the next example we're attempting to install the MySQL
database server application, which fails because the mysql MySQL client RPM, on which it depends,
needs to be installed beforehand:

[root@bigboy tmp]# rpm -Uvh mysql-server-3.23.58-9.i386.rpm
error: Failed dependencies:
libmysqlclient.so.10 is needed by mysql-server-3.23.58-9
mysql = 3.23.58 is needed by mysql-server-3.23.58-9
[root@bigboy tmp]#

Installing the MySQL client also fails because it requires the perl-DBD-MySQL package.

[root@bigboy tmp]# rpm -Uvh mysql-3.23.58-9.i386.rpm
error: Failed dependencies:
perl-DBD-MySQL is needed by mysql-3.23.58-9
[root@bigboy tmp]# rpm -Uvh perl-DBD-MySQL-2.9003-4.i386.rpm
error: Failed dependencies:
libmysqlclient.so.10 is needed by perl-DBD-MySQL-2.9003-4
[root@bigboy tmp]#

Strangely enough, the installation of the perl-DBD-MySQL package fails because it needs the mysql
client package. To get around this problem you can run the rpm command with the --nodeps option to
disable dependency checks. In the next example we install the MySQL client ignoring dependencies,
followed by successful installation of perl-DBD-MySQL and mysql-server.

[root@bigboy tmp]# rpm -Uvh --nodeps mysql-3.23.58-9.i386.rpm
Preparing... ####################### [100%]
1:mysql ####################### [100%]
[root@bigboy tmp]# rpm -Uvh perl-DBD-MySQL-2.9003-4.i386.rpm
Preparing... ####################### [100%]
1:perl-DBD-MySQL ####################### [100%]
[root@bigboy tmp]# rpm -Uvh mysql-server-3.23.58-9.i386.rpm
Preparing... ####################### [100%]
1:mysql-server ####################### [100%]
[root@bigboy tmp]#

Note: If all the installation RPMs are located in the same directory, the rpm command can
automatically install all the prerequisite RPMs using the --aid option. One of the advantages of
using the yum facility is that you don't have to worry about this dependency process as much
because the dependency RPMs are always downloaded and installed automatically also.
Signature Keys

Fedora digitally signs all its RPM files, so it's best to import their public encryption key
beforehand so that the RPM installation program will be able to verify the validity of the RPM
file.

This is usually done automatically in newer versions of Fedora, but will need to be done manually in
legacy versions. The manual method uses the rpm command as seen in the next example, but locate the
key files first as their locations can vary between Fedora distributions. It is a good idea to
import both the RedHat and Fedora keys:


[root@bigboy tmp]# locate RPM-GPG-KEY
/usr/share/rhn/RPM-GPG-KEY
/usr/share/rhn/RPM-GPG-KEY-fedora
[root@bigboy tmp]# rpm --import /usr/share/rhn/RPM-GPG-KEY
[root@bigboy tmp]# rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora
[root@bigboy tmp]#

If you don't install the keys you'll get a DSA signature warning that alerts you to the fact
that the RPM file might be bogus:

[root@bigboy tmp]# rpm -Uvh dhcp-3.0pl2-6.16.i386.rpm
warning: dhcp-3.0pl2-6.16.i386.rpm: V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing... #################################### [100%]
1:dhcp #################################### [100%]
[root@bigboy tmp]#

It is always good to install the key files. If they are not there, the RPMs will install with only a
warning message. If the RPM's digital signature doesn't match that in the key file, the rpm
installation program also alerts you and fails to install the RPM package at all:

[root@bigboy tmp]# rpm -Uvh dhcp-3.0pl2-6.16.i386.rpm
error: dhcp-3.0pl2-6.16.i386.rpm: V3 DSA signature: BAD, key ID 4f2a6fd2
error: dhcp-3.0pl2-6.16.i386.rpm cannot be installed
[root@bigboy tmp]#

Signatures are therefore useful because they help protect you against tampered and otherwise
corrupted RPMs being installed.

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ลง yum on redhat 4 exterprise style golfreeze
« Reply #3 on: มกราคม 24, 2011, 11:41:46 AM »
##Centos by yum

cd /root
wget -nd -vhttp://www.qmailtoaster.org/download/develop/clamav-toaster-0.93.1-1.3.19.src.rpm
yum install rpm-build
yum install bzip2-devel gmp-devel zlib-devel curl-devel libidn-devel
rpmbuild --rebuild --with cnt50 clamav-toaster-0.93.1-1.3.19.src.rpm
mv /usr/src/redhat/RPMS/i386/clamav-toaster-0.93.1-1.3.19.i386.rpm .
rpm -Uhv clamav-toaster-0.93.1-1.3.19.i386.rpm