Home Wiki > openSUSE:Libzypp locks file
Sign up | Login

openSUSE:Libzypp locks file

tagline: From openSUSE

This article goes into greater detail on the locks/lock file that you can do with zypper.

A simple way to manipulate the locks is with zypper addlock, or zypper removelock. See also man zypper.


The default location of the locks file is /etc/zypp/locks. This can be changed in /etc/zypp/zypp.conf using locksfile.path setting.

Format of locks

format is attribute:value. Attribute can be general or solvable attribute. All attributes can be used more times. Locks is separated by blank line.

List of general attributes

namedescriptiondefault value
repo repository restriction. Only alias is accept. all repository
type type restriction - kind can be package,patch,pattern,product and srcpackage. all kinds
case_sensitive if matching is case sensitive. case insensitive
install_status status of object. Possibly states is installed,not-installed and all. If more install status is specified then last is used. all
match_type type of string in value. Not affect kind and repo which must be exactly specified. Possibly values: exact,substring,regex,glob and word. regex is (POSIX Extended Regular Expressions default is substring
query_string string for all attributes. Can be restricted by solvable attribute with empty value (it is recommended ,because without any restriction have very poor performance).(TODO jano what exact) nothing
version restrict lock only to some versions. It contains two part, first is operator and second is version. Operator is ==,!=,<,>,<=,>=. If operator is not specified then == is used. Version have format epoch:version-release . Only version is mandatory. no restriction

solvable attributes

attributes that should be matched against the specified query strings. If there is no query string defined with the attribute, the global query_string is used instead.

If searching in multiple attributes, a match in one of them is sufficient to match the query (OR-semantic).

Version: libzypp-7.1.1Since this version it is supported to specify edition ranges together with solvable_name or dependeny attributes. This way you can lock packages in a specific version or version range. See the Examples section for details.

universal attributes

this attributes have each kind of objects

namedescriptionexample value
solvable_name name of object OpenOffice_org-kde
solvable_summary summary of object KDE Extensions for OpenOffice.org
solvable_arch architecture of object i586
solvable_description description of object This package contains some KDE extensions for OpenOffice.org.
solvable_messageins message after package install Before you can use this package you have to run `faxsetup` as root.
solvable_messagedel message after package uninstall This package is required by lpdfilter.
solvable_eula text of license (only if need explicitly agreed like flash-player, java etc) long text of license
solvable_installtime ??? ???
solvable_buildtime time when package was build (in seconds since 1.1.1970) 1210698121
solvable_installsize size after install (in KB) 15485
solvable_downloadsize size of rpm (in KB) 12674
solvable_diskusage disk usage for some directories (???some rules for it???) first is dir, then size (in KB) and count of files. /usr/lib64/anjuta 5351 91

package attributes

this attributes have only packages

namedescriptionexample value
solvable_checksum rpm checksum (sha1) c89f7ea38f04e447b0323d64875a51bd0db91654
solvable_medianr media number (e.g. for multi CD or double-layer DVD) 1
solvable_mediafile ??? (looks like unused) ???
solvable_mediadir ??? (looks like unused) ???
solvable_license license of object X11/MIT
solvable_group package group Development/Tools/Version Control
solvable_keywords keywords (TODO need better specify) x11
solvable_authors authors of object Michael Andres email address
solvable_filelist list of files (looks like not all, only executable and configuration files) /usr/bin/package-manager

patch attributes

this attributes have only patches

namedescriptionexample value
solvable_patchcategory category of patch - should be security, optional and recommended recommended
update_reboot update need reboot ???(find how use it)
update_restart update need restart ???(find how use it)
update_collection_name name of update clamav
update_collection_evr epoch,version and release format (only version is mandatory) epoch:version-release 0.93-2
update_collection_arch architecture x86_64
update_collection_filename name (of rpm) clamav-0.93-2.x86_64.rpm
update_collection_flags ??? ???
update_reference_type reference for update (f.e. bugzilla,cve) bugzilla
update_reference_href href https://bugzilla.novell.com/show_bug.cgi?id=64937
update_reference_id id of update 64937
update_reference_title title of path bug number 64937

pattern attributes

this attributes have only patterns

namedescriptionexample value
solvable_isvisible ??? ???
solvable_icon ??? ???
solvable_order ??? ???
solvable_category ??? ???
script ??? ???
solvable_includes ??? ???
solvable_extends ??? ???


all kde

locks everything which contains kde

solvable_name: kde

same as

query_string: kde

all shareware from repo non-oss or factory

locks each package which is shareware from repository non-oss or factory

solvable_license: shareware
repo: non-oss
repo: factory

all patch

locks all patch


Two locks

all objects which contain the string 'kde' (lowercase) in either name or description. And a second lock for everything which has 'x11' in its keywords.

query_string: kde
case_sensitive: on

solvable_keywords: x11

exact package

lock k3b (e.g. don't want update it)
preferred way is use zypper addlock command

solvable_name: k3b
match_type: exact

lock packages in a specific version

Version: libzypp-7.1.1This section is not supported by older versions.

Lock a broken version of gnome-screensaver:

type: package
match_type: exact
case_sensitive: on
solvable_name: gnome-screensaver == 2.24.0

Lock all 'kde' package with version less than 4.0:

type: package
match_type: glob
case_sensitive: off
solvable_name: kde* < 4.0

Pitfall: The following is not the same as above, because different attribues are 'OR'ed. The one below would lock all 'kde' packages and also all packages with a version less than 4.0. This is not what you want.

type: package
match_type: glob
case_sensitive: off
solvable_name: kde*
solvable_edition: < 4.0