yum on Suse Linux 10.1 [Update]

Since the blogpost “Setting up yum on SUSE LINUX 10.0” was the most successful article I’ve ever written I decided to continue the story with an article about the new version of Suse Linux, version 10.1. This time I added the update repository which was not provided last time I wrote the other HowTo. But sequential:

What and why?

yum is the “Yellow dog Updater, Modified” [(Homepage), (yum wiki), (Wikipedia)]. It is an command line application to manage rpm packages. It is comparable to urpmi, apt, smart (command line part) and yast (the software management part).
It is well known and much used in the Fedora/CentOS world and is therefore interesting for people migrating from some of these solutions. Additionally it is nice to handle and has some advantages over yast which make it also interesting for Suse users.

(Dis-)Advantages

The advantages of yum are quite a lot:

  • It can change to new mirrors on the fly out of a internet based mirror list.
  • Package signature tests, the keys can be downloaded from a given internet address.
  • It is capable of multi-arch support (interesting for x86_64 users).
  • It has a plugin api.

The first point is one of the strongest advantages: when your usual mirrors brakes down yum jumps to another one (chosen by chance) which make it very smooth to use the tool even if there are heavy problems with some of the main mirrors. It also balances the load on the servers.
The second one adds a tiny bit more of security – why not use it as long as it is available. The third one is something no other tool really supports at the moment (apt does not, for example; the apt-rpm port does at the moment in the newest version though!). It gives you the ability to easily install x86 pacakges on x86_64 machines.
And with the plugin api you can “pimp up” your package management, more about that later.

The disadvantage is that yum depends on XML Package Metadata. These metadata information have to be created for each repository. While this step is quite easy it is a step which has to be done since yast depends on its own repository format.
Since the XMLPM format is a kind of an standard already the main Suse repositories are provided with these so called “repodata”: Suse base, non-oss, updates and also packman have these repodata and can be accessed by yum. Other Suse yast repositories like the most project repositories are not yet supported, unfortunately. So you can use yum to manage the usual Suse stuff and also the “needed” stuff like packman, but the most suse projects and other additional repositories cannot be accessed by yum.

Update
Today all Suse repositories rely on the XML package metadata format. It became the standard format of all Suse software management tools, and therefore yum can use all repositories around today.

How to configure it – theory

The repository configuration files for yum are in /etc/yum.repos.d/. A file is called something.repo and should look like this (online version):


[base]
name=Suse Linux - Base Repository
#baseurl=http://download.opensuse.org/distribution/SL-$releasever/inst-sources/suse
mirrorlist=http://www.personal.uni-jena.de/~p1woro/suse-yum/suse-base.mirror
enabled=1
gpgcheck=1
gpgkey=http://download.opensuse.org/distribution/SL-$releasever/inst-source/pubring.gpg

The first line identifies the repository, the second line gives a human readable name, the third line, here commented out, is the path to the server which should be used, the fourth line provides a mirror list (which works instead of a direct server link), the fifth line says if this repo should be used, the sixth line activates the gpg signature checking, and the seventh line tells yum where to get the key.
A note: I use the variable $releasever here which makes the files usable on every Suse version, not only 10.1. But since Suse dropped the “OSS”-part of the name between 10.0 and 10.1 and not every repository named the directories in the right way these configuration files may or may not work with Suse 10.0. But they should work with Suse 10.2 and higher – if the name is not changed again in a strange way.

Other basic settings can be found in yum’s main configuration file: /etc/yum.conf. This is not interesting here, the defaults are ok.

How to set it up – reality

First: install yum somehow – one way would be to start the yast software management, and search it there, it is provided by Suse. The next step are the repositories: Since I already configured my system, all you have to do is to copy my files into the /etc/yum.repos.d/ repository. Unfortunately Suse/Novell does not provide a mirror list, so at the moment the system will use a mirror list saved at my university server. Keep in mind that I will not stay at the university forever, so these lists can disappear suddenly. If someone can host them for a long time, please drop a note. Also, if you want me to add other servers to the list, drop me note here at the comments or contact me on jabber.

One word about the packman repository: I deactivated the gpg signature test since they often had problems with this topic in the past, and a first test showed that not all packages are signed which causes yum to stop when the signature test is activated. If you have problems with specific packages for this repository, use the exclude function as mentioned above to avoid these packages, and check back a day or two later.

How to use it

The usual commands are pretty easy:

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

Experts, part one: personal repositories

If you want to provide your own repository or want to access a local repository for instance because you rsync data with a non-XMLPM repository, you have to create the necessary repository files. createrepo, which is again provided by Suse, will do this job. If you have already set up yum you can easily install createrepo with the command 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/:

[myrepo]
name=my cool repo
baseur=file:///var/cache/myrepo
enabled=1

Experts, part two: plugins

With plugins you can easily pimp up yum. Some examples are:

  • installonlyn which deletes the oldest kernel when a newer one is installed, making sure that there will be not more or less than n kernels installed.
  • fastestmirror to identify the fastest mirror so that only this one will be used for the repositories. This speeds up the download of packages without any interacting with you.
  • changelog which shows the changelog of every updated package before or after installing.
  • versionlock locks the version of specific packages.

There are other plugins, and since everything is documented it should be quite easy to write own plugins.

To use the plugins, first set the option plugins=1 in your /etc/yum.conf. After that, create the directories /etc/yum, /etc/yum/pluginconf.d and /usr/lib/yum-plugins.
Now you can download any plugin you want from the yum plugin page into the directory /usr/lib/yum-plugins. Each plugin file contains some information about configure options. These should be usually copied as a file to /etc/yum/pluginconf.d. For instance I have the file /etc/yum/pluginconf.d/fastestmirror.conf which contains:

[main]
enabled=1
verbose=0
socket_timeout=3
hostfilepath=/var/cache/yum/timedhosts
maxhostfileage=10

And it just works pretty nice. If you want to see it working, set the option verbose above from 0 to 1 – it will list all checked mirrors together with the times.

So, enjoy yum on your new Suse. Thanks to Suse/Novell for providing XMLPM for the main and most important directories and for providing the yum and createrepo binaries. And, of course, thanks to the yum duke project!

20 thoughts on “yum on Suse Linux 10.1 [Update]”

  1. Hi,
    when I’ve used YUM on Fedora, part of the setup process was importing the GPG keys from each repository. You did not mention this. So, it is not necessary.

    Thanks for this tutorial. I really like yum🙂

  2. It depends in a way what exactly you mean:
    The keys must be imported at least once – but since the keys are mentioned in the *.repo*-files it is not necessary to do anything manual, it can only be that you are asked if you want to important them or not.
    The same is true for each repository which uses own key files.

  3. Hmm,
    I’ve used yum to update once (it updated three programs) and I used it to remove a program, but it didn’t ask me if I wanted to import any keys.

  4. I do not remember, but in such cases the key is most likely already imported by the distributor – which is sensible and makes totally sense. So nothing to do for you🙂

  5. Thanks a lot, it really helped me with setting up yum… althought i use fedora as well and was just wondering… this repos are all the essentially neede or are there more repos to add… like say…livna and so on Fedora. Thanks!!!

  6. Good to here that it helped.
    About other repositories like livna: packman is already included in this configuration, and packman is similar to livna in the fedora world (well, at least in case of licensed programs – not in case of kernel modules). There is also the suse-nonoss repository included, which comes with programs like flash, realplayer, acroread, java and smartlink kernel modules.

    Other repositories which will be interesting in the near future will be these provided by the opensuse build server – but that’s still in alpha, so you have to wait a bit longer to really use that…

  7. Perfect! I was irritating myself on the not working yum. Now finnally it works. Thanks alot.

  8. Hey, thanks for providing mirror info. I really hope SuSE goes to yum (yast pretty much sucks coming from a former RH junkie). Any word on their plans in this area?

  9. The repositories seem to be pretty generic. Are there different repositories for different architectures (such as x86 and x86_64), or will I need to filter the packages?

  10. These repositories are the main repositories which are normally used to have a full functional system: the base repo and the update repo are the original SUSE repos, the non-oss is also a original suse repo, and packman comes along with all the software which is not allowed in suse.

    But you don’t have to care about x86 and x86_64 – the idea of yum is that it does this part automatically, and can even mix both architectures when there is the need to do so.

    Other repositories for suse are mentioned in the opensuse wiki. Additionally the opensuse build service is worth a look. See this posting with more information about the service.

  11. finally something i find familiar wit FC.
    Keep up The good work! I’m really thinking of migrating all my machines when this works good

  12. Thanks for doing such an effort in creating this very good article. But I’m having a question regarding the ability of using yum instead of the new zen package manager. Also coud you please provide us with more packages providers (.repo files) like packman that you can see that they have no problems or conflicts with other repositries.

    Thanks again for your help …🙂

  13. Well, first of all: you’re welcome, I hope that this article helps the people.
    But about the zen package manager: The only thing I can say is that I was, for me, able to replace the zpm with yum – I used yum only! The background is that both work with RPMs, and that the rpm-stuff itself is done by the rpm package manager itself, I think. The repositories they use are the same (they use the same metadata, etc.).
    But I cannot guarantee you anything:/

    About more repositories: the advantage in these days is that there is no difference between the repositories: the zen package manager can use the same repositories as yum – and vice versa. You can just add the zpm repos to yum, without any further effort. This only fails if you are adding old repositories which are still using the old yast format. zpm can also use these, but yum canot.

    I personally do not provide more repos because I do not use Suse currently, but Suse provides the opensuse build server, which has a large collection of new repositories:
    Build Server
    Check this one. Fortunately Suse finally fixed its mirror problems so you do not even need a server which provides you with mirror lists – just add the software.opensuse.org server as main server, the rest is done automatically by Suse🙂

  14. I have 10.1 Suse but can’t do updates.
    Zen fails with libgypp dependency probs.
    YOU fails by just shutting when I try to
    do an update.

    Where can I find YUM for Suse 10.1?

    I’ve used it on Fedora Core and it is a good
    tool.

    Thanks
    Jim

Comments are closed.