无法打开更新管理器或 Ubuntu 调整

无法打开更新管理器或 Ubuntu 调整

我无法打开更新管理器和 Ubuntu Tweak

当我打开 Ubuntu tweak 时,我得到了这个日志

user@laptop:~$ ubuntu-tweak

Traceback (most recent call last):
  File "/usr/bin/ubuntu-tweak", line 124, in <module>
    from ubuntutweak.main import UbuntuTweakWindow
  File "/usr/lib/python2.7/dist-packages/ubuntutweak/main.py", line 32, in <module>
    from ubuntutweak.apps import AppsPage
  File "/usr/lib/python2.7/dist-packages/ubuntutweak/apps/__init__.py", line 9, in <module>
    from aptsources.sourceslist import SourcesList
  File "/usr/lib/python2.7/dist-packages/aptsources/__init__.py", line 4, in <module>
    apt_pkg.init()
SystemError: E:Opening configuration file /etc/apt/apt.conf.d/00aptitude - ifstream::ifstream (13: Permission denied)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 4, in <module>
    from apport.report import Report
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python2.7/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 20, in <module>
    import apt
  File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 35, in <module>
    apt_pkg.init()
SystemError: E:Opening configuration file /etc/apt/apt.conf.d/00aptitude - ifstream::ifstream (13: Permission denied)

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/ubuntu-tweak", line 124, in <module>
    from ubuntutweak.main import UbuntuTweakWindow
  File "/usr/lib/python2.7/dist-packages/ubuntutweak/main.py", line 32, in <module>
    from ubuntutweak.apps import AppsPage
  File "/usr/lib/python2.7/dist-packages/ubuntutweak/apps/__init__.py", line 9, in <module>
    from aptsources.sourceslist import SourcesList
  File "/usr/lib/python2.7/dist-packages/aptsources/__init__.py", line 4, in <module>
    apt_pkg.init()
SystemError: E:Opening configuration file /etc/apt/apt.conf.d/00aptitude - ifstream::ifstream (13: Permission denied)

当我打开更新管理器时我得到了这个

user@laptop:~$ update-manager
Traceback (most recent call last):
  File "/usr/bin/update-manager", line 37, in <module>
    from UpdateManager.UpdateManager import UpdateManager
  File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 52, in <module>
    from .InstallProgress import InstallProgress
  File "/usr/lib/python3/dist-packages/UpdateManager/InstallProgress.py", line 42, in <module>
    from .Core.utils import (inhibit_sleep,
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/utils.py", line 31, in <module>
    apt_pkg.init_config()
SystemError: E:Opening configuration file /etc/apt/apt.conf.d/00aptitude - ifstream::ifstream (13: Permission denied)
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 4, 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 35, in <module>
    apt_pkg.init()
SystemError: E:Opening configuration file /etc/apt/apt.conf.d/00aptitude - ifstream::ifstream (13: Permission denied)

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/update-manager", line 37, in <module>
    from UpdateManager.UpdateManager import UpdateManager
  File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 52, in <module>
    from .InstallProgress import InstallProgress
  File "/usr/lib/python3/dist-packages/UpdateManager/InstallProgress.py", line 42, in <module>
    from .Core.utils import (inhibit_sleep,
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/utils.py", line 31, in <module>
    apt_pkg.init_config()
SystemError: E:Opening configuration file /etc/apt/apt.conf.d/00aptitude - ifstream::ifstream (13: Permission denied)

在我擦除整个 Ubuntu 根目录并使用之前现有的主分区后,就会发生这种情况。

有一个更新通知图标,我似乎无法使用,因为无法点击任何选项。此外,即使从命令行更新后,此图标也不会停止显示。

答案1

两者都与常见错误有关。为了摆脱它,

打开终端并输入

sudo chmod o+r /etc/apt/apt.conf.d/00aptitude

然后重试。

您还可以通过使用 sudo 命令以 root 用户身份启动它们来访问它们。我的意思是sudo <your_application>

相关内容