Package Management With Zypper
As I've mentioned before I'm an openSUSE user, and as long as they don't make the "U" lower case again, I'll probably stick with it. When it comes to package management, OpenSUSE and SUSE Linux Enterprice (and SuSE before them) are usually associated with YaST (and yes, I'm still waiting for them to upper case the "a"). YaST works well but it's a bit verbose for installing a single package, and of course that's just more fodder for the apt-getters with all their apt-get install this and their apt-get install thats. And you can't argue with them, but there are other options with openSUSE: yum and apt4rpm come to mind, but the preferred solution is zypper.
Zypper is a command line tool for package management, it's based on ZYpp, aka libzypp. The WikiPedia entry for Zypp says:
Unlike other common package managers, it provides a powerful satisfiability solver to compute package dependencies and a convenient package management API.
Since we don't want our heads to explode we'll just take it for granted that a powerful satisfiability solver is a good thing.
It turns out that YaST is also (now) based on ZYpp so you don't need to worry that you're missing out on something by using zypper.
Zypper is fairly straightforward to use. If you want to search for a package do zypper search STRING.... The STRING(s) can include * and ? wildcards and there are options for matching all or any of the strings and for full exact matches (the default is a partial match). If you want to search the package descriptions there's an option for that also. For example to search for packages with the word "mail" in the name or in the description do:
$ zypper search --search-descriptions mail
$ # --search-descriptions can be abbreviated as -d
Reading installed packages...
S | Name | Summary | Type
--+----------------------+----------------------------------------+-----------
| Buddi | Buddi - Personal budget software ... | package
| CgEddie | A simple editor with syntax high ... | package
| FrostWire | Gnutella peer-to-peer (P2P) file ... | package
...
i | yast2-mail | YaST2 - Mail Configuration | package
| yast2-mail-plugins | YaST2-Users/Group Plugins for the ... | package
| yum-updatesd | YUM update notification daemon | package
When installing packages with zypper, as you'd expect/hope, zypper takes care of installing the package's dependencies:
$ zypper install Buddi
Reading installed packages...
The following NEW packages are going to be installed:
BrowserLauncher2 swingx Buddi jcommon jfreechart
Overall download size: 4.1 M. After the operation, additional 5.2 M will be used.
Continue? [YES/no]:
Some of the other interesting commands that zypper supports are:
- refresh - to refresh the package information from the repositories you have defined.
- addrepo - to add a new repository.
- remove - to remove a package.
- list-updates - to list the updates/patches that are available for the packages you have installed.
For a full list of the commands that zypper supports type zypper help and check the man page for more details.
One of Ubuntu's WOW factors seems to be apt-get dist-upgrade, i.e. the ability to upgrade to the next version of Ubuntu (and actually it's a feature of any debian based distro). This is another thing that the apt-getters puff up about, well enter zypper dist-upgrade or zypper dup. This allows you to upgrade from one version of openSUSE to the next. I have not used this feature yet, but posts on the openSUSE wiki seem to indicate that it works well.
So to all you apt-getters out there, all I can say is: zypp it.
.png)
Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
Submitted by Mitch Frazier on Thu, 2009-11-05 09:05.
Delicious
Digg
StumbleUpon
Reddit
Facebook
So, if it's so great...
So, if it's so great, how can I take it for a spin on Ubuntu? :)
Try this
If that doesn't work try different combinations of upper and lower case for "suse" in the package name.
__________________________Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
try zypper moo and you get a
try
zypper moo
and you get a porcupine :D
Thanks
That's nice:
__________________________Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
"powerful satisfiability solver"
The "powerful satisfiability solver" is because ZYpp is based on this paper from the University of California, San Diego: http://cseweb.ucsd.edu/~lerner/papers/opium.pdf.
You can see in it that the dependency solver of ZYpp is *perfect* while APT makes errors.
Nice article
Very nice article. I'm an apt-getter but I loved the last line, " So to all you apt-getters out there, all I can say is: zypp it." :)
Zypper
Thanks for this article. I first learned apt-get so that is what I'm most comfortable with and never really liked rpm. Zypper looks like it's pretty strait forward. Maybe it's time to give openSuse another try
It's not the same
The apt-get system has years of development. You can't compete with that.
I used ancient RH rpm, medium-ancient RH with up2date, yum enabled distros, etc. My laptop now runs openSUSE with yast and zypper (KDE fan here! Good job in 11.2!).
apt-get/dpkg/deb beats everything by miles. There's package/repository pinning, there's dist-upgrade, debconf with text and GUI frontends for package configuration... I can't even think of everything now.
You can install gnome-desktop with 1 command and remove it with all with 2 commands. And it's easy to use!
Don't get me wrong. I hope zypper gets there soon, but meanwhile it's better to wait, explain how to use and avoid comparing with the "Lion King" :-)
The Lion King is not a Real Animal
Zypper can install groups of packages also, they're called patterns:
So, let me say it one more time: zypp it.
__________________________Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
zypper then is much faster then YAST/YAST2
Hey guys,
I have been using "zypper" quite some time now. The most noticeable difference I found that (as with every comma nd line app),it(zypper) is much faster then his gui cousin.
Off topic:
"emerge" ,the gentoo package manager is the very best of all breed. Am I biased??? hope certainly not. :)
Thanks
Bhaskar
install an older version
Hiho,
have you ever installed an specific version from one package in a repository?
yum install my-package-0.0.1-0
apt-get install my-package=0.0.1-0
zypp it ^^
zypper in -C (--capability)
zypper in -C (--capability) packagefoo=2.4.0rc3-0.pm.1
Like this?
Repo Priorities
I love zypper as well. It seems to be almost, if not more, complete package manager than apt.
One very cool feature of zypper the ability to priorities your repos. Priorities allows you to install packages from a preferred repo, even though it is lower in version number. With the openSUSE Build Service, you can end up with a long list of repos. (I'm sure Ubuntu users have a similar issue with PPA's.) Priorities really help keeps things straight.
Funny, that sounds like apt
Funny, that sounds like apt pinning which has been around in Debian for about a decade.
The fact is that even if the underlying logic is better, which I do not admit, it takes a lot of effort to equal (nevermind surpass!) the deep feature set and utility of apt.
Post new comment