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.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- New Products
- RSS Feeds
- Trying to Tame the Tablet
- What's the tweeting protocol?
- Dart: a New Web Programming Experience
- Drupal is an Awesome CMS and a Crappy development framework
4 hours 32 min ago - IT industry leaders
6 hours 55 min ago - Reply to comment | Linux Journal
23 hours 43 min ago - Reply to comment | Linux Journal
1 day 2 hours ago - Reply to comment | Linux Journal
1 day 3 hours ago - great post
1 day 4 hours ago - Google Docs
1 day 4 hours ago - Reply to comment | Linux Journal
1 day 9 hours ago - Reply to comment | Linux Journal
1 day 10 hours ago - Web Hosting IQ
1 day 11 hours ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.



Comments
Hi! I'm new to Linux (and
Hi! I'm new to Linux (and computers in general), but I'm determined to be a Linux Admin. I've only played with OSuSE and Mint. Regarding CLI manager, I find Zypper amazingly simple (I didn't know things could be that simple). I don't know which solves dependencies better, but the syntax of Zypper is really simple compared to Apt. Take a look:
PACKAGES
to install: # zypper in ~
to remove: # zypper rm ~
to search: # zypper se ~
to get info about a package: # zypper if ~
UPDATES
to list available updates of packages: # zypper lu
to update all installed packages: # zypper up
REPOS
to list repositories: # zypper lr
to refresh repos: # zypper ref
to add a repository: # zypper ar (http://~~~)
to remove the fourth repository from the list: # zypper rr 4 (or http://~~~)
And now that I've been playing with Mint, I'm confused with the apt syntax. Why should there be "apt-get install ~", when "apt-cache install ~" doesn't exist. Why not just "apt install ~"??
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.
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.
"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" :-)
zypper
Maybe you should watch zypper closely. Start here:
http://en.opensuse.org/Zypper/Usage
Zypper is faster, smarter and much more capable than apt or aptitude. These is no doubt about that. Of course you can lock package, set priorities to repositories and dist-upgrade using zypper. And zypper can do this using CLI commands. using Apt you have to edit conf files to use this functions. This is not very usefull.
In addition, zypper SAT solver is much more powerfull, than obsolete solver used in APT. The main difference is, that if any dependency solution exist, zypper will find it. But there are many scenarios where APT fail, even if the solution is obvious.
http://www.mancoosi.org/edos/manager/
http://zorked.net/smart/doc/README.html
Zypper has also ability to work with repositories. You can add, remove, enable or disable repositories withing simple CLI commands. You can set priorities, autorefresh etc... If you are using Apt, you stuck with manual conf file editation. Zypper also install patches and patterns and services. And on top of that, it uses less memory compared to its competitors:
http://duncan.mac-vicar.com/blog/archives/309
So lets have a lokk at syntax now. Apt is a set of tools. You have to remeber all those different apt-get... , apt-cache..., apt-.... tools, which does not seem to be user-friendly design. "Apt install" or "apt search" would be much better syntax. Zypper is a single tool. You always start write "zypper" following a command. If you want to install package in Debian, you just write apt-get install. Zypper does the same using zypper install. But zypper also knows the short syntax using "zypper in". It is much more comfortable to write "zypper XX" where XX are two letters representting action. And watch the nice zypper output when listing packages or repositories. It is fantastic.
Apt and aptitude are great tools and became famous during past years. But zypper is better today, There is now doubt about that.
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.
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
emerge
From the solver point of view, it is not he best:
http://www.mancoosi.org/edos/manager/
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?
just `zypper in
just `zypper in foo-2.4.0rc.pmwhatever`. No -C should be needed.
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.
apt
Afaik apt does not know pinning. Using zypper I can call "zypper al " (zypper adlock). How can I lock the package using apt? I'm afraid apt can't do that. You have to open text editor, and pin the package manually in some conf file. Am I right?
One of the biggest advantage of zypper is, that you can do everything using CLI commands.
Not true
Look here for example: http://wiki.ubuntuusers.de/APT-Pinning
And btw being able to use zypper on the cli is no advantage (to apt).