Software management in openSuse 10.2
Материал из RSU WiKi
Содержание |
Software management in openSuse 10.2: Yast, rug, zypper and yum
December 11th, 2006 — liquidat
There are several ways to manage software with the new openSUSE 10.2. Here is a short overview dealing with the different possibilities and showing each time how to add an additional installation source.
Yast
The easiest way is to use the graphical application Yast. It can handle all your software management, can resolve dependencies, check for updates and even use mirrors on the fly because Novell is using a dynamical referrer on the main download address.
If you want to add another source to openSUSE’s Yast, you have to click Software and there start the modul “Installation Source”. There you will find a list of all currently configured package repositories - and the button “Add” to add another one. Click on the button and choose the protocol you want to use (usually http or ftp). After that, enter the source line into the first field. As an example you can use this line: software.opensuse.org/download/GPhoto/openSUSE_10.2. In general you can add any address pointing to a directory where Yast can find a repodata sub directory. You can find quite a lot of repositories especially for openSUSE at the openSUSE build service project. Browse their repositories here.
rug
rug is a command line application to access zmd. zmd is the basic daemon dealing with package management in openSUSE, while rug is just passing arguments to zmd and reporting if it worked or not. zmd will do the real stuff (like actually fetching packages and installing them, and so on).
The basic commands are:
- rug install boo - installs package boo
- rug remove boo - remove package boo
- rug search boo - search package boo
- rug update - updates the system
- rug --help - get more information
Surprising… However, things get a bit more difficult if you want to add another source. For example you now want to add the Banshee repository http://software.opensuse.org/download/Banshee/openSUSE_10.2/ you have to enter
rug service-add --type=zypp http://software.opensuse.org/download/Banshee/openSUSE_10.2/ Banshee
The type is zypp, don’t think about it. The URL is also clear, the last part is just some kind of name you have to hand over. But, if you now call rug catalog you see that you haven’t subscribed to it: for rug a catalog can also contain a set of different repositories, so you have to subscribe explicit:
rug subscribe Banshee
There you are.
Interesting in this case is that zmd and Yast are kept synchronised: if you add a repository in Yast it will appear in zmd and vice versa. That is not the case with all methods introduced here!
Btw., rug is much more powerful than mentioned here - you can do all kinds of stuff, but I only want to give a first introduction.
zypper
zypper is yet another easy to use command line application to manage software - it can also be synchronised with zmd (and therefore with Yast) - but it does not require it. So if you don#t like zmd you can savely use zypper.
Here are the basic commands:
- zypper in foo - installs package foo
- zypper rm foo - removes package foo
- zypper se foo - searches for foo
- zypper up - updates the system
- zypper --help - more information
In this case if you want to add another repository, like additional KDE ressources from http://software.opensuse.org/download/KDE:/KDE3/openSUSE_10.2/, just enter:
zypper sa http://software.opensuse.org/download/KDE:/KDE3/openSUSE_10.2 KDE
Again, the last part is just some name you can chose.
zypper will warn us that it will not synchronise with Yast or zmd, but you can check in rug or Yast that it indeed has been synchronized. I’m not sure what this warning is about…
yum
There are already enough possibilities to manage the software in openSUSE. However, people coming from Fedora Core or previous Suse versions might prefer yum. It also provides an API to attach plugins which extends the possibilities of yum. The basic syntax is here again “surprising”:
- yum install foo - install package foo
- yum remove foo - remove package foo
- yum search foo - search for package foo
- yum update - update the system
- yum --help - get more information
The main problem is here that there is currently no way to just integrate the source lines like I showed it with all the other tools - you have to write a small configuration file for each repository. These configuration files are stored in the directory /etc/yum.repos.d/ and have the file extension .repos.
But at least in case of the openSUSE build service you find these repo-files already prepared - therefore you can just enter
cd /etc/yum.repos.d/ wget http://software.opensuse.org/download/GNOME:/Community/openSUSE_10.2/GNOME:Community.repo
if you want to add the GNOME community built packages of the openSUSE build service. In case of repositories where no repo-files are provided, check the other provided files how they are made up, it’s not difficult. You can find an explanation also in my howto about yum and Suse 10.1.
Important to know is in this case that yum is not synchronized at all - if you use and configure yum nothing of this configuration appears in Yast or zmd or zypper or anywhere else.
And: if you want to use yum in openSUSE 10.2, you have to install it first with Yast, rug or zypper :)
apt
Especially people coming from Debian or Ubuntu will be used to apt - and they can continue using it. But, and that is very important: Suse ships a very old version of apt-rpm! While the newest apt-versions support XML package metadata, which is the metadata kind Yast, yum, rug and zypper support as well, the apt-version shipped with openSUSE 10.2 still needs its own kind of repository metadata. That means with this apt version you can not just use the other provided repositories.
That’s very unfortunate and completely unnecessary :( But since only these people should use apt who are already used to it there is no need for me to explain the setup and the usage.
Must-have repositories
A last word about must-have repositories: the auto-configuration of openSUSE just configures the update repository. However, it makes sense to also configure the complete openSUSE 10.2 installation repository as well as the the non-OSS repository (RealPlayer, Acrobat, firmware, flash, etc.) and the packman repository. With such a configuration you don’t have to use your DVD anymore, and you can just install anything by a click.
So here are the repositories I suggest. Install them with your favourite tool as described above.
- http://download.opensuse.org/distribution/10.2/repo/oss/suse/ - this is the main installation source and provides all the packages which are also on the DVD
- http://download.opensuse.org/distribution/10.2/repo/non-oss/suse/ - the non-OSS repository, providing firmware, flash and other stuff
- http://ftp.gwdg.de/pub/linux/misc/packman/suse/10.2/ - the famous packman repository, providing all software which has non-free or problematic licenses; you might want to change the address to another mirror
- More repositories besides the already above mentioned can be found at the openSUSE build service and here. Make sure you are using the address which has the repodata sub directory.
Last words
This howto just gives a first impression about the choices you have to manage your software. Each tool also can do much more than here mentioned - apt-pinning, yum plugins, rug rpm rollbacks, and such stuff. See for yourself which one fits you best - since they all (except apt) use the same kind of repository metadata you do not have to wait for someone else to provide a tool specific repository.

