[Howto] Setting up yum on SUSE LINUX 10.0

Update (2006-05-25)

This text refers to Suse 10.0 – if you are searching for yum support on Suse Linux 10.1, look at the new howto: yum on Suse Linux 10.1. There you will also find additional information about yum like how to add yum-plugins and what they can be used for.

This howto about Suse 10.0 and yum is no longer maintained since I do not even have a working Suse 10.0 anymore. Howevers, since this article is the most successfull I’ve ever written I updated something: originally there was no update repository provided for yum for Suse 10.0. Due to a bug report I filled in the Novell folks added it (thanks!) and I’ve added this information here. But: this is not tested, so if you use it, please let me know if it works! If you run into any problems, post them here, I will try to help as much as I can!

The original, unchanged posting

After thinking, testing and writing so much about SUSE LINUX 10.0 I want to write a short Howto about it in english, too.

If you want to know more, have a look at the yum article in the german susewiki, it is much more detailed. Maybe there will be a translation in the future in the english wiki, too?

But now, let’s start:


Why should I use yum and not yast? Well, yast is nice, but has some disadvantages: It can’t check for gpg keys, you have to trust the mirrors you add. And, speaking about mirrors, yast has no real mirror management for one source. Especially in these times the most and best known SUSE mirrors are very slow or just closed down, so you have to add other sources in yast. But yast needs your clicks when a mirror is not reachable, and if you enter several sources just as mirrors, it checks every single source – that takes quite a long time!
A last reason (which is not important know because SUSE LINUX has a ugly workaround) is that yast is not able to handle packages for different architectures – it can only install packages for one architecture.

The advantages of yum

As you can imagine, yum can do it better: yum can install packages with the same name but for different architectures (which could be important for x86_64 users who sometimes can only install x86_32 packages), and it can check for the gpg keys.
But, at the moment the most important thing: yum can handle mirror lists. So, if a server times out, is unreachable or whatever, yum will automatically switch to another server – on the fly, without any user interaction, without the need of a new synchronization to the new server, and so on.

The (actual) disadvantages of yum

In a perfect world yum gets the original pgpg key and the mirror list from the main server but uses server from this list to download all the package information and the packages. Fedora Core has this perfect world already, but there are no mirror lists for yum on the suse servers.
And in the perfect world all important servers and directories are configured to be used by yum (there must be a “repodata” directory with the important information). But at the moment there are only the most important direcotries supported: inst-source, inst-source-java, update, GM and packman (only on the main mirror). The supplementary directories are not supported.

A last thing: yum does not have a gui – but there are some good guis around. SUSE LINUX 10.0 provides kyum as a kde based gui, it’s nice enough to work with it 🙂

How to configure it

If you call yum, it first checks its configuration file /etc/yum.conf. This file was used to store repository information in former times, too, but with the newer yum versions you have the possibility (and you definitely should use this) to store all information about the repositories in /etc/yum.repos.d/.

A file in this directory looks like this:

name=SUSE LINUX 10.0 - Base

The first option shows the name – this must be unique because yum uses it to identify the repository and the cached data about it.
The second option, the name field, is for the user to know what he has configured.
baseurl gives the server and the directory where yum can find the packages. This is similar to the address of yast configured sources. But in this case its commented out because we use a powerfull feature: the often mentioned mirrorlists!
The url to the mirrorlist is part of the field mirrorlist – due to the fact the no server provides them, we have to make our own. I will show some mirrorlists later.

The other options are dealing with the actual status of the repository (if it is enabled and yum should use it, or not) and with the gpg key.
There are a lot of other options to specify, like excluding or including special packages, and so on, but we do not need them yet. Check the manpage or the given link to the susewiki or drop a note or contact me or whatever, if you are more interested.

Some useful repos and mirrorlists

Because of the fact that yum does not come preconfigured with SUSE, you have to do all by yourself (except the configuration of yum.conf).

I picked up the repositories and directories I use and which already supporting yast, and wrote my own mirror lists, which are locally stored in the same directory. So, greb these files, copy them to /etc/yum.repos.d/, check them (or believe that I am not evil), and start playing with yum.

The files:

How to use

There is a lot of information around how to use yum – the most important commands are listed here:

  • yum install foo – install package foo
  • yum remove foo – remove package foo with dependencies
  • yum search whatever – search for this string
  • yum update foo – update only package foo
  • yum update – update the whole system
  • yum info foo – give the infos about this pacakge
  • yum provides foolibrary – which pacakge has this library?

Extra: using local repositories

If you have a special repository which you really like, but which does not support yum, you can use a trick: make a local copy of the files via rsync or whatever, and use the directory of the files as a local repository:

You will need the small programm createrepo for this – you can get it – sure – with yum:
yum install createrepo

After this, copy all the rpm-files you want to use to a special place:

mv *.rpm /var/cache/myrepo
createrepo /var/cache/myrepo

In /var/cache/yum/myrepo will appear a new directory called repodata. Now place the *.repo file in /etc/yum.repos.d/:

name=my cool repo

The really cool people will use cron-jobs for synchronizing and the new creation of the repo-files – do it, if you like it. But I hope that the most SUSE-dealing repositories and directories will offer yum repodata soon. Or that yast will change its backend 😀

I hope this howto helped at least one person – if this is the case, please drop a note, it’s always nice to get feedback besides the counter.

So: Have fun with yum on SUSE LINUX 10.0 🙂

This text is published under GFDL 1.2


11 thoughts on “[Howto] Setting up yum on SUSE LINUX 10.0”

  1. What about apt4rpm? I think, that SuSE 10.0 has apt repositories fully working now. I heared that apt can not work with multi architectures i386/x86_86/PPC – is it true? My opinion is that apt is much better than yum but if apt can not solve 32/64 bit problem, Yum is the winner :'(. I feel, that apt is more supported by SuSE comunity that yum, but what in the future?

  2. Ok, I will be completly honest: there is now reason for my why I should use apt. Compared to all other solutions, apt is always (!) on one of the last places:

    * apt ist not capable to handle mirror lists – yum and smart are!
    * apt is not capable of solving the mentioned 32/64 problem, yast neither, yum can (don’t now about smart yet)
    * apt has no variables in the “sources” lists – yum has

    If you think apt is so much superior: why should it be? Everyone says, but noone (!) has ever shown any real reason. Ok, yum is a little bit slower in the first step, because it does not cache the repository data normally, but that’s all? You prefer some seconds over the possibility to change download mirrors on the fly, while you are downloading? Sorry, but that argumentation is not honest… :-/

    About future: As far as I got it apt4rpm has no development at the moment. But smart, which is developed by a former apt4rpm developer, has a ongoing development (yum, too, btw).
    So it looks like that SUSE will drop apt4rpm as a tool, but will use the repository data for smart (smart can handle apt, yum, urpmi and other repositories).

    The community will try to continue supporting apt, the same happened with Fedora Core, but when the distros leave the dirty hack they all use at the moment to avoid the 32/64 problem, then no one can continue using apt (or yast, btw. – as far as I got it, they have to change some code in yast for this…).

    Just guessing: you can continue using apt for the next few months, maybe a year or two, the community will try to support it as long as possible, I think. But as I said: I do not see any reason why I should use it…

    There was a post at the suse mailing list, but I do not find it again, sorry :-/

    But in any cases: good luck with your solution, the most important thing is, that it works for you in a good way 😉

  3. Dear Liquidat!
    Thank you very very much for this mirror list! That will make yum very powerfull! I was looking for sites with repodata for some time now, and I found your blog from a post-reply I made in the suse forum here:


    (answered by linux_learner)

    So, you can read there who I appreciate! I hope your mirror list can keep an eye on Brazil, if it is possible… I already configured my /etc/yum.repo/liquidat.repo



  4. Thank you for the note, and nioce to hear that the stuff is helpful for you 🙂

    But unfortunately I’m not longer using Suse Linux, and therefore not longer updating yum mirror lists for Suse – one reason was that Suse wasn’t as responsible as I hoped to the yum-mirror-list idea.

    But it should be quite easy to find new mirrors for the list – post them somewhere here in my blog or contact me with jabber, and I will add them to the yum mirror lists on my server. 🙂


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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.