Unable to open Update Manager

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
ckdidit
Level 1
Level 1
Posts: 5
Joined: Sat Nov 10, 2018 11:28 pm

Unable to open Update Manager

Post by ckdidit » Sat Nov 10, 2018 11:34 pm

I'm unable to open Update Manager or run apt update/upgrade commands from the command line. I'm receiving the following error line before the update command errors out:

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol _ZN9pkgSystem9LockInnerEv version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference
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
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol _ZN9pkgSystem9LockInnerEv version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

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/CommandNotFound/db/creator.py", line 11, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so: symbol _ZN9pkgSystem9LockInnerEv version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference
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

gm10
Level 12
Level 12
Posts: 4092
Joined: Thu Jun 21, 2018 5:11 pm

Re: Unable to open Update Manager

Post by gm10 » Sun Nov 11, 2018 2:54 am

Please post output of these terminal commands (copy & paste, please enclose the output in code tags using the </> icon in the post editor):

Code: Select all

inxi -Sr
and

Code: Select all

apt policy apt libapt-pkg5.0 python3-commandnotfound

ckdidit
Level 1
Level 1
Posts: 5
Joined: Sat Nov 10, 2018 11:28 pm

Re: Unable to open Update Manager

Post by ckdidit » Sun Nov 11, 2018 7:28 am

Sure thing.

1st command results:

Code: Select all

$ inxi -Sr
System:    Host: CKMINTYFRESH Kernel: 4.15.0-34-generic x86_64 bits: 64
           Desktop: Cinnamon 3.8.9  Distro: Linux Mint 19 Tara
Repos:     Active apt sources in file: /etc/apt/sources.list.d/mscore-ubuntu-mscore-stable-bionic.list
           deb http://ppa.launchpad.net/mscore-ubuntu/mscore-stable/ubuntu bionic main
           deb-src http://ppa.launchpad.net/mscore-ubuntu/mscore-stable/ubuntu bionic main
           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://packages.linuxmint.com tara main upstream import backport
           deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ bionic partner
           Active apt sources in file: /etc/apt/sources.list.d/vscode.list
           deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
2nd command results:

Code: Select all

apt:
  Installed: 1.6.3ubuntu0.1
  Candidate: 1.6.6
  Version table:
     1.6.6 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
 *** 1.6.3ubuntu0.1 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.6.1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
libapt-pkg5.0:
  Installed: 1.6.3ubuntu0.1
  Candidate: 1.6.6
  Version table:
     1.6.6 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
 *** 1.6.3ubuntu0.1 500
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.6.1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
python3-commandnotfound:
  Installed: 18.04.5
  Candidate: 18.04.5
  Version table:
 *** 18.04.5 500
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages
        100 /var/lib/dpkg/status
     18.04.4 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic/main i386 Packages

gm10
Level 12
Level 12
Posts: 4092
Joined: Thu Jun 21, 2018 5:11 pm

Re: Unable to open Update Manager

Post by gm10 » Sun Nov 11, 2018 9:02 am

Weird. Run this:

Code: Select all

sudo rm /etc/apt/apt.conf.d/50command-not-found
followed by:

Code: Select all

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
If that generates errors, please post.

Otherwise continue with:

Code: Select all

apt install --reinstall command-not-found libapt-pkg5.0
apt update
and hopefully see this run through correctly now as well as Update Manager working again. Otherwise post error message and I'll have to scratch my head a bit more. ;)

ckdidit
Level 1
Level 1
Posts: 5
Joined: Sat Nov 10, 2018 11:28 pm

Re: Unable to open Update Manager

Post by ckdidit » Sun Nov 11, 2018 10:30 am

An error popped up on the upgrade command:

Code: Select all

sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 python-apt : Depends: libapt-inst2.0 (>= 1.6.5~) buI tried runningt 1.6.3ubuntu0.1 is installed
              Depends: libapt-pkg5.0 (>= 1.6.5~) but 1.6.3ubuntu0.1 is installed
 python3-apt : Depends: libapt-inst2.0 (>= 1.6.5~) but 1.6.3ubuntu0.1 is installed
               Depends: libapt-pkg5.0 (>= 1.6.5~) but 1.6.3ubuntu0.1 is installed
 shim-signed : Depends: shim (= 13-0ubuntu2) but 15+1533136590.3beb971-0ubuntu1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

gm10
Level 12
Level 12
Posts: 4092
Joined: Thu Jun 21, 2018 5:11 pm

Re: Unable to open Update Manager

Post by gm10 » Sun Nov 11, 2018 10:42 am

Ah, so it was the python-apt packages that had the wrong version, should have had you check those as well in the initial post. Did you update those manually or how did this come to be?

The shim-signed error should not happen though. Please go Mint menu > Software Sources > Restore default settings and update the cache.

Then

Code: Select all

apt install -f
which hopefully runs through, then back to apt upgrade and the rest above.

If the shim-signed error doesn't go away, please post output of

Code: Select all

apt showhold
apt policy shim-signed

ckdidit
Level 1
Level 1
Posts: 5
Joined: Sat Nov 10, 2018 11:28 pm

Re: Unable to open Update Manager

Post by ckdidit » Sun Nov 11, 2018 10:49 am

Did you update those manually or how did this come to be?
I've been doing some Python development on this computer using newer versions of Python. I'm assuming that somehow things got tied up.
Please go Mint menu > Software Sources > Restore default settings and update the cache.
I can't open up any of the GUI applets for updates or sources. Is there a way to set the defaults through the command line? BTW, I really appreciate the help.

gm10
Level 12
Level 12
Posts: 4092
Joined: Thu Jun 21, 2018 5:11 pm

Re: Unable to open Update Manager

Post by gm10 » Sun Nov 11, 2018 11:00 am

ckdidit wrote:
Sun Nov 11, 2018 10:49 am
I can't open up any of the GUI applets for updates of sources. Is there a way to set the defaults through the command line? BTW, I really appreciate the help.
Ouch. So basically you hosed your entire python environment? If you installed your python3 version locally but in the PATH then just move it out of the path and things should start working again. If you did it system-wide you'll have to roll all the package back to Ubuntu's versions.

If you want to go back to the default mirrors first, they are found in /usr/share/mintsources/tara/mintsources.conf, replace the respective entries in /etc/apt/sources.list.d/official-package-repositories.list.

Next time consider using Timeshift before breaking things. ;)

ckdidit
Level 1
Level 1
Posts: 5
Joined: Sat Nov 10, 2018 11:28 pm

Re: Unable to open Update Manager

Post by ckdidit » Sun Nov 11, 2018 11:08 am

Next time consider using Timeshift before breaking things. ;)
Thanks. I forgot about Timeshift. I have been using it sporadically so that will get things back to a usable state. Thanks again for the help.

Post Reply

Return to “Newbie Questions”