$ zypper ps
Check failed:
Please install package 'lsof' first.
How do I fix this error? How can I use the ‘zypper ps‘ command on SELS/OpenSUSE 15.1/15.2 to find out if system reboot requires or not?
You need to install the lsof package. But, first, let us see why we need the ‘zypper ps‘ command.
Tutorial requirements | |
---|---|
Operating system/app | SUSE/OpenSUSE Linux |
Root privileges required | Yes |
Difficulty | Easy (rss) |
Estimated completion time | 2m |
zypper ps: Check failed – Please install package ‘lsof’ first.
After each upgrade or removal of packages, there may be running processes on the OpenSUSE Linux. These processes continue to run meanwhile deleted files such as shared libs. The zypper ps command lists all processes using deleted files, together with the corresponding files, and a service name hint, in case it’s a known service. This gives a hint which services may need to be restarted after an update. Usually programs which continue to use deleted shared libraries. The list contains the following information:
Option | Description |
---|---|
PID | ID of the process |
PPID | ID of the parent process |
UID | ID of the user running the process |
Login | Login name of the user running the process |
Command | Command used to execute the process |
Service | Service name, if command is associated with a system service |
Files | The list of the deleted files |
-s | Create a short table not showing the deleted files. Given twice, show only processes which are associated with a system service. Given three times, list the associated system service names only. |
--print format | For each associated system service print format on the standard output, followed by a newline. Any %s directive in format is replaced by the system service name. |
-d filename | Output a file with all proc entries that make it into the final set of used open files. This can be submitted as additional information in a bug report. |
Installing lsof on OpenSUSE Linux
Type the following zypper command as follows:
$ sudo zypper ref
$ sudo zypper up
$ sudo zypper install lsof
How to use the zypper ps command
Simply type:
$ sudo zypper ps
The following running processes use deleted files: PID | PPID | UID | User | Command | Service | Files ------+------+-----+---------+-----------+-----------+-------------------------------------- 6064 | 1 | 482 | polkitd | polkitd | polkit | /usr/lib64/libgobject-2.0.so.0.6200.5 | | | | | | /usr/lib64/libgmodule-2.0.so.0.6200.5 | | | | | | /usr/lib64/libgio-2.0.so.0.6200.5 | | | | | | /usr/lib64/libglib-2.0.so.0.6200.5 16499 | 1 | 0 | root | python3.6 | firewalld | /usr/lib64/libgobject-2.0.so.0.6200.5 | | | | | | /usr/lib64/libglib-2.0.so.0.6200.5 | | | | | | /usr/lib64/libgio-2.0.so.0.6200.5 | | | | | | /usr/lib64/libgmodule-2.0.so.0.6200.5 You may wish to restart these processes. See 'man zypper' for information about the meaning of values in the above table. No core libraries or services have been updated. Reboot is probably not necessary.
Let us restart the firewalld on OpenSUSE Linux and polkit too:
$ sudo systemctl restart firewalld
$ sudo systemctl restart polkit
## NOW VERIFY IT AGAIN ##
$ sudo zypper ps
No processes using deleted files found. No core libraries or services have been updated. Reboot is probably not necessary.
How to find out if my OpenSUSE or SUSE Linux server needs a reboot
Simply run the following and it will let you know if reboot necessary or not:
$ sudo zypper ps
See how to automate Linux kernel and packages updates and reboot the server using Ansible IT automation tool.
Examples
Want to display only processes associated with a system service that requires restart? Try:
$ sudo zypper ps -ss
Here is short cut for zypper ps --print "%s"; list services which might need a restart:
$ sudo zypper ps -sss
We can force the zypper command print the commands to retrieve status information for services which might need a restart, run:
$ sudo zypper ps --print "systemctl status %s"
Please note that if Linux kernel updated or core Linux system libs replaced, reboot the Linux box:
$ sudo reboot
## OR ##
$ sudo shutdown -r now "Going down for kernel updates"
Conclusion
We explained the ‘zypper ps’ command and its usage to restart services or servers. To use the ‘zypper ps’ command, you need the lsof tool. Hence, we installed it on our system. See OpenSUSE wiki for more information here.
- Find out if my Ubuntu/Debian Linux server needs a reboot
- OpenSUSE install lsof package to get rid of 'zypper ps' errors
- Check if CentOS / RHEL needs a full reboot
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 1 comment... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
I was wondering what to do and I searched the Internet. It solves my problems. Thank you kind stranger.