I can't shutdown my system with KDE and "halt -p"

I recently upgraded my Leap 15.4 system to 15.5. Since then i have trouble shutting down my system:
In KDE selecting “Shut Down” or executing as root “halt -p” suspends my system instead of shutting it down.

When i then power up the laptop, KDE seems to have gone (but the mouse still moves across my two displays). Next, after about 30 seconds the system suspends again. I’ve tried to power up the system several times, each time it suspends again after about 30 seconds.

When i shutdown the system with “systemctl poweroff” my system does a proper shutdown.
In /var/log/messages i see my KDE shutdown

2023-09-25T09:42:50.749135+02:00 manta dbus-daemon[2682]: [session uid=1000 pid=2682] Activating service name='org.kde.LogoutPrompt' requested by ':1.90' (uid=1000 pid=14104 comm="/usr/bin/plasmashell --no-respawn ")
2023-09-25T09:42:50.903830+02:00 manta dbus-daemon[2682]: [session uid=1000 pid=2682] Successfully activated service 'org.kde.LogoutPrompt'
2023-09-25T09:43:21.702060+02:00 manta dbus-daemon[2682]: [session uid=1000 pid=2682] Activating service name='org.kde.Shutdown' requested by ':1.101' (uid=1000 pid=18460 comm="/usr/lib/ksmserver-logout-greeter ")
2023-09-25T09:43:21.715959+02:00 manta dbus-daemon[2682]: [session uid=1000 pid=2682] Successfully activated service 'org.kde.Shutdown'

But further down the line it changes into a suspend:

2023-09-25T09:43:22.440202+02:00 manta systemd[1]: Reached target Sleep.
2023-09-25T09:43:22.441805+02:00 manta systemd[1]: Starting System Suspend...
2023-09-25T09:43:22.442136+02:00 manta kded5[2834]: QDBusAbstractAdaptor: Cannot relay signal KDEDModule::moduleDeleted(KDEDModule*): Pointers are not supported: KDEDModule*
2023-09-25T09:43:22.460217+02:00 manta kded5[2834]: message repeated 15 times: [ QDBusAbstractAdaptor: Cannot relay signal KDEDModule::moduleDeleted(KDEDModule*): Pointers are not supported: KDEDModule*]
2023-09-25T09:43:22.462798+02:00 manta systemd-sleep[18508]: INFO: Skip running /usr/lib/systemd/system-sleep/grub2.sleep for suspend
2023-09-25T09:43:22.464760+02:00 manta systemd-sleep[18505]: Entering sleep state 'suspend'...
2023-09-25T09:43:22.467421+02:00 manta kernel: [ 7797.936049][T18505] PM: suspend entry (deep)
2023-09-25T09:43:22.471728+02:00 manta kernel: [ 7797.940408][T18505] Filesystems sync: 0.004 seconds

Anyone else have similar problems ?

@gerben:

It seems that, you have a fundamental system package relationships issue.

Please execute the following commands:

> zypper packages --orphaned

Or, use the YaST Software Management to check for orphaned packages – somewhat easier to use and easier to clean up the system conflicts you’re experiencing …

Once you’ve got rid of the orphaned packages and therefore, the related system files – reboot.

Then execute the following commands:

 # zypper verify
 # rpm --verify --all

Once you’ve got all the system package dependencies sorted out, execute the following command:

# rpmconfigcheck

Sort out all the configuration issues you have due to the newer versions of the system’s configuration files –

  • You’ll need several “user root” Konsole Windows to handle the differences and either the editing of the system’s configuration files or, moving current configuration files to «Configuration File Name».old – and then moving «Configuration File Name».rpmnew to «Configuration File Name» …

Then, reboot again …


Please make sure that, you have the following openSUSE system repositories –

#  | Alias                            | Name                                                                                        | Enabled | GPG Check | Refresh | URI
---+----------------------------------+---------------------------------------------------------------------------------------------+---------+-----------+---------+-------------------------------------------------------------------------------
?? | repo-backports-update            | Update repository of openSUSE Backports                                                     | Yes      | (r ) Yes   | Yes      | http://download.opensuse.org/update/leap/15.5/backports/
?? | repo-non-oss                     | Non-OSS Repository                                                                          | Yes      | (r ) Yes   | Yes      | http://download.opensuse.org/distribution/leap/15.5/repo/non-oss/
?? | repo-openh264                    | Open H.264 Codec (openSUSE Leap)                                                            | Yes      | (r ) Yes   | Yes      | http://codecs.opensuse.org/openh264/openSUSE_Leap/
?? | repo-oss                         | Main Repository                                                                             | Yes      | (r ) Yes   | Yes      | http://download.opensuse.org/distribution/leap/15.5/repo/oss/
?? | repo-sle-update                  | Update repository with updates from SUSE Linux Enterprise 15                                | Yes      | (r ) Yes   | Yes      | http://download.opensuse.org/update/leap/15.5/sle/
?? | repo-update                      | Main Update Repository                                                                      | Yes      | (r ) Yes   | Yes      | http://download.opensuse.org/update/leap/15.5/oss
?? | repo-update-non-oss              | Update Repository (Non-Open-Source-Software)                                                | Yes      | (r ) Yes   | Yes      | http://download.opensuse.org/update/leap/15.5/non-oss/

This got me in deeper trouble: I noticed I had many URL’s referring to cdn.opensuse.org instead of download.opensuse.org so with yast i changed all to download.opensuse.org
Since then i constantly get errors from yast saying “An error occurred during repository initialization. Error refreshing service openSUSE (dir:/usr/share/zypp/local/service/openSUSE): [openSUSE:repo-oss|/distribution/leap/15.5/repo/oss - openSUSE Download] Repository already exists”

However i have no reference to cdn anymore:

# zypper lr -u
Repository priorities in effect:                                                                                            (See 'zypper lr -P' for details)
      90 (raised priority)  :  2 repositories
      99 (default priority) :  8 repositories

#  | Alias                           | Name                          | Enabled | GPG Check | Refresh | URI
---+---------------------------------+-------------------------------+---------+-----------+---------+------------------------------------------------------------------------------------
 1 | NVIDIA:repo-non-free            | repo-non-free (15.5)          | Yes     | (r ) Yes  | Yes     | https://download.nvidia.com/opensuse/leap/15.5
 2 | openSUSE-Leap-15.5-1            | openSUSE-Leap-15.5-1          | No      | ----      | ----    | hd:/?device=/dev/disk/by-id/usb-SanDisk_Cruzer_Glide_200443175302E8B38D30-0:0-part2
 3 | openSUSE:repo-non-oss           | repo-non-oss (15.5)           | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/15.5/repo/non-oss
 4 | openSUSE:repo-non-oss-debug     | repo-non-oss-debug (15.5)     | No      | ----      | ----    | http://download.opensuse.org/debug/distribution/leap/15.5/repo/non-oss
 5 | openSUSE:repo-openh264          | repo-openh264 (15.5)          | Yes     | (r ) Yes  | Yes     | http://codecs.opensuse.org/openh264/openSUSE_Leap
 6 | openSUSE:repo-oss               | repo-oss (15.5)               | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/15.5/repo/oss
 7 | openSUSE:repo-oss-debug         | repo-oss-debug (15.5)         | No      | ----      | ----    | http://download.opensuse.org/debug/distribution/leap/15.5/repo/oss
 8 | openSUSE:repo-oss-source        | repo-oss-source (15.5)        | No      | ----      | ----    | http://download.opensuse.org/source/distribution/leap/15.5/repo/oss
 9 | openSUSE:update-backports       | update-backports (15.5)       | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/backports
10 | openSUSE:update-backports-debug | update-backports-debug (15.5) | No      | ----      | ----    | http://download.opensuse.org/update/leap/15.5/backports_debug
11 | openSUSE:update-non-oss         | update-non-oss (15.5)         | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/non-oss
12 | openSUSE:update-non-oss-debug   | update-non-oss-debug (15.5)   | No      | ----      | ----    | http://download.opensuse.org/debug/update/leap/15.5/non-oss
13 | openSUSE:update-oss             | update-oss (15.5)             | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/oss
14 | openSUSE:update-oss-debug       | update-oss-debug (15.5)       | No      | ----      | ----    | http://download.opensuse.org/debug/update/leap/15.5/oss
15 | openSUSE:update-sle             | update-sle (15.5)             | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/sle
16 | openSUSE:update-sle-debug       | update-sle-debug (15.5)       | No      | ----      | ----    | http://download.opensuse.org/debug/update/leap/15.5/sle
17 | packman                         | packman                       | Yes     | (r ) Yes  | Yes     | https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.5/
18 | snappy                          | snappy                        | Yes     | (r ) Yes  | Yes     | https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.5

Changing repo-oss back to “cdn” still gives me the same error. With all referring to download.opensuse.org i get:

# zypper verify
Refreshing service 'NVIDIA'.
Refreshing service 'openSUSE'.
Adding repository 'repo-oss (15.5)' .................................................................................................................[error]
Unexpected exception.
[openSUSE:repo-oss|http://cdn.opensuse.org/distribution/leap/15.5/repo/oss] Repository already exists.
Please file a bug report about this.
See http://en.opensuse.org/Zypper/Troubleshooting for instructions.

Do you have anything in /var/cache/zypp/geoip.d/?

This looks OK but, you’ll have to call:

# zypper refresh --force

to properly refresh the RPM database.

Then, you’ll need to execute:

# rpm --rebuilddb

And then, execute the following again:

# zypper refresh --force

And then, check again for any orphaned packages.

Also, check in the YaST Repository Manager – the button “GPG Keys” – for any expired certificates.
If there are any expired certificates, delete them and then, execute, again:

# zypper refresh --force

Check for any patches and/or updates which need to be applied.
And then, once again “zypper verify” to pick up any missing packages due to dependencies.


Please, check for anything which is outdated in:

/etc/zypp/repos.d/
/var/cache/zypp/*/

Yes, there is a file called download.opensuse.org containing a single ‘\n’

Up to the second refesh --force everything went OK and no errrors where reported., but the check for orphans stilll fails with:

# zypper packages --orphaned
Refreshing service 'NVIDIA'.
Refreshing service 'openSUSE'.
Adding repository 'repo-oss (15.5)' .................................................................................................................[error]
Unexpected exception.
[openSUSE:repo-oss|http://cdn.opensuse.org/distribution/leap/15.5/repo/oss] Repository already exists.
Please file a bug report about this.
See http://en.opensuse.org/Zypper/Troubleshooting for instructions.

I went ahead and removed several expired certificates and did another refresh --force.

Still i get the error.

grepping in /etc/zypp/repos/* and /var/cache/zypp/* there are no files with “cdn.opensuze.org” in them.

I found a few files in /etc/zypp/repos.d with extension .rpmsave: i move them away, redid the refresh --force and rebuilddb, still i get the error message.
Somewhere in some file there must be a reference to cdn.opensuse.org, so i ran a giant search to find it:
i found i few files in /var/log all logfiles from my attempts AND

  • /var/lib/YaST2/system_packages_repos.yaml
  • /usr/share/zypp/local/service/openSUSE/repo/opensuse-leap-repoindex.xml

I modified the file in /usr/share/zypp (replacing “cdn.opensuse.org” with “download.opensuse.org”)

Now my message got changed into:

# zypper packages --orphaned
Refreshing service 'NVIDIA'.
Refreshing service 'openSUSE'.
Adding repository 'repo-oss (15.5)' .................................................................................................................[error]
Unexpected exception.
[openSUSE:repo-oss|http://download.opensuse.org/distribution/leap/15.5/repo/oss] Repository already exists.
Please file a bug report about this.
See http://en.opensuse.org/Zypper/Troubleshooting for instructions.

So the issue was not the cdn url, but the fact that the repository already exists.

I don’t know enough about zypper to see what’s wrong with:

# zypper lr -u
Repository priorities in effect:                                                                                            (See 'zypper lr -P' for details)
      90 (raised priority)  :  2 repositories
      99 (default priority) :  8 repositories

#  | Alias                           | Name                          | Enabled | GPG Check | Refresh | URI
---+---------------------------------+-------------------------------+---------+-----------+---------+------------------------------------------------------------------------------------
 1 | NVIDIA:repo-non-free            | repo-non-free (15.5)          | Yes     | (r ) Yes  | Yes     | https://download.nvidia.com/opensuse/leap/15.5
 2 | openSUSE-Leap-15.5-1            | openSUSE-Leap-15.5-1          | No      | ----      | ----    | hd:/?device=/dev/disk/by-id/usb-SanDisk_Cruzer_Glide_200443175302E8B38D30-0:0-part2
 3 | openSUSE:repo-non-oss           | repo-non-oss (15.5)           | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/15.5/repo/non-oss
 4 | openSUSE:repo-non-oss-debug     | repo-non-oss-debug (15.5)     | No      | ----      | ----    | http://download.opensuse.org/debug/distribution/leap/15.5/repo/non-oss
 5 | openSUSE:repo-openh264          | repo-openh264 (15.5)          | Yes     | (r ) Yes  | Yes     | http://codecs.opensuse.org/openh264/openSUSE_Leap
 6 | openSUSE:repo-oss               | repo-oss (15.5)               | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/15.5/repo/oss
 7 | openSUSE:repo-oss-debug         | repo-oss-debug (15.5)         | No      | ----      | ----    | http://download.opensuse.org/debug/distribution/leap/15.5/repo/oss
 8 | openSUSE:repo-oss-source        | repo-oss-source (15.5)        | No      | ----      | ----    | http://download.opensuse.org/source/distribution/leap/15.5/repo/oss
 9 | openSUSE:update-backports       | update-backports (15.5)       | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/backports
10 | openSUSE:update-backports-debug | update-backports-debug (15.5) | No      | ----      | ----    | http://download.opensuse.org/update/leap/15.5/backports_debug
11 | openSUSE:update-non-oss         | update-non-oss (15.5)         | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/non-oss
12 | openSUSE:update-non-oss-debug   | update-non-oss-debug (15.5)   | No      | ----      | ----    | http://download.opensuse.org/debug/update/leap/15.5/non-oss
13 | openSUSE:update-oss             | update-oss (15.5)             | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/oss
14 | openSUSE:update-oss-debug       | update-oss-debug (15.5)       | No      | ----      | ----    | http://download.opensuse.org/debug/update/leap/15.5/oss
15 | openSUSE:update-sle             | update-sle (15.5)             | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/sle
16 | openSUSE:update-sle-debug       | update-sle-debug (15.5)       | No      | ----      | ----    | http://download.opensuse.org/debug/update/leap/15.5/sle
17 | packman                         | packman                       | Yes     | (r ) Yes  | Yes     | https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.5/
18 | snappy                          | snappy                        | Yes     | (r ) Yes  | Yes     | https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.5

As the error message suggests i filed bug 1215790 1215790 – zypper reports Repository already exists

There is no bug here. You apparently have package openSUSE-repos-Leap installed and this package defines zypper service which gets actual repository definitions from the central server. These definitions are updated every time you do zypper refresh. You obviously cannot manually edit these autogenerated repositories - they are completely managed by zypper service. See man zypper for more details about repository service.

@gerben:

Yes, that’s perfectly normal on Leap 15.5 systems:

 > file /var/cache/zypp/geoip.d/download.opensuse.org 
/var/cache/zypp/geoip.d/download.opensuse.org: very short file (no magic)
 > 
 > od /var/cache/zypp/geoip.d/download.opensuse.org 
0000000 000012
0000001
 >

On this Leap 15.5 system –

 > rpm --query --whatprovides /var/lib/YaST2/system_packages_repos.yaml
file /var/lib/YaST2/system_packages_repos.yaml is not owned by any package
 >

AFAICS, “system_packages_repos.yaml” contains a history of all the repositories which were ever used by the system –

  • My copy of that file lists Leap 15.1, Leap 15.2, Leap 15.3, Leap 15.4 and Leap 15.5 repositories …

On this Leap 15.5 system there ain’t no ‘/usr/share/zypp’ “local” directory –

 > l /usr/share/zypp/
insgesamt 20
drwxr-xr-x   3 root root  4096 28. Aug 08:17 ./
drwxr-xr-x 388 root root 12288 25. Aug 11:50 ../
drwxr-xr-x   3 root root  4096 28. Aug 08:17 schema/
 >

I can’t find any reference to that “local” directory in either the Zypp or the Zypper documentation.

  • Please check with “rpm --query --whatprovides /usr/share/zypp/local” to find out which package dropped that directory tree into your system directories.

system_packages_repos.yaml is the same on my 15.5 system.

$ rpm --query --whatprovides /usr/share/zypp/local
openSUSE-repos-Leap-20230804.41e41a9-lp155.2.6.1.x86_64

OK, my yast issues are over: somehow the upgrade installed package openSUSE-repos-Leap. As arvidjaar says this package defines zypper service which gets actual repository definitions from the central server. These definitions are updated every time you do zypper refresh

This failed because i also had repositories defined from my Leap 15.4 days and these didn’t get removed.

For the time being i have removed packes openSUSE-repos-Leap and openSUSE-repos-Leap-NVIDIA (which requires it) and now zypper and yast2 behave as expected…

However i still have the problem with shutting down my system with KDE :frowning: It still leads to a suspend.

Does this also happen with another user?

  • Simply create with YaST a new, fresh, pristine, test user and, login to that user …

It also happens with a freshly added user. KDE shutdown leads t o suspend (and to my surprise also KDE logout leads leads to a restart)

Since i also had troubles with my display configuration (laptop in docking station with two external displays, one via VGA and one via DPI, screen closed) where my configuration always came up with the internal LCD screen + one external screen).
So far i had to re-configure the display settings on each new login and disable the internal LCD screen and enable the second external screen.
With 15.5 i also got the NVIDIA service enabled so during the installation a lot of nvidia packages got installed. I tried to remove all nvidia stuff, but ended up with an unworkable system.

So i did a clean install of Leap 15.5 and everything worked fine, i.e. KDE shutdown and my display configuration. Next i enabled the GPG key for the NVIDIA stuff (forgot the exact name), a lot of nvidia packages got installed and my troubles were back.

So i again installed Leap 15.5 without the GPG key for NVIDIA and everything is still fine (except that i have to redo a lot of package installations and configurations (like virtual box, thunderbird and what else is still missing …)

So my conclusion: stay away from NVIDIA software.

Which is one of the reasons I prefer to use AMD hardware – despite KDE Plasma usually displaying a more consistent behaviour when running on Intel hardware … :upside_down_face:

  • I’m thinking of the behaviour when multiple user sessions are activated on AMD machines

@dcurtisfra

Do you think I should file a bug against the NVIDIA service ???
Thanks for all your help.

This thread contains no evidence that Nvidia itself causes your issue. There are more questions than real facts about it.

Simply adding a GPG key does not cause any issues.

Nvidia packages does not install magically itself. You say what to install and only a really small set of requires get pulled.

After removal of Nvidia drivers you also need to remove the nouveau blacklist or your system won’t work. That is normal.

As this seems to be an Optimus laptop, you need something like prime or bbswitch or…

This thread does neither contain any hardware informations or any hints which Nvidia drivers you tried to install…so blaming Nvidia without providing some additional informations is maybe the wrong approach.

Just doing a default installation on my laptop installs openSUSE-repos-Leap-NVIDIA.
If I next go to the “Software repositories” → “GPG Keys” and enable the certificate, a whole bunch of packages get installed, all related to “nvidia”. Next my laptop become unusable. I didn’t say anything here, just clicked one OK.

This assumes I know all about graphics, the software and which combinations don’t work. This isn’t the case.
I simply installed Leap 15.5 and it didn’t work due to this Nvidia stuff.