OpenSUSE Linux Tips, tricks, how-tos, opinions, and news
My Resume - My LinkedIn Profile - twitter: @scottmmorrisOpenSUSE Linux provides a command-line method of managing repositories and packages. This tool is called zypper. The following is a basic tutorial by example of how to use zypper.
Repository Management
To list repositories:
[1342][root@dev:/home/scott]$ zypper repos # | Alias | Name | Enabled | Refresh ---+-------------------+-----------------------+---------+-------- 1 | Enlightenment CVS | Enlightenment CVS | Yes | Yes 2 | OpenSUSE_11.1_ISO | OpenSUSE 11.1 ISO | Yes | No 3 | Packman | Packman | Yes | Yes 4 | Window_Managers | Window Managers | Yes | Yes 5 | XFCE4 | XFCE4 | Yes | Yes 6 | aterm | aterm | Yes | Yes 7 | home:danci1973 | home:danci1973 | Yes | Yes 8 | home:dauphin | home:dauphin | Yes | Yes 9 | home:jnelson-suse | home:jnelson-suse | Yes | Yes 10 | mozilla | mozilla | Yes | Yes 11 | openSUSE 11.1-0 | openSUSE 11.1-0 | Yes | Yes 12 | repo-debug | openSUSE-11.1-Debug | No | Yes 13 | repo-non-oss | openSUSE-11.1-Non-Oss | Yes | Yes 14 | repo-source | openSUSE-11.1-Source | No | Yes 15 | repo-update | openSUSE-11.1-Update | Yes | Yes [1402][root@dev:/home/scott]$
To add a repository (we’re going to use Packman as an example):
[1341][root@dev:/home/scott]$ zypper addrepo "http://packman.unixheads.com/suse/11.1/" Packman Adding repository 'Packman' [done] Repository 'Packman' successfully added Enabled: Yes Autorefresh: No URI: http://packman.unixheads.com/suse/11.1/ [1341][root@dev:/home/scott]$
To turn on autorefresh, because it’s disabled by default (again, with Packman):
[1341][root@dev:/home/scott]$ zypper modifyrepo -r Packman Autorefresh has been enabled for repository 'Packman'. [1342][root@dev:/home/scott]$
To refresh a repo manually:
[1342][root@dev:/home/scott]$ zypper refresh -r Packman Retrieving repository 'Packman' metadata [done] Building repository 'Packman' cache [done] Specified repositories have been refreshed. [1342][root@dev:/home/scott]$
Leave out the “-r” and leave off the name of the repo if you want to refresh all of them.
To remove a repository:
[1337][root@dev:/home/scott]$ zypper rr Packman Removing repository 'Packman' [done] Repository 'Packman' has been removed. [1337][root@dev:/home/scott]$
Package Management
To search for a package (id3v2, in this example):
[1224][root@dev:/home/scott]$ zypper search id3v2 Loading repository data... Reading installed packages... S | Name | Summary | Type --+-------+--------------------------------------+-------- | id3v2 | A Command Line Editor for ID3V2 Tags | package [1229][root@dev:/home/scott]$
To get information on a package (again, id3v2):
[1229][root@dev:/home/scott]$ zypper info id3v2 Loading repository data... Reading installed packages... Information for package id3v2: Repository: openSUSE 11.1-0 Name: id3v2 Version: 0.1.11-77.60 Arch: x86_64 Vendor: openSUSE Installed: No Status: not installed Installed Size: 79.0 K Summary: A Command Line Editor for ID3V2 Tags Description: ID3 tags are found in MP3 files. They canstore information about what band recorded the song, the song name, and more. ID3V1 tags are seriously deficient as to the kind of and length ofinformation that they can store. This is a tool for editing ID3V2tags in Linux. [1333][root@dev:/home/scott]$
To install a package:
[1333][root@dev:/home/scott]$ zypper install id3v2 Loading repository data... Reading installed packages... Resolving package dependencies... The following NEW package is going to be installed: id3v2 Overall download size: 30.0 K. After the operation, additional 79.0 K will be used. Continue? [YES/no]: Retrieving package id3v2-0.1.11-77.60.x86_64 (1/1), 30.0 K (79.0 K unpacked) Retrieving: id3v2-0.1.11-77.60.x86_64.rpm [done] Installing: id3v2-0.1.11-77.60 [done] [1334][root@dev:/home/scott]$
To remove a package:
[1334][root@dev:/home/scott]$ zypper remove id3v2 Loading repository data... Reading installed packages... Resolving package dependencies... The following package is going to be REMOVED: id3v2 After the operation, 79.0 K will be freed. Continue? [YES/no]: Removing id3v2-0.1.11-77.60 [done] [1336][root@dev:/home/scott]$
These are some common zypper commands that will help you manage your repositories and packages from the command-line.
If you enjoyed this post, make sure you subscribe to my RSS feed!| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| « Aug | ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | ||
33 queries. 1.154 seconds
November 7th, 2009 at 10:03 am
[...] had quite a few articles and blogs that covered it and OpenSUSE Build Service too received some tender care. People who follow the [...]
November 10th, 2009 at 7:56 pm
Hey Scott,
I am a debian user and just decided to try suse. I was searching for help about zypper command. Thanks for this nice tutorial.
November 11th, 2009 at 4:45 pm
You bet. Glad to help out. Thanks for stopping by!
November 17th, 2009 at 5:29 am
[...] Morris stellt zypper in einem Blogbeitrag auf OpenSuse Linux Rants näher [...]
December 10th, 2009 at 5:11 pm
Ksplice availability on Suse 11 is when??? Suse 11 certification for SAP netweaver 7.x is when? Thanks. (Just a few nagging problems that I currently have that can be fixed with the availability of these products.)