[Bug 1826686] [NEW] Problem with apt-get before upgrading to Python 3.7

Launchpad Bug Tracker 1826686 at bugs.launchpad.net
Sun Apr 28 13:46:16 UTC 2019


You have been subscribed to a public bug:

This problem ocurrs before upgrating to Python 3.7 and setted by default
python3 command and pc Restarted, don't work reinstall python3-apt to
solve this.

Ubuntu version: Ubuntu 18.04.2 TLS


if you try to execute the terminal didn't work, but with XTerm can you try:

sudo apt-get update


The result:


Hit:1 https://repo.skype.com/deb stable InRelease
Hit:2 http://co.archive.ubuntu.com/ubuntu bionic InRelease                                                
Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease                                              
Get:4 http://co.archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]                              
Hit:5 https://download.mono-project.com/repo/ubuntu vs-bionic InRelease                                   
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]                               
Hit:7 https://download.sublimetext.com apt/stable/ InRelease                                              
Get:8 http://co.archive.ubuntu.com/ubuntu bionic-backports InRelease [74,6 kB]                            
Hit:9 http://dl.google.com/linux/chrome/deb stable Release                                                
Fetched 252 kB in 1s (212 kB/s)                                                                           
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, 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 24, 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/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code

** Affects: command-not-found (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: python-upgrade
-- 
Problem with apt-get before upgrading to Python 3.7
https://bugs.launchpad.net/bugs/1826686
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to command-not-found in Ubuntu.



More information about the foundations-bugs mailing list