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 SUSE LINUX 10.0 base files
- some german mirrors for the base files
- the java files
- some german mirrors for the java files
- packman files
- packman mirrors, at this moment only the server in Bremen
- the GM files (proprietary stuff)
- some mirrors for this stuff
- the update files
- some mirrors for the update servers
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
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