Wednesday, May 7, 2008

More options to modifyrepo

In 10.3, zypper modifyrepo (mr) only allowed you to enable/disable one repository and enable/disable autorefresh for it. In 11.0 the options have grown in number a bit. Did i mention the nice help texts?



$ zypper help mr
modifyrepo (mr) <options> <alias|#|uri>
modifyrepo (mr) <options> <--all|--remote|--local|--medium-type>

Modify properties of repositories specified by alias, number or URI
or by the '--all, --remote, --local, --medium-type' aggregate options.

Command options:
-d, --disable Disable the repository (but don't remove it).
-e, --enable Enable a disabled repository.
-r, --refresh Enable auto-refresh of the repository.
-R, --no-refresh Disable auto-refresh of the repository.
-n, --name Set a descriptive name for the repository.
-p, --priority <1-99> Set priority of the repository.
-k, --keep-packages Enable RPM files caching.
-K, --no-keep-packages Disable RPM files caching.
-a, --all Apply changes to all repositories.
-l, --local Apply changes to all local repositories.
-t, --remote Apply changes to all remote repositories.
-m, --medium-type <type> Apply changes to repositories of specified type.


This is what you will see in zypper 0.11.3. The aggregate options (and the -k options) were added just recently by our new colleague Josef Reidinger. Those familiar with 10.3 zypper, note that the --enable-autorefresh/-a and --disable-autorefresh options are now deprecated (-a shorthand even had to be removed because of conflict with --all) in favor of --refresh and --no-refresh options. This change was introduced for the sake of consistency with other commands' options. All the options will be described in more detail in the man page soon.



Few examples


To disable autorefresh for all repositories, do:



$ zypper mr -Ra
Nothing to change for repository 'openSUSE-DVD 11.0'.
Autorefresh has been disabled for repository 'fate'.
Nothing to change for repository 'factory'.
Nothing to change for repository 'packman'.
Autorefresh has been disabled for repository 'factory-nonoss'.
Autorefresh has been disabled for repository 'factory-debug'.
Nothing to change for repository 'vbox'.
Autorefresh has been disabled for repository 'zypp:svn'.


To disable all cd/dvd repositories, do:

$ zypper mr -d -m cd -m dvd
Repository 'openSUSE-DVD 11.0' has been sucessfully disabled.



To enable RPM caching of RPM files for all remote (http/https/ftp) repositories, do:

$ zypper mr -kt
Nothing to change for repository 'factory'.
RPM files caching has been enabled for repository 'factory-debug'.
RPM files caching has been enabled for repository 'factory-nonoss'.
RPM files caching has been enabled for repository 'fate'.
Nothing to change for repository 'packman'.
RPM files caching has been enabled for repository 'vbox'.
RPM files caching has been enabled for repository 'zypp:svn'.


Of course don't forget to use zypper clean when you run out of free disk space then :O)

Missing history and bookmarks in Firefox 3?

In case you just updated to Firefox 3 (openSUSE 11.0 beta2 includes Firefox 2.9.95 (Firefox 3 beta 5) and you wondered why are your bookmarks and history not working, here is the probable cause & solution. Firefox 3 uses sqlite back-end for history, bookmarks and other stuff. So doing zypper in libsqlite3-0 and restarting firefox should make them work again.

Monday, May 5, 2008

zypper search is back

I said i would write about zypper's XML output almost two months ago. Hm... obviously other stuff gained higher priority (i will get back to the XML output later). In the openSUSE Updater applets, the focus has shifted from the zypp back-end to PackageKit and i focused on other zypper/libzypp features and fixes. I will write about them in the following few posts.


Just recently i re-enabled all the original zypper search functionality (except --match-all which will be hopefully comming soon). Apart from the original features, there is one frequently requested change in the presenation of the search results (and thanx to the zypp and sat-solver guys it is also fast :O).


The old zypper listed all available instances of a matching package, all versions from all repositories. But people are more often interested in what the package is about than what versions are available from each respository. Hence, since 0.11.1 you will see a list of packages grouped by their names and types with a summary column instead of repository and version column:



$ zypper search browser
Reading installed packages...

S | Name | Summary | Type
--+---------------------+----------------------------------+--------
i | kim-browser | CIM Browser for CIM-XML Protocol | package
| mysql-query-browser | A Graphical MySQL Query Shell | package
| tvbrowser | digital TV guide | package


This output caught a few users unprepared. I hope learning that --details/-s can turn on a detailed list similar to the old one satisfied most of them:



$ zypper search -s browser
Reading installed packages...

S | Name | Type | Version | Arch | Repository
--+---------------------+---------+------------+--------+-----------
i | kim-browser | package | 0.3-208 | x86_64 | factory
v | kim-browser | package | 0.3-208 | i586 | factory
| mysql-query-browser | package | 5.0r12-183 | x86_64 | factory
| mysql-query-browser | package | 5.0r12-183 | i586 | factory
| tvbrowser | package | 2.6.3-22 | noarch | factory

Since zypper 0.11.2 the summaries will be abbreviated as needed to fit the width of your console screen. This is how it looks on an 80 character wide console:



$ search music
Reading installed packages...

S | Name | Summary | Type
--+-----------------------+-----------------------------------------+-----------
| asc-music | Music for Advanced Strategic Command--> | package
| libmusicbrainz | Library That Provides Access to the M-> | srcpackage
| libmusicbrainz-devel | Include Files and Libraries Mandatory-> | package
| libmusicbrainz3 | Library That Provides Access to the M-> | srcpackage
| libmusicbrainz3-6 | Library That Provides Access to the M-> | package
| libmusicbrainz3-devel | Library That Provides Access to the M-> | package
i | libmusicbrainz4 | Library That Provides Access to the M-> | package
| texlive-bin-musictex | MusiXTeX and MusicTeX | package
| texlive-musictex | MusiXTeX and MusicTeX | package

Of course you can use --no-abbrev/-A global option to turn the abbreviation off - the output will be messy, but you can read the whole summaries. Another way to obtain this info is to use zypper info.



...and don't forget to try zypper help search, zypper has nice help texts :O) I'll be fixing zypper update and writing a lot of documentation in the meantime.