GTK issue – Can’t run synaptic

Forum Forums General Software GTK issue – Can’t run synaptic

  • This topic has 44 replies, 7 voices, and was last updated Apr 29-9:37 pm by dukester.
Viewing 15 posts - 1 through 15 (of 45 total)
  • Author
    Posts
  • #105458
    Member
    dukester

      inxi -S
      System:
      Host: antixbox.org Kernel: 4.9.235-antix.1-amd64-smp arch: x86_64 bits: 64
      Desktop: Fluxbox v: 1.3.7 Distro: antiX-19.3_x64-full Manolis Glezos 15
      October 2020

      sudo synaptic
      Unable to init server: Could not connect: Connection refused
      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

      So I tried to re-install synaptic:

      blah blah

      Processing triggers for man-db (2.9.4-2) …
      Processing triggers for menu (2.1.48) …
      Unable to init server: Could not connect: Connection refused
      Unable to init server: Could not connect: Connection refused
      Writing Menu: icewm

      (desktop-menu:3636): Gtk-CRITICAL **: 08:29:52.209: gtk_icon_theme_get_for_screen: assertion ‘GDK_IS_SCREEN (screen)’ failed
      Traceback (most recent call last):
      File “/usr/local/bin/desktop-menu”, line 328, in <module>
      build_menu()
      File “/usr/local/bin/desktop-menu”, line 300, in build_menu
      process_menu(menu)
      File “/usr/local/bin/desktop-menu”, line 134, in process_menu
      icon = find_icon(entry) or default_folder_icon
      File “/usr/local/bin/desktop-menu”, line 105, in find_icon
      if icon_theme.lookup_icon(appicon, icon_size, 0):
      AttributeError: ‘NoneType’ object has no attribute ‘lookup_icon’

      The above issue occurred out of nowhere it seems. I have not messed with anything lately, let alone any GTK stuff.
      Not to my knowledge anyway. How would I re-install GTK? And what’s this “Unable to init server: Could not connect: Connection refused” issue? Never had that one pop up before!! TIA …

      --
      dukester

      #105465
      Member
      sybok
        Helpful
        Up
        0
        ::

        My wild guess – there must have been a recent update (see ‘/var/log/apt/history.log’) that messed things up (or your system got corrupted).
        You could downgrade the package that caused this, mark it as held (to prevent upgdate) and wait till things are resolved on the Debian|antiX side (wherever the cause lies), then remove the hold (i.e. “unmark” the package).

        Please post synaptic version (e.g. using ‘apt-cache policy synaptic’) and output of ‘inxi -r’.

        #105471
        Member
        dukester
          Helpful
          Up
          0
          ::

          Thx Sybok for your reply!

          apt-cache policy synaptic
          synaptic:
          Installed: 0.90.2+antix1
          Candidate: 0.90.2+antix1
          Version table:
          *** 0.90.2+antix1 500
          500 http://ftp.cc.uoc.gr/mirrors/linux/mx/antix/buster buster/main amd64 Packages
          100 /var/lib/dpkg/status
          0.84.6 500
          500 http://debian.otenet.gr/debian buster/main amd64 Packages

          inxi -r
          Repos:
          No active apt repos in: /etc/apt/sources.list
          Active apt repos in: /etc/apt/sources.list.d/antix.list
          1: deb http://ftp.cc.uoc.gr/mirrors/linux/mx/antix/buster/ buster main nonfree nosystemd
          No active apt repos in: /etc/apt/sources.list.d/balena-etcher.list
          No active apt repos in: /etc/apt/sources.list.d/bullseye-backports.list
          Active apt repos in: /etc/apt/sources.list.d/buster-backports.list
          1: deb http://deb.debian.org/debian/ buster-backports main contrib non-free
          No active apt repos in: /etc/apt/sources.list.d/crystal.list
          No active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
          Active apt repos in: /etc/apt/sources.list.d/debian.list
          1: deb http://debian.otenet.gr/debian/ buster non-free contrib main
          2: deb http://security.debian.org/ buster/updates non-free contrib main
          No active apt repos in: /etc/apt/sources.list.d/miktex.list
          No active apt repos in: /etc/apt/sources.list.d/onion.list
          No active apt repos in: /etc/apt/sources.list.d/smlsharp.list
          No active apt repos in: /etc/apt/sources.list.d/various.list

          I looked at the log file. The only recent entry that might have caused the issue was a recent icewm update/upgrade. How would I downgrade that culprit?

          --
          dukester

          #105473
          Forum Admin
          anticapitalista
            Helpful
            Up
            1
            ::

            Although it is disabled (now), this worries me (amongst other repos you now have disabled) as you may have installed something from this/(those) repo that has broken your buster based install.

            No active apt repos in: /etc/apt/sources.list.d/bullseye-backports.list

            Philosophers have interpreted the world in many ways; the point is to change it.

            antiX with runit - leaner and meaner.

            #105474
            Member
            dukester
              Helpful
              Up
              0
              ::

              Maybe! However, I’ve never had this problem in the past! I’ve had a few GTK warnings when running `mupdf’, but it always ran OK. I’m almost sure that it’s that bloody icewm update. It seems that there’s an “atk-bridge” issue on my system. Any ideas there? Thanks for your input.

              --
              dukester

              #105482
              Forum Admin
              anticapitalista
                Helpful
                Up
                0
                ::

                icewm update on my antiX-19 system does not cause any issues.
                It must be something else.

                Philosophers have interpreted the world in many ways; the point is to change it.

                antiX with runit - leaner and meaner.

                #105483
                Member
                dukester
                  Helpful
                  Up
                  0
                  ::

                  Right! But what do these lines refer to?

                  Processing triggers for menu (2.1.48) …
                  Unable to init server: Could not connect: Connection refused
                  Unable to init server: Could not connect: Connection refused
                  Writing Menu: icewm

                  Unable to init which server? Is this a network issue? Or a local daemon refusing to connect because of permissions?

                  --
                  dukester

                  #105488
                  Member
                  RJP
                    Helpful
                    Up
                    0
                    ::

                    Graphical applications should not run with sudo, because it messes privileges. Use gksu instead of sudo.

                    To fix privileges run

                    sudo chown -Rc $USER:$USER $HOME

                    … after that try to open Synaptic

                    gksu synaptic

                    Check also if there is enough room

                    df -h / /home

                    • This reply was modified 1 week, 5 days ago by RJP.
                    • This reply was modified 1 week, 5 days ago by RJP.
                    • This reply was modified 1 week, 5 days ago by RJP.
                    #105493
                    Member
                    dukester
                      Helpful
                      Up
                      0
                      ::

                      Thx RJP! Ran chown as suggested!

                      gksu 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

                      --
                      dukester

                      #105494
                      Member
                      RJP
                        Helpful
                        Up
                        0
                        ::

                        Try
                        export DISPLAY=:0 && gksu synaptic

                        #105498
                        Member
                        sybok
                          Helpful
                          Up
                          0
                          ::

                          Strange.
                          I do run ‘sudo synaptic’ without problems (did so in the past, can do on my *testing* based on antiX-21_x64-full with synaptic version 0.91.3+antix2).
                          It works in ‘fluxbox’ which @dukester uses.
                          I know that there was a change in su[do] dealing with environments.
                          Could you try the following command
                          sudo -E synaptic
                          instead (man sudo: -E, –preserve-env)?

                          Unable to init server: Could not connect: Connection refused

                          My guess is that sudo is a kinda “ssh [-X] to another user” and when the graphics privileges are set differently, an error occurs.
                          Similar warnings|errors are reported when I ssh to another system and upgrade there – something about (GTK and Python) icon and NoneType.

                          I searched the interweb for the warning|error @dukester mentioned, it is often mentioned when ‘ssh’ to another machine.
                          Someone suggested a fix for ssh and running as root though I cannot comment on whether it could do more harm (in security?) than good:
                          https://techoverflow.net/2023/02/06/how-i-fixed-ssh-x11-forwarding-sudo-unable-to-init-server-could-not-connect-connection-refused/

                          Also, I found this:
                          https://superuser.com/questions/1657180/x11-forwarding-unable-to-init-server-could-not-connect-connection-refused-wh <– ssh, xauth missing on the target machine
                          https://forum.qubes-os.org/t/qubes-users-debian-10-vm-unable-to-init-server-could-not-connect-connection-refused/2916 <– full disc as @RJP asked to check

                          PS: There was a synaptic issue in the past (2018: Wayland vs. X11, not working in Wayland) causing quite an upheaval.
                          https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897348
                          I doubt that this one is related.

                          #105501
                          Member
                          RJP
                            Helpful
                            Up
                            0
                            ::

                            An another “dirty” way launch Synaptic could be

                            su -c 'x-terminal-emulator -e synaptic' root

                            #105532
                            Member
                            dukester
                              Helpful
                              Up
                              0
                              ::

                              Could you try the following command
                              sudo -E synaptic
                              instead (man sudo: -E, –preserve-env)?

                              That solved the problem my friend!! Merci-danke-muchias gracias-thanks a bunch!!

                              I have plenty of room on my HDD:

                              df -h / /home
                              Filesystem Size Used Avail Use% Mounted on
                              /dev/sda1 458G 236G 199G 55% /
                              /dev/sda1 458G 236G 199G 55% /

                              So what could have gone wrong all of a sudden? ssh!? I hardly ever use it, and certainly haven’t in the last few months.

                              Anyway, you supplied a solution and I’m grateful!
                              Thank you and every respondent for your input!

                              --
                              dukester

                              #105533
                              Member
                              sybok
                                Helpful
                                Up
                                0
                                ::

                                I would not blame ‘ssh’ which I used as an analogy of my (poor?) understanding of ‘sudo’.
                                This is something about environment variables not being set correctly for synaptic to run when invoked with simple ‘sudo’ (some crucial information about the environment does no longer survive when calling ‘sudo’) but the switch ‘-E’ saves the day.

                                I experienced something similar when running ‘sudo mc’ (to be able to copy to some root-mounted device) did not remember my aliases designed to switch to several directories easily. When ‘mc’ was invoked with ‘sudo -E’, the aliases (defined in my user environment) became available again.

                                #105534
                                Member
                                dukester
                                  Helpful
                                  Up
                                  0
                                  ::

                                  BTW, gksu -k synaptic also works!

                                  --
                                  dukester

                                Viewing 15 posts - 1 through 15 (of 45 total)
                                • You must be logged in to reply to this topic.