User Tools

Site Tools


linux:sysadmin:package_management

Package Management

yum

yum is the standard package manager on RHEL 5 and higher

yum basics

update

yum check-update
yum update

install

yum install <package name>

remove

yum remove <package name>

show installed packages

yum list installed [regex]

show packages available

yum list available [regex]

show packages with updates available

yum list updates [regex]

resolving dependency conflicts

yum clean all

…or the hardcore way

rm -rf /var/cache/yum/*

Which package provides a certain command?

Use “whatprovides” with yum. Below an example for the command “yum-complete-transaction” which takes part of “yum-utils”:

yum whatprovides "*/yum-complete-transaction[/i]"

Convert RedHat 5 64bit to Centos 5.6

See http://wiki.centos.org/HowTos/MigrationGuide

cp /etc/redhat-release /etc/redhat-release-saved
rpm -e --nodeps redhat-release-notes redhat-release yum-rhn-plugin redhat-logos
rpm -ivh \
http://mirror.centos.org/centos-5/5.6/os/x86_64/CentOS/centos-release-5-6.el5.centos.1.x86_64.rpm \
http://mirror.centos.org/centos-5/5.6/os/x86_64/CentOS/centos-release-notes-5.6-0.x86_64.rpm \
http://mirror.centos.org/centos-5/5.6/os/x86_64/CentOS/redhat-logos-4.9.99-11.el5.centos.noarch.rpm
yum update

Convert CentOS 5 to RedHat 5

Remove CentOS specific rpm's

rpm -e --nodeps desktop-backgrounds-basic-2.0-41.el5.centos.noarch
rpm -e --nodeps redhat-logos-4.9.99-11.el5.centos.noarch
rpm -e --nodeps centos-release centos-release-notes

Install special RedHat packages (you have to download/copy the packages to the system first)

rpm -ivh redhat-release-notes-5Server-31.x86_64.rpm redhat-release-5Server-5.5.0.2.x86_64.rpm redhat-logos-4.9.16-1.noarch.rpm
rpm -ivh yum-rhn-plugin

Update

yum update

Siehe auch http://benste.blogspot.com/2010/07/migrieren-von-centos-zu-rhel.html

yum-utils

remove / clean old kernels

package-cleanup --oldkernels

remove unused / old packages

package-cleanup --cleandupes

finish uncompleted transactions

yum-complete-transaction

cleaning up unfinished transaction journals

yum-complete-transaction --cleanup-only

up2date

up2date is the standard package manager until RHEL 4

List Updates available from redhat network:

up2date -l

Install available updates (without kernel updates):

up2date -u

Install updates and kernel updates (force):

up2date -uf

Show packages available from red hat network:

up2date --show-available

Search a package by name

The example searches all packages containing the word 'php'

up2date --show-available | grep php
php-4.3.2-40.ent.i386
php-devel-4.3.2-40.ent.i386
php-imap-4.3.2-40.ent.i386
php-ldap-4.3.2-40.ent.i386
php-mysql-4.3.2-40.ent.i386
php-odbc-4.3.2-40.ent.i386
php-pgsql-4.3.2-40.ent.i386

Install new packages:

up2date -i <package-name>

Configure up2date to use proxy

Configure up2date:

up2date --configure

Chose the following options:

  • enable proxy = Yes
  • http_proxy = webproxy.example.net:8080

Install new packages from red hat network (download, install):

up2date -di <package-name>

rpm

install a rmp package

rpm -i package.rpm

remove (erase) a rpm package

rpm -e package.rpm

install a source rpm package

rpmbuild --rebuild package.scr.rpm

search for a installed package (mysql)

rpm -q mysql

show all installed kernels

rpm -qa | grep kernel

Additional Repositories

EPEL

Extra Packages for Enterprise Linux (EPEL) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs such as CentOS or Scientific Linux.

Using EPEL packages on RHEL 5

Example install (x64 package):

rpm -Uvi http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-4.noarch.rpm

After installing the rpm above, you're able to manage EPEL packages over yum or up2date.

RPMforge Packages

Using third-party repositories, you can have the stable base of CentOS with more up-to-date packages (of course, it goes without saying that you sacrifice some of the stability that makes RedHat/CentOS so good by doing so!).

See the following links for installation:

RBEL Packages

For chef, ruby 1.9.2 and nginx for CentOS 5/6 see here:

/srv/wiki.niwos.com/data/pages/linux/sysadmin/package_management.txt · Last modified: 2011/12/12 16:13 (external edit)