包管理损坏,出现许多“[Errno 2] 没有这样的文件或目录”错误

包管理损坏,出现许多“[Errno 2] 没有这样的文件或目录”错误

昨天,我尝试更新英特尔驱动程序并重新启动。我不记得或没有我使用过的命令,但自从重新启动后,我无法安装任何软件或尝试修复我的电脑。我对 Ubuntu 还比较陌生,我不知道我搞砸了什么,但我相信这与 python 版本问题有关。

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
    libc-ares2 libjs-bootstrap libjs-excanvas libjs-jquery-flot
    libjs-jquery-ui libjs-jquery-ui-theme-smoothness libjs-leaflet
    libjs-requirejs libjs-requirejs-text libllvm6.0:i386
    libopenscenegraph-3.4-131 libqt5opengl5   linux-headers-4.15.0-34
    linux-headers-4.15.0-34-generic linux-image-4.15.0-33-generic
    linux-image-4.15.0-34-generic linux-modules-4.15.0-33-generic
    linux-modules-4.15.0-34-generic linux-modules-extra-4.15.0-33-genericlinux-modules-extra-4.15.0-34-generic node-sprintf-js nodejs
    nodejs-doc 
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 47 not fully
installed or removed.
After this operation, 0 B of additional disk space will be used.   
Setting up python3 (3.6.5-3ubuntu1) ...
running python rtupdate hooks for python3.6...
E: py3compile:183: cannot create directory /usr/share/hplip/ui5/__pycache__:
    FileNotFoundError(2, 'No such file or directory')
    [Errno 2]  No such file or directory: '/usr/share/hplip/ui5/aboutdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/aboutdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/aligndialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/aligndialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/cleandialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/cleandialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/colorcaldialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/colorcaldialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/devicesetupdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/devicesetupdialog_base.py' 
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/deviceuricombobox.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/devmgr5.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/devmgr5_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/devmgr_ext.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/fabgrouptable.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/fabnametable.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/fabwindow.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/fabwindow_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/faxsetupdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/faxsetupdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/filetable.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/firmwaredialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/firmwaredialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/infodialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/infodialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/linefeedcaldialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/linefeedcaldialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/loadpapergroupbox.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/makecopiesdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/makecopiesdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/mimetypesdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/mimetypesdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/nodevicesdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/nodevicesdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/plugindiagnose.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/plugindiagnose_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/plugindialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/plugindialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/pluginlicensedialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/pluginlicensedialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/pqdiagdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/pqdiagdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/printdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/printdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/printernamecombobox.py'
    [Errno 2] No such file or directory:'/usr/share/hplip/ui5/printsettings_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/printsettingsdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/printsettingsdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/printsettingstoolbox.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/printtestpagedialog.py'    
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/printtestpagedialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/queuesconf.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/readonlyradiobutton.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/sendfaxdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/sendfaxdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/settingsdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/settingsdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/setupdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/setupdialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/setupdialog_base5.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/systemtray.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/systrayframe.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/systrayframe_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/ui_utils.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/upgradedialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/upgradedialog_base.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/wifisetupdialog.py'
    [Errno 2] No such file or directory: '/usr/share/hplip/ui5/wifisetupdialog_base.py'
error running python rtupdate hook hplip-data
dpkg: error processing package python3
    (--configure):  installed python3 package post-installation script
    subprocess returned error exit status 4
dpkg: dependency problems prevent configuration of
      update-notifier-common:
      update-notifier-common depends on python3:any; however:   Package
    python3 is not configured yet.

dpkg: error processing package update-notifier-common 
(--configure):  dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-web-launchers:
    ubuntu-web-launchers depends on python3; however:   Package python3 is
    not configured yet.

dpkg: error processing package ubuntu-web-launchers 
(--configure):  dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-brlapi:
    python3-brlapi depends on python3 (<< 3.7); however: 
        Package python3 is not configured yet.
    python3-brlapi depends on python3 (= 3.6~); however:   Package
        python3 is not configured yet.
    python3-brlapi depends on python3:any (= 3.2~); however:   Package
        python3 is not configured yet.

Errors were encountered while processing:
  python3  update-notifier-common ubuntu-web-launchers  python3-brlapi 
  lutris  python3-commandnotfound language-selector-common  python3-update-manager
  python3-dev python3-wadllib  gnome-shell  apport-gtk  apturl  netplan.io
  command-not-found  ubuntu-release-upgrader-core  python3-apport
  gnome-terminal  ubuntu-session  xserver-xorg  python3-problem-report
  ubuntu-drivers-common python3-uno  software-properties-gtk
  apturl-common  nplan  update-notifier  gnome-software  python3-pip
  unattended-upgrades  apport  update-manager python3-software-properties
  gnome-menus  language-selector-gnome networkd-dispatcher  python3-distupgrade
  xorg software-properties-common  nautilus-extension-gnome-terminal
  ubuntu-release-upgrader-gtk  update-manager-core  ubuntu-software 
  python3-apt  gnome-software-plugin-snap  gdm3  gnome-control-center
E: Sub-process /usr/bin/dpkg returned an error code (1)

我担心我的系统已经损坏并且可能需要重新安装。

这是/etc/sources.list

# deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted

# See help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution. deb us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution. deb us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team. deb us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src us.archive.ubuntu.com/ubuntu/ bionic universe deb us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src us.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team. deb us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src us.archive.ubuntu.com/ubuntu/ bionic multiverse deb us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team. deb us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted
universe multiverse
# deb-src /us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb archive.canonical.com/ubuntu bionic partner
# deb-src archive.canonical.com/ubuntu bionic partner

deb security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src security.ubuntu.com/ubuntu bionic-security main restricted deb security.ubuntu.com/ubuntu bionic-security
universe
# deb-src security.ubuntu.com/ubuntu bionic-security universe deb security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src security.ubuntu.com/ubuntu bionic-security multiverse

更新驱动程序后出现了该问题,安装 hplip 时没有出现该问题,删除 hplip 后问题也没有消失。

答案1

这里有两个问题:

  1. 你的/etc/apt/sources.list样子不对。你应该用正常的恢复它:

    deb http://archive.ubuntu.com/ubuntu bionic main restricted
    deb http://archive.ubuntu.com/ubuntu bionic multiverse
    deb http://archive.ubuntu.com/ubuntu bionic universe
    
    deb http://archive.ubuntu.com/ubuntu bionic-updates universe
    deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted
    deb http://archive.ubuntu.com/ubuntu bionic-updates multiverse
    
    deb http://archive.ubuntu.com/ubuntu bionic-security main restricted
    deb http://archive.ubuntu.com/ubuntu bionic-security universe
    deb http://archive.ubuntu.com/ubuntu bionic-security multiverse
    
  2. 看来你已经安装了二进制 HPLIP 版本,然后按照卸载重复答案中的部分这将解决你的问题。

下次仔细检查您的打印机型号和所需的 HPLIP 版本。

相关内容