PDA

View Full Version : TLC #10: [RedHat Linux applications] - [Instaling and managing RPM files]


X-Calibur
27th May 2003, 22:36
Installing applications in RedHat is one of the thing you'll initially spend quite some time. Even if RedHat comes bundled with a heap of applications, there's always one you miss.

RPMs are "packages", you can call them "installers" just like in the "other OS" if you want. You may not find the latest versions in RPM format, so you still may need to install from source (we'll get to that later).

Where to get RPMs:

RpmFind.net (http://rpmfind.net/linux/RPM/)
FreshRPM (http://freshrpms.net/)


First, your new best friend is the rpm command. You must be root user to add or remove packages.Type man rpm for more info.

Modes of operation:
-i to install
-U to upgrade
-q to query
-V to verify the file changes
-e to uninstall
-b to build
-vv to print debugging information during install
-h to print 50 pound sign (#) as the package is installed
-percent like the above but with a number
--checksig to check the file signature
--rebuilddb to rebuild the database

Usage: (my prefered way)
rpm -ivh somepackage.i386.rpm
rpm -Uvh somepackage.i386.rpm
The -U way will install also if the package is not installed, so it's the best way to go IMHO. The rpm command will check for dependencies (that's other packages needed in order to run, remember, the beauty of Linux is that it is very modular, so you don't have to reinvent the wheel everytime you create an application) and then install itself. If there is a dependency you lack, just look for it and install it first. For example, when installing Xine a video media player there were 5 dependencies I lacked for sound mainly.
It can be used on any .rpm file, on hard drive, on CDRom, on ftp server.

Removing a package:
Bold way:
rpm -e somepackage
To verify first if this package is needed by some other program:
rpm -q --whatrequires somepackage

Making queries about packages:
rpm -qi packagename will list a lot of useful information about a package
There are quite a few others for you to try: -qa -qf -qR -ql - qd -qc

There, hope this helps. If you get RPM hang up, don't forget to check out TLC #8.

[Author] ::: X-Calibur
[Last update] ::: 03-10-2004 ; 28-05-2003 ; 27-05-2003

dnar
28th May 2003, 00:39
Cool. To find what apps are installed, but you have some idea, use:-
[wayne@Criten wayne]$ rpm -qa | grep python
python-optik-1.4-2
rpm-python-4.2-0.69
gnome-python2-gtkhtml2-1.99.14-5
gnome-python2-canvas-1.99.14-5
gnome-python2-1.99.14-5
python-2.2.2-26
gnome-python2-bonobo-1.99.14-5
mod_python-3.0.1-3
python-devel-2.2.2-26
rpm404-python-4.0.4-8x.27
libxml2-python-2.5.6-2

wylie
28th May 2003, 03:21
X - you forgot the next step - return to website to get the dependencies, then return again to get their dependencies :D


or do you just go "-nodep", you madman you! ;)

X-Calibur
28th May 2003, 11:44
Originally posted by wylie
X - you forgot the next step - return to website to get the dependencies, then return again to get their dependencies :D


or do you just go "-nodep", you madman you! ;)
Yeah I should clarify that. Thanks.

X-Calibur
28th May 2003, 11:54
Originally posted by dnar
Cool. To find what apps are installed, but you have some idea, use:-
[wayne@Criten wayne]$ rpm -qa | grep python
python-optik-1.4-2
rpm-python-4.2-0.69
gnome-python2-gtkhtml2-1.99.14-5
gnome-python2-canvas-1.99.14-5
gnome-python2-1.99.14-5
python-2.2.2-26
gnome-python2-bonobo-1.99.14-5
mod_python-3.0.1-3
python-devel-2.2.2-26
rpm404-python-4.0.4-8x.27
libxml2-python-2.5.6-2

I think I should do a little something about piping commands, it's really a useful invention.
rpm -qa | more
will display all the packages installed one page at a time (and there are a LOT of pages...!).
rpm -qa | grep someappname
will only show the packages containing someappname in thier name.
Did I mention I love this OS?

X'

X-Calibur
3rd October 2004, 09:05
And something more in the same train of idea

$ rpm -qa --qf "%-10{SIZE} %-30{NAME}\n" | sort -n >> installedRPMs.txt

Will dump the installed apps in the file imaginatively named installedRPMs.txt

Just a quick update for future reference.

X'