Tyler Muth’s Blog

Technology with a focus on Oracle, Application Express and Linux

Linux Package Management – The “Smart” Way

Posted by Tyler Muth on April 20, 2007

Intro
Anyone who has ever worked with Linux has run into the RPM dependency nightmare. You simply want to install RPM x, but it requires y and y requires z (it gets worse, but I will leave it at that). Package managers such as UP2DATE, APT, and YUM have made this significantly easier by handling the dependencies for you. About a year ago, I stumbled upon the Smart Package Manager and my Linux experience has never been the same. Why I love Smart:

  • Smart can be configured with YUM, APT, UP2DATE, URPMI, directory of RPMs (and more) repositories
  • It handles package dependencies, even if it needs to pull packages from several different sources
  • It provides both GUI and Command Line interfaces

I’m a big Linux advocate, but my interest in Linux is really about the software I run on Linux, not Linux itself. I view Linux as a service that runs my software (mostly Oracle), and doesn’t get in my way. For me, any extra time I invest in configuring Linux is a waste. This post is all about spending less time messing with RPMs and more time with more important topics. This post is targeted at people running Linux in a development or demo environment (VMWare comes to mind), and NOT FOR PRODUCTION SYSTEMS. The 3rd party packages may invalidate your support agreements or de-stabilize your environment.

For this example, I downloaded Enterprise Linux (x86, 32-bit) from http://edelivery.oracle.com/linux It’s 100% source and binary compatible with Red Hat Enterprise Linux 4 and it’s free. Since it’s really RedHat 4, Update 4 with some bug fixes, we’ll point at those repositories, as well as some from CentOS 4.4. There are HowTos out there for many other distros, including Suse (my desktop distro of choice). For 64-bit EL, you’ll need to adjust all of the URLs and test, but the same concepts apply.

Run all commands from a bash shell as root. I’ve omitted all prompts and output to make copy-and-paste easier, so interpret each line as a new command.

Install Smart
mv /etc/yum.repos.d/ULN-Base.repo /etc/yum.repos.d/ULN-Base.repo.old # These repositories are not used
rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm # --httpproxy someproxy.com --httpport 80
yum install smart*

Add Local Repository
Copy all Enterprise Linux RPMs locally. In my case, they are on the host OS, accessed via VMWare shared folders at /mnt/hgfs/el-rpms. This will be our primary Smart channel. Make sure you adjust the path in this command based on the location your RPMs.
smart channel --add local-EL-rpms name="Oracle Enterprise Linux RPMs" manual=true type=rpm-dir path=/mnt/hgfs/el-rpms/ -y;

Add Remote Repositories
smart channel --add Dag-Wieers type=rpm-md priority=-5 baseurl=http://apt.sw.be/redhat/el4/en/i386/dag/ -y;
smart channel --add VA-Tech-Extras type=rpm-md priority=-5 baseurl=http://mirror.cs.vt.edu/pub/CentOS/4.4/extras/i386/ -y;
smart channel --add VA-Tech-Base type=rpm-md priority=-5 baseurl=http://mirror.cs.vt.edu/pub/CentOS/4.4/os/i386/ -y;
smart channel --add Dries type=rpm-md priority=-5 baseurl=http://ftp.belnet.be/packages/dries.ulyssis.org/redhat/el4/en/i386/dries/RPMS/ -y;
smart channel --add atrpms name="ATrpms Repository" type=rpm-md priority=-5 baseurl=http://dl.atrpms.net/el4-i386/atrpms/stable/ -y;

Notice I set the priority of all 3rd party repositories to -5, leaving the default priority of 0 for installed packages and the local RPMs. This will cause the UBL packages to take precedence whenever the same package is found in multiple places.

Command-Line Usage
Find all packages with PDF in their title
smart search pdf
Install the xpdf packge
smart install xpdf
Install a local or remote RPM, using the configured channels to fulfill required dependencies
smart install somefile.rpm
smart install ftp://someurl.com/somefile.rpm

Demo, Including GUI Usage
Click here for the full-size version
[splashcast GKBY3325TQ]

Advanced
If you are required to use a proxy server to access the internet, use the following commands to set the proxy server for smart (documented here):
smart config --set http-proxy=http://someproxy.com:80
smart config --set ftp-proxy=ftp://someproxy.com:80

9 Responses to “Linux Package Management – The “Smart” Way”

  1. Hamza said

    very cool indeed!! and timing is awesome since i am going to start working on a new linux vmware image starting next week. will be trying this out.

  2. Franco said

    IT’s since I started to play with PcLinuxOs that i’m enjoying easy package installations…😉

  3. Richlv said

    a note. for ftp proxy to be used, you need python-curl installed. otherwise smart will silently fail to use proxy, no mater you set the value to.

  4. Greg said

    I dont see a way to set a username and a password for the proxy? I take it no authentication is done.

    I have a problem with the suse and the proxy, because I cant see how to get suse to authenticate with NTLM instead of Basic (which is not enabled for the proxy – an MS-ISA server). Firefox does however work, I not sure what authentication method is used, so I thought maybe I could get Smart to work, because Yast uses the system defaults which dont work.

    Any help?

  5. That is another matter.
    Extrefox

  6. what a great site and informative posts, I will add a backlink and bookmark your site. Keep up the good work!

    I’m Out! 🙂

  7. findthailandhotels said

    There are some attention-grabbing closing dates in this article however I don’t know if I see all of them heart to heart. Theres some validity however I will take maintain opinion till I look into it further. Good article , thanks and we want more!

  8. I liked your article.

  9. mt2 said

    good very thanks ı love your blog because intelligent yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: