[SOLVED] Synaptic: please restart your session without Wayland, or run Synaptic without root permission

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

[SOLVED] Synaptic: please restart your session without Wayland, or run Synaptic without root permission

#1 Post by kalle123 »

Have Vbox 7.0.24 r167081 under Bookworm here and have amongst others a Debian testing as guest. But it is quite old and heavily used ....

So just have seen this thread viewtopic.php?p=817250#p817250 and tried to follow lindis advice and generate a fresh installation, install 12.9 and upgrade.

Loaded debian-12.9.0-amd64-netinst.iso (No EFI)

But when trying to do an easy upgrade by using synaptic to start with for changing the sources.list I get this here

Code: Select all

user@debian:~$ su -
Password: 
root@debian:~# synaptic
Failed to initialize GTK.

Probably you're running Synaptic on Wayland with root permission.
Please restart your session without Wayland, or run Synaptic without root permission
root@debian:~# exit
logout
user@debian:~$ echo $XDG_SESSION_TYPE
x11
user@debian:~$ synaptic
bash: synaptic: command not found
user@debian:~$ su -
Password: 
root@debian:~# apt install synaptic
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
synaptic is already the newest version (0.91.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@debian:~# 
This is not testing or SID just stable and then that?? 'Wayland' and synaptic not working out-of-the-box?
Last edited by kalle123 on 2025-02-15 15:11, edited 2 times in total.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 1344
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 136 times
Been thanked: 244 times

Re: Debian 12.9 in VBox. What is going on here?

#2 Post by wizard10000 »

I'm afraid synaptic doesn't work under Wayland.
we see things not as they are, but as we are.
-- anais nin

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: Debian 12.9 in VBox. What is going on here?

#3 Post by kalle123 »

wizard10000 wrote: 2025-02-12 17:10 I'm afraid synaptic doesn't work under Wayland.
But I was not under Wayland

Code: Select all

user@debian:~$ echo $XDG_SESSION_TYPE
x11
and this is stable!

Don't think this is OK for instance for a newbie, who just wants to have a look at Debian on his Windows machine in a VBox, got the recommendation to try Xfce and then is confronted with that Wayland <> X11 'game'.

PS. The host here is on 12.9. Disabled the auto-login in lightdm, but don't see at start-up the choice between X11 and Wayland. What has 'Wayland' thing to do in 'debian-12.9.0-amd64-netinst.iso'. I don't get it!

Aki
Global Moderator
Global Moderator
Posts: 4342
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 127 times
Been thanked: 584 times

Re: Debian 12.9 in VBox. What is going on here?

#4 Post by Aki »

Hello,

This is the code that generate the full message [1]:

Code: Select all

   if (!gtk_init_check(&argc, &argv)) {
      std::cout <<
         _("Failed to initialize GTK.\n") <<
         "\n" <<
         _("Probably you're running Synaptic on Wayland with root permission.\n") <<
         _("Please restart your session without Wayland, or run Synaptic without root permission\n");
      exit(1);
   };
According to gtk source code [2]:

Code: Select all

 * Before using GTK+, you need to initialize it; initialization connects to the
 * window system display, and parses some standard command line arguments. The
 * gtk_init() macro initializes GTK+. gtk_init() exits the application if errors
 * occur; to avoid this, use gtk_init_check(). gtk_init_check() allows you to
 * recover from a failed GTK+ initialization - you might start up your
 * application in text mode instead.
This is the source code for for gtk_init_check [3]:

Code: Select all

/**
 * gtk_init_check:
 * @argc: (inout): Address of the `argc` parameter of
 *     your main() function (or 0 if @argv is %NULL). This will be changed if 
 *     any arguments were handled.
 * @argv: (array length=argc) (inout) (allow-none): Address of the
 *     `argv` parameter of main(), or %NULL. Any options
 *     understood by GTK+ are stripped before return.
 *
 * This function does the same work as gtk_init() with only a single
 * change: It does not terminate the program if the windowing system
 * can’t be initialized. Instead it returns %FALSE on failure.
 *
 * This way the application can fall back to some other means of
 * communication with the user - for example a curses or command line
 * interface.
 *
 * Returns: %TRUE if the windowing system has been successfully
 *     initialized, %FALSE otherwise
 */
gboolean
gtk_init_check (int    *argc,
                char ***argv)
{
  gboolean ret;

  if (!gtk_parse_args (argc, argv))
    return FALSE;

  ret = gdk_display_open_default_libgtk_only () != NULL;

  if (debug_flags & GTK_DEBUG_INTERACTIVE)
    gtk_window_set_interactive_debugging (TRUE);

  return ret;
}
This is the source code for gdk_display_open_default_libgtk_only function (used by gtk_init_check): [4]

Code: Select all

/**
 * gdk_display_open_default_libgtk_only:
 *
 * Opens the default display specified by command line arguments or
 * environment variables, sets it as the default display, and returns
 * it. gdk_parse_args() must have been called first. If the default
 * display has previously been set, simply returns that. An internal
 * function that should not be used by applications.
 *
 * Returns: (nullable) (transfer none): the default display, if it
 *   could be opened, otherwise %NULL.
 **/
GdkDisplay *
gdk_display_open_default_libgtk_only (void)
{
  GdkDisplay *display;

  g_return_val_if_fail (gdk_initialized, NULL);

  display = gdk_display_get_default ();
  if (display)
    return display;

  display = gdk_display_open (gdk_get_display_arg_name ());

  return display;
}
So, it seems that synaptic tries opening the X11 display, but it fails.

As suggested in the error message:
run Synaptic without root permission
you must run synaptic as normal (not root) user, as usual, like that (from command line):

Code: Select all

$ synaptic-pkexec
Hope this helps.

--
notes:
1) please update the subject of the first post from "Debian 12.9 in VBox. What is going on here?" to "Synaptic with Debian 12.9: please restart your session without Wayland, or run Synaptic without root permission"
2) discussion moved from "Installation" to "Beginners Questions"

--
[1] synaptic/0.91.5/gtk/gsynaptic.cc/#L410
[2] Gtkinit_check
[3] gtk_init_check source code
[4] gdk_display_open_default_libgtk_only source code
[5] gdk_display_open source code
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: Debian 12.9 in VBox. What is going on here?

#5 Post by kalle123 »

@Aki

Thank you for taking your time to try to explain. That here works ...

Screenshot_2025-02-12_22-50-15.jpg
Screenshot_2025-02-12_22-50-15.jpg (68.25 KiB) Viewed 811 times
and also APPLICATIONS > SYSTEM > synaptic open the PW window and starts the program.

That 'Wayland' implementation into Xfce at that stage into stable is not a problem for me here. I only ask myself, 'What's the heck?'

Aki
Global Moderator
Global Moderator
Posts: 4342
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 127 times
Been thanked: 584 times

Re: Debian 12.9 in VBox. What is going on here?

#6 Post by Aki »

Hello,
kalle123 wrote: 2025-02-12 22:06 That 'Wayland' implementation into Xfce at that stage into stable is not a problem for me here. I only ask myself, 'What's the heck?'
Sorry, I don't understand. Everything is working as expected.

By the way, XFCE does not yet support Wayland (according to [1]).

--
[1] https://wiki.debian.org/Wayland
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: Debian 12.9 in VBox. What is going on here?

#7 Post by kalle123 »

Maybe I got things wrong here.

Got the impression, that Wayland was somehow implemented in 12.9

br

Aki
Global Moderator
Global Moderator
Posts: 4342
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 127 times
Been thanked: 584 times

Re: Debian 12.9 in VBox. What is going on here?

#8 Post by Aki »

Hello,
kalle123 wrote: 2025-02-13 07:22 Maybe I got things wrong here.
Probably.
kalle123 wrote: 2025-02-13 07:22 Got the impression, that Wayland was somehow implemented in 12.9
Wayland is released in Debian 12.9, but the release of XFCE in Debian Stable does not support Wayland.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: Debian 12.9 in VBox. What is going on here?

#9 Post by kalle123 »

Aki wrote: 2025-02-13 18:31 Wayland is released in Debian 12.9, but the release of XFCE in Debian Stable does not support Wayland.
I stumbled over this here

Screenshot_2025-02-13_19-37-26.jpg
Screenshot_2025-02-13_19-37-26.jpg (11.74 KiB) Viewed 714 times

Then why 'Xfce Session (Wayland)' ??

Aki
Global Moderator
Global Moderator
Posts: 4342
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 127 times
Been thanked: 584 times

Re: Debian 12.9 in VBox. What is going on here?

#10 Post by Aki »

Is it the greeter of the gnome display manager (gdm3) ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: Debian 12.9 in VBox. What is going on here?

#11 Post by kalle123 »

Code: Select all

user@debian:~$ systemctl status display-manager
● lightdm.service - Light Display Manager
     Loaded: loaded (/usr/lib/systemd/system/lightdm.service; enabled; preset: >
     Active: active (running) since Fri 2025-02-14 08:04:38 CET; 3min 40s ago
 Invocation: bfe9c36ec8584cdf8e2fd0b1f9e76414
       Docs: man:lightdm(1)
   Main PID: 902 (lightdm)
      Tasks: 6 (limit: 4628)
     Memory: 127M (peak: 129.3M)
        CPU: 3.526s
     CGroup: /system.slice/lightdm.service
             ├─902 /usr/sbin/lightdm
             └─914 /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/roo>
Screenshot_2025-02-14_08-10-34.jpg
Screenshot_2025-02-14_08-10-34.jpg (35.19 KiB) Viewed 662 times
I don't know, what to think about that ....

Aki
Global Moderator
Global Moderator
Posts: 4342
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 127 times
Been thanked: 584 times

Re: Debian 12.9 in VBox. What is going on here?

#12 Post by Aki »

Hello,
kalle123 wrote: 2025-02-13 19:26
Aki wrote: 2025-02-13 18:31 Wayland is released in Debian 12.9, but the release of XFCE in Debian Stable does not support Wayland.
I stumbled over this here
[..]
Then why 'Xfce Session (Wayland)' ??
I suspect that you have probably installed some packages (e.g. xfce4-session) from Debian Trixie (testing) or Debian Sid (unstable) in Debian Stable (12.9).

While Debian Stable (Bookworm) provides xfce4-session version 4.18, Debian Testing/Unstable provides xfce4-session version 4.20 (with initial support for wayland).

The Testing/Unstable version ships with this session configuration file for Wayland, which is read by lightdm for the menu in the image above:
  • xfce4-session/4.20.0-2/xfce-wayland.desktop.in/:

    Code: Select all

    [Desktop Entry]
    Version=1.0
    Name=Xfce Session (Wayland)
    Comment=Use this session to run Xfce as your desktop environment
    Exec=startxfce4 --wayland
    Icon=
    Type=Application
    DesktopNames=XFCE
    Keywords=xfce;wayland;desktop;environment;session;
    
The file xfce-wayland.desktop should be installed in /usr/share/wayland-sessions/.

This file is not provided in the package from Debian Stable.

This should be the explanation.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: Debian 12.9 in VBox. What is going on here?

#13 Post by kalle123 »

It is strange ....
So just have seen this thread viewtopic.php?p=817250#p817250 and tried to follow lindis advice and generate a fresh installation, install 12.9 and upgrade.
Installed 12.9 (net-installer). In terminal installed the mc. Added 'user' in /etc/groups for sudo. Then in synaptic changed the sources.list from bookworm to trixie. Upgrade with synaptic. That was on the 13th. Added the vbox guest additions and gcc + make. Oxygen theme and conky. That's it!
Screenshot_2025-02-15_08-22-26.jpg
Screenshot_2025-02-15_08-22-26.jpg (81.38 KiB) Viewed 592 times
I don't get, at what step that I made, lightdm was enhanced with that Wayland option?

Aki
Global Moderator
Global Moderator
Posts: 4342
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 127 times
Been thanked: 584 times

Re: Debian 12.9 in VBox. What is going on here?

#14 Post by Aki »

Hello,
kalle123 wrote: 2025-02-15 07:56 Installed 12.9 (net-installer). In terminal installed the mc. Added 'user' in /etc/groups for sudo. Then in synaptic changed the sources.list from bookworm to trixie. Upgrade with synaptic. That was on the 13th. Added the vbox guest additions and gcc + make. Oxygen theme and conky. That's it!
[..]
So, you are not running a Debian 12.9 (as stated in the topic), but you are running a Debian 13 (Testing, nicknamed Trixie) .
kalle123 wrote: 2025-02-15 07:56 I don't get, at what step that I made, lightdm was enhanced with that Wayland option?
The /usr/share/wayland-sessions/xfce-wayland.desktop was installed when you upgraded from Debian 12.9 to Debian 13, according to your quote above.

Please update the subject of the first post from "Debian 12.9 in VBox. What is going on here?" to "Synaptic: please restart your session without Wayland, or run Synaptic without root permission".
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: Debian 12.9 in VBox. What is going on here?

#15 Post by kalle123 »

Aki wrote: 2025-02-15 08:13 So, you are not running a Debian 12.9 (as stated in the topic), but you are running a Debian 13 (Testing, nicknamed Trixie) .
Aki, I think I made this clear in the 1st post in this thread here.

I am preparing a bit for the oncoming chance from bookworm to trixie and I am not one of those users, who change on the release day.

And I know that the Xfce and Wayland thing is not 100% and that there are still some glitches.

I know, that there can be problems doing a release upgrade. No one has a problem, only me :D

https://lists.debian.org/debian-boot/20 ... 00225.html

But I think, we can close that here.

br KH

Aki
Global Moderator
Global Moderator
Posts: 4342
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 127 times
Been thanked: 584 times

Re: Debian 12.9 in VBox. What is going on here?

#16 Post by Aki »

Hello,
kalle123 wrote: 2025-02-15 10:01 I am preparing a bit for the oncoming chance from bookworm to trixie and I am not one of those users, who change on the release day.
And I know that the Xfce and Wayland thing is not 100% and that there are still some glitches.
I know, that there can be problems doing a release upgrade. No one has a problem, only me :D
[..]
Absolutely.
kalle123 wrote: 2025-02-15 10:01 But I think, we can close that here.
So, probably you can mark the discussion as solved adding the tag [Solved] at the beginning of the subject of the first post.

Have a nice day.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
kalle123
Posts: 421
Joined: 2015-03-21 11:17
Location: Rhineland - Germany
Has thanked: 6 times
Been thanked: 19 times

Re: Debian 12.9 in VBox. What is going on here?

#17 Post by kalle123 »

Aki wrote: 2025-02-15 13:35 So, probably you can mark the discussion as solved adding the tag [Solved] at the beginning of the subject of the first post.

Have a nice day.
For sure. Same to you :wink:

br KH

eamanu
Debian Developer
Debian Developer
Posts: 43
Joined: 2020-07-12 21:37
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: [SOLVED] Synaptic: please restart your session without Wayland, or run Synaptic without root permission

#18 Post by eamanu »

@Best_Threads

Post Reply