2006-05-19, 11:26 AM
Hi everyone,
Hope this is not a repeat... but I have not seen too many posts about CentOS, which currently is my linux of choice.
I wanted to post to explain how to add additional "yum repositories" so that you can get additional software installed that would not necessarily be included with your OS. This is especially important for RHES or CentOS since they take the minimalist approach with many things, as only the core functionality programs and applications are built in.
I use CentOS which is the "Community Enterprise OS" that is basically the latest version of Redhat Enterprise linux, but you don't have to buy it. They rebrand to take out all the redhat stuff, but it's just as compatible as RHEL and usually a little closer to cutting-edge than redhat (iirc, RedHat Enterprise Linux 4 maint release 2 just went to the 2.6 kernel! Talk about behind the times!!)
My problem was that I was used to how my previous OS of choice (back then it was Mandrake 9.1, which I can credit with increasing my knowledge and interest in linux over the years) but when I moved up to a more-current OS like CentOS, some of the applications that I grew to love and use every day were just plainly not present. This almost caused me to go back to mid-evil times and revert to Mdk91, but I was determined to find out another way.
In comes YUM. Yum is a revolutionary tool that simplifies the age-old problem with RPM-based redhat-derived distros. Back in the old day, if you wanted to install an RPM, lets say xmms, you would find it online or on the distro cd's, then run something like "rpm -Uvh xmms-version.rpm" ... but rpm was so stupid, it then would snap back at you and complain that you didn't realize that you also needed to install certain other required multimedia programs that xmms depends on. Well my friends, yum solves this issue. Yum is similar to apt-get, and freebsd's "ports" collection in that it figures out what dependancies are required, and also installs them automatically after asking you first. It greatly simplifies the process of getting more software onto your machine if your distro doesn't have it "out of the box".
Anyways... I searched around the net and found the "dag" repository of third party apps.
** Keep in mind, if you install these apps on an enterprise-grade server, you will potentially open up the possibility to make this machine less secure. This is why Redhat/Cent does not include these apps, so be careful! **
Here's the steps I followed:
1. Import the GPG authenticity key into your machine's local repository. This will ensure that if anyone tampered with the packages after they were posted on the third-party website, that would mean that the checksum (gpg key) would fail, thus forcing the rpm to NOT INSTALL on your machine and saving you from potential problems!.
Code:
sudo rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
2. Add the following to /etc/yum.conf, at the bottom where it says "# PUT YOUR REPOS HERE "
Code:
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[dag]
# be sure to import RPM GPG key first!
# sudo rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
name=Dag RPM Repository for CentOS
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
3. Run "sudo yum update" to get the latest repository database onto your machine.
Now is the easy part. You can search for apps that you want to selectively install! For example, I love the x-windows system monitor called "gkrellm". Here's a screenshot of what you can do with gkrellm:
Pretty cool, eh?
Ok then... all you do is the following:
1. Search for a partial text match of your app that you want to install:
Code:
# yum search gkrellm |more
Searching Packages:
Setting up repositories
Reading repository metadata in from local files
gkrellm-daemon.i386 2.2.4-0.2.el4.rf dag
Matched from:
gkrellm-daemon
This contains only the gkrellm daemon, which you can install on its own on
machines you intend to monitor with gkrellm from a different location.
http://www.gkrellm.net/
gkrellm-wireless.i386 2.2.4-0.2.el4.rf dag
Matched from:
gkrellm-wireless
http://www.gkrellm.net/
gkrellm.i386 2.2.4-0.2.el4.rf dag
Matched from:
gkrellm
GKrellM charts SMP CPU, load, Disk, and all active net interfaces
automatically. An on/off button and online timer for the PPP interface
is provided. Monitors for memory and swap usage, file system, internet
connections, APM laptop battery, mbox style mailboxes, and cpu temps.
Also includes an uptime monitor, a hostname label, and a clock/calendar.
http://www.gkrellm.net/
#
Then to install, just run this:
Code:
sudo yum install gkrellm
Setting up Install Process
Setting up repositories
dag 100% |=========================| 1.1 kB 00:00
dell-software 100% |=========================| 951 B 00:00
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 1.5 MB 00:06
dag : ################################################## 4377/4377
Added 10 new packages, deleted 0 old in 5.76 seconds
primary.xml.gz 100% |=========================| 22 kB 00:00
dell-softw: ################################################## 91/91
Added 26 new packages, deleted 26 old in 0.13 seconds
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for gkrellm to pack into transaction set.
gkrellm-2.2.4-0.2.el4.rf. 100% |=========================| 12 kB 00:00
---> Package gkrellm.i386 0:2.2.4-0.2.el4.rf set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
gkrellm i386 2.2.4-0.2.el4.rf dag 718 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 718 k
Is this ok [y/N]:
from here, verify it looks okay... sometimes packages have dependancies that yum would figure out that you would need to also download (automatic) and they would also appear in the above list.
Just answer Yes if you're ready to install...
Code:
Is this ok [y/N]: y
Downloading Packages:
(1/1): gkrellm-2.2.4-0.2. 100% |=========================| 718 kB 00:07
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: gkrellm ######################### [1/1]
Installed: gkrellm.i386 0:2.2.4-0.2.el4.rf
Complete!
Similarly, if you also wanted to install the gkrellm-wireless from the list above, you could run yum again to install that program and it would download and install that 'extension' to gkrellm for you as well.
I personally used YUM with the method above to install some of my favorite apps to my CentOS distro, which include but are not limited to... gkrellm, vim-X11, pine (call me oldskool), xmms, xmms-skins, snort, lbreakout2, and a few others I can't remember right now. The best part is that if you use the "yum search *searchstring*" command, you can see the available packages that yum knows how to get and download all automatically for you!
The best part about yum, is lets say that gkrellm is great and all, but some hacker finds a bug and exploits it and you feel vulnerable. Well, just a simple "yum update" after you had installed a while back these additional programs, and any new releases (for example, the bugfix release of gkrellm could be gkrellm-2.2.4-0.3 from the above example) will automatically get upgraded and patched, with no recompiling or any dirty work on your end. That's what I love best. I run yum update once a month usually to keep all my software up-to-date.
Hope this tutorial was useful to some of you. My goal on here is to both share my knowledge to others, as well as learn a few tips-and-tricks along the way as well!!
--zepcom