-1

Due to this error, my terminal is neither opening from shortcut key (CTRL+ALT+T] nor from launcher. It only opens from "Open Terminal" option by right clicking on desktop.

prateek@Home-Alone:~$ sudo apt-get upgrade
[sudo] password for prateek: Reading package lists... Done
Building dependency tree Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

prateek@Home-Alone:~$ sudo apt-get update 
Ign:1 http://dl.google.com/linux/chrom... stable InRelease
Hit:2 Index of /node_8.x/ xenial InRelease 
Hit:3 Index of /ubuntu xenial InRelease 
Hit:4 Index of /repos/vscode/ stable InRelease 
Hit:5 Index of /atareao/atareao/ubuntu xenial InRelease 
Hit:6 Index of /damien-moore/codeblocks-stable/ubuntu xenial InRelease
Hit:7 https://cli-assets.heroku.com/br... ./ InRelease 
Get:8 Index of /ubuntu xenial-security InRelease [107 kB] 
Hit:9 http://linux.teamviewer.com/deb stable InRelease 
Ign:10 http://dl.google.com/linux/chrom... stable InRelease 
Get:11 Index of /ubuntu xenial-updates InRelease [109 kB] 
Hit:12 Index of /jonathonf/python-3.6/ubuntu xenial InRelease 
Hit:13 http://linux.teamviewer.com/deb preview InRelease 
Hit:14 http://dl.google.com/linux/chrom... stable Release 
Get:15 Index of /ubuntu xenial-backports InRelease [107 kB] 
Hit:16 Index of /openshot.developers/ppa/ubuntu xenial InRelease
Hit:18 Index of /paolorotolo/android-studio/ubuntu xenial InRelease
Hit:19 http://dl.google.com/linux/chrom... stable Release 
Hit:20 Index of /webupd8team/java/ubuntu xenial InRelease 
Hit:22 Index of /webupd8team/y-ppa-manager/ubuntu xenial InReleaseFetched 323 kB in 2s (129 kB/s)
Error: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
Reading package lists... Done

Image of the above error

prateek@Home-Alone:~$ gnome-terminal
Traceback (most recent call last):
  File "/usr/bin/gnome-terminal", line 9, in <module>
    from gi.repository import GLib, Gio
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name '_gi'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/gnome-terminal", line 9, in <module>
    from gi.repository import GLib, Gio
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name '_gi'

I think due to this I'm unable to launch my terminal.



UPDATE: Now only software updater problem is left unsolved. Please help!

prateek@Home-Alone:~$ software-properties-gtk

Traceback (most recent call last):

  File "/usr/bin/software-properties-gtk", line 32, in <module>
    import aptsources

  File "/usr/lib/python3/dist-packages/aptsources/__init__.py", line 3, in <module>

    import apt_pkg

ModuleNotFoundError: No module named 'apt_pkg'

Error in sys.excepthook:

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook

    from apport.fileutils import likely_packaged, get_recent_crashes

  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>

    from apport.report import Report

  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils

  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging

  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt

  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg

ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:

Traceback (most recent call last):

  File "/usr/bin/software-properties-gtk", line 32, in <module>
    import aptsources

  File "/usr/lib/python3/dist-packages/aptsources/__init__.py", line 3, in <module>
    import apt_pkg

ModuleNotFoundError: No module named 'apt_pkg'
  • A 'GDbus.Error' (instead of a 'DBus.Error') implies that the problem seems to be coming from Gnome instead of apt. Note also that apt continues working ("Reading package lists") after the error . The problem seems to be related to your other desktop GUI faults, not to package management. Please edit your title and tags accordingly. – user535733 Oct 14 '18 at 6:44
  • Thanks Kulfy ! it worked. GDBus Error is resolved but my terminal is still not opening via launcher and shortcut. Also a red circle with - sign is coming on top bar. – Prateek Oct 16 '18 at 7:03
  • @Prateek for third problem, reinstall python-apt using sudo apt-get remove --purge python-apt then sudo apt-get install python-apt. And finally sudo apt-get install -f – Kulfy Oct 16 '18 at 12:20
  • @Kulfy after doing this... still getting the same error – Prateek Oct 17 '18 at 18:54
  • Your python3 might be facing issues. Reinstall python3 using sudo apt-get --reinstall install python3 – Kulfy Oct 17 '18 at 19:32
1

From Comments:

  • For GDBus error:

    Remove 20packagekit using:

    sudo rm /etc/apt/apt.conf.d/20packagekit
    

    Retry the update and upgrade:

    sudo apt-get update && sudo apt-get upgrade
    
  • For GNOME Terminal not starting:

    cd /usr/lib/python3/dist-packages/gi/
    sudo ln -s _gi.cpython-35m-x86_64-linux-gnu.so _gi.cpython-36m-x86_64-linux-gnu.so
    sudo ln -s _gi_cairo.cpython-35m-x86_64-linux-gnu.so _gi_cairo.cpython-36m-x86_64-linux-gnu.so
    
0

You could try reinstall your aptdeamon: sudo apt-get install --reinstall aptdaemon

Or/and upgrade your OS: sudo apt-get update; sudo apt-get upgrade; sudo apt-get dist-upgrade

  • Getting the same error while reinstalling aptdaemon – Prateek Oct 14 '18 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.