MySQL DBA - Tips and Techniques Magazine

3 Oct 2014

RPM Based Package Management

DPKG command set and apt-get used by Debian/Ubuntu.


RPM and YUM used by  CentOS, Red hat, SUSE, Yellow Dog, Fedora


(Can convert using a tool called Alien).


 

RPM (Redhat Package Manager) is a package manager, but cannot resolve dependencies. 


YUM (YellowDog Update Modifier) is a frontend to RPM and can manage dependencies.

 

RPM Naming : package_name.versionnumber-buildnumber.architecture.rpm


Install YUM

               man yum  (for manual)

yum install wget

wget http://www.nano-editor.org/dist/v2.2/RPMS/nano-2.2.6-1.i386.rpm


Practise using rpm and yum

rpm -i nano-2.2.6-1.i386.rpm

But we already have a package called nano installed (whereis nano )

rpm -e nano    (extracts i.e. removes existing nano)

rpm -ihv nano-2.2.6-1.i386.rpm  (installs and shows progress but fails die to missing dependencies)

yum nano-2.2.6-1.i386.rpm    (works fine).

GET INFO

rpm -qi nano  - tells us the package name and details like install date

rpm -q --list nano    - all files installed with nano package

rpm -qR nano      -queries all Requirements i.e dependencies

rpm --rebuilddb   (cleans the rpm cache)

 

Global Configuration file for RPM is  in   cat /usr/lib/rpm/rpmrc   (don't need to change it)

tail /usr/lib/rpm/rpm.log    (shows wehre log file is)

vi /var/log/rpmpkgs  (can look at log file)

 

YUM Software Management

vi /etc/yum/yum.conf    - config file , can add new source repos here

 or in /etc/yum/repos.d   , each file is a separate repo that has sources.

INSTALL/UPDATE YUM

yum install

or yum update

CHECK FOR INSTALLED PACKAGE UPDATES

yum check-update

SEARCH

yum search http   (eg searching to install apache)

yum install http

yum check-update http

yum check-upgrade  (checks to see if yum needs upgrading)

yum info httpd.i686   (same as rmp qi)

yum deplist (dependency list)

can append --force , to force install even if dependencies are not there.

 

yumdownloader & rpm2cpio


yumdownloader--resolve  httpd (just download the rpm package and dependencies not install etc)


To view contents of the rpm use  the cpio  utility for std input and std output


rpm2cpio   package_name.rpm  |cpio -t       (converts rpm to std output (messy to read as its code), then the cpio -t lets us view it)

No comments:

Post a Comment