I'm rather new to Ubuntu and I'm trying to run update-manager on Ubuntu 13.10. I get:
jacopo@jacopo-laptop:~$ update-manager
Traceback (most recent call last):
File "/usr/bin/update-manager", line 28, in <module>
from gi.repository import Gtk
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 27, in <module> from ._gi import _API
ImportError: No module named 'gi._gi'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 64, 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 20, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 21, in <module>
import apt_pkg
ImportError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "/usr/bin/update-manager", line 28, in <module>
from gi.repository import Gtk
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 27, in <module>
from ._gi import _API
ImportError: No module named 'gi._gi'
As far as I have understood, this is a problem related to the fact that I should have python3.4 installed. I installed it in /usr/local/lib
, but I always get the same error. In this way I can't even upgrade to Ubuntu 14.04.
sudo apt install --reinstall <package-name>
, because this avoids calculating and removing dependencies (and marking packages for removal). Be aware that removing packages is not always a reversible procedure; for example APT will remove itself or its dependencies if asked to! The--reinstall
flag is therefore much safer thanremove
followed byinstall
. Theremove
command by itself does not remove configuration files of a package so has no benefit overinstall --reinstall
. – Zanna Aug 08 '18 at 07:58sudo dpkg -r --force-depends apt-package
instead which uninstalls only apt-package but not any of its dependencies. – karel Aug 01 '19 at 12:15sudo apt remove --purge python3-apt
thensudo apt install python3-apt
, the weird thing is that after reinstalling, 78 really unrelated(well I don't really know) packages were marked as no longer needed and can beautoremove
.. I'm kind of concerned but at least it fixed my problem haha – Kenivia Apr 08 '20 at 23:54/usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so
but am getting that error - the reinstall changes nothing. – xeruf May 23 '20 at 09:54ls /usr/lib/python3/dist-packages/apt_pkg.* /usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so
– loretoparisi Jan 29 '21 at 09:03