zypper command is blocked due to zypper lock by another process
This document (000021811) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 15 SP6
SUSE Linux Enterprise Server 15 SP5 LTSS
SUSE Linux Enterprise Server 15 SP4 LTSS
Situation
Zypper commands can be blocked by zypper locks when another process or automation makes use of the zypper command, e.g. when packagekit is running.
An example of zypper locking and it's error output:
# zypper search -s vsftpd
System management is locked by the application with pid 6402 (zypper).
Close this application before trying again.
Resolution
The libzypp Environmental Variable ZYPP_LOCK_TIMEOUT= <sec> can be used for this type of situations.
Libzypp/zypper then waits the set number of seconds for the lock to be freed, and when the other process releases the lock within that time, zypper proceeds.
NOTE: 0 sec means zypper doesn't wait, a negative value, for example '-1' will wait forever.
The variable can be set via export or as prefix for the zypper command, for example:
export ZYPP_LOCK_TIMEOUT=60
or
ZYPP_LOCK_TIMEOUT=60 zypper search -s vsftpd
The libzypp update released May/2025 adds a lock_timeout config option ( lock_timeout = ) to /etc/zypp/zypp.conf
This provides a more easily configurable method for setting the lock_timeout.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021811
- Creation Date: 28-Apr-2025
- Modified Date:09-May-2025
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com