当我尝试更新 ubuntu 16.04 时出现此错误:
sos@sos:~$ sudo update-manager
/usr/bin/update-manager:28: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk
/usr/lib/python3/dist-packages/UpdateManager/UnitySupport.py:29: PyGIWarning: Dbusmenu was imported without specifying a version first. Use gi.require_version('Dbusmenu', '0.4') before import to ensure that the right version gets loaded.
from gi.repository import Dbusmenu, Unity
/usr/lib/python3/dist-packages/UpdateManager/UnitySupport.py:29: PyGIWarning: Unity was imported without specifying a version first. Use gi.require_version('Unity', '7.0') before import to ensure that the right version gets loaded.
from gi.repository import Dbusmenu, Unity
Traceback (most recent call last):
File "/usr/bin/apt.py", line 21, in <module>
from ros_buildfarm.wrapper.apt import main
ImportError: No module named 'ros_buildfarm'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/update-manager", line 38, in <module>
from UpdateManager.UpdateManager import UpdateManager
File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 57, in <module>
from .MetaReleaseGObject import MetaRelease
File "/usr/lib/python3/dist-packages/UpdateManager/MetaReleaseGObject.py", line 25, in <module>
from .Core.MetaRelease import MetaReleaseCore
File "/usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py", line 25, in <module>
import apt
File "/usr/bin/apt.py", line 25, in <module>
from ros_buildfarm.wrapper.apt import main
ImportError: No module named 'ros_buildfarm'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/bin/apt.py", line 21, in <module>
from ros_buildfarm.wrapper.apt import main
ImportError: No module named 'ros_buildfarm'
During handling of the above exception, another exception occurred:
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/bin/apt.py", line 25, in <module>
from ros_buildfarm.wrapper.apt import main
ImportError: No module named 'ros_buildfarm'
Original exception was:
Traceback (most recent call last):
File "/usr/bin/apt.py", line 21, in <module>
from ros_buildfarm.wrapper.apt import main
ImportError: No module named 'ros_buildfarm'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/update-manager", line 38, in <module>
from UpdateManager.UpdateManager import UpdateManager
File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 57, in <module>
from .MetaReleaseGObject import MetaRelease
File "/usr/lib/python3/dist-packages/UpdateManager/MetaReleaseGObject.py", line 25, in <module>
from .Core.MetaRelease import MetaReleaseCore
File "/usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py", line 25, in <module>
import apt
File "/usr/bin/apt.py", line 25, in <module>
from ros_buildfarm.wrapper.apt import main
ImportError: No module named 'ros_buildfarm'
答案1
我发现有一个/usr/bin/apt.py文件相关罗斯(机器人包)导致了这个问题。也许是apt.py被选择执行,而不是易于文件。我刚刚重命名了 apt.py 文件,问题就解决了!
cd /usr/bin
sudo mv apt.py apt-archive.py