Ubuntu – Dependency errors for python3 and many others when I run sudo apt-get upgrade

apt

I'm getting this error

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
45 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y]
Setting up python3 (3.6.7-1~18.04) ...
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-sqlparse:
 python3-sqlparse depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-sqlparse (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-brlapi:
 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.

dpkg: error processing package python3-brlapi (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-django-restricted-resource:
 python3-django-restricted-resource depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-django-restricted-resource (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-update-manager:
 python3-update-manager depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-update-manager (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-No apport report written because MaxReports is reached already
                                         No apport report written because MaxReports is reached already
                       No apport report written because MaxReports is reached already
     wadllib:
 python3-wadllib depends on python3:any (>= 3.4~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-wadllib (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gnome-shell:
 gnome-shell depends on python3; however:
  Package python3 is not configured yet.

dpkg: error processing package gnome-shell (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apport-gtk:
 apport-gtk depends on python3; however:
  Package python3 is not configured yet.

dpkg: error processing package apport-gtk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-django:
 python3-django depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-django (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apturl:
 apturl depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package apturl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-release-upgrader-core:
 ubuntu-release-upgrader-core depends on pyNo apport report written because MaxReports is reached already
                         thon3:any (>= 3.2~); however:
  Package python3 is not configured yet.

dpkg: error processing package ubuntu-release-upgrader-core (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python3-apport:
 python3-apport depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-apport (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of xserver-xorg:
 xserver-xorg depends on python3-apport; however:
  Package python3-apport is not configured yet.

dpkg: error processing package xserver-xorg (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python3-problem-report:
 python3-problem-report depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-problem-report (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of ubuntu-drivers-common:
 ubuntu-drivers-common depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package ubuntu-drivers-common (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-pafy:
 python3-pafy depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

No apport report written because MaxReports is reached already
                                                              dpkg: error processing package python3-pafy (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python3-uno:
 python3-uno depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.
 python3-uno depends on python3 (= 3.6~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-uno (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of software-properties-gtk:
 software-properties-gtk depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.
 software-properties-gtk depends on python3; however:
  Package python3 is not configured yet.
 software-properties-gtk depends on ubuntu-drivers-common (>= 1:0.2.75); however:
  Package ubuntu-drivers-common is not configured yet.

dpkg: error processing package software-properties-gtk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apturl-common:
 apturl-common depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.
 apturl-common depends on python3-update-manager; however:
No apport report written because MaxReports is reached already
                                                                Package python3-update-manager is not configured yet.

dpkg: error processing package apturl-common (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of update-notifier:
 update-notifier depends on update-notifier-common (= 3.192.1.4); however:
  Package update-notifier-common is not configured yet.

dpkg: error processing package update-notifier (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of gnome-software:
 gnome-software depends on software-properties-gtk; however:
  Package software-properties-gtk is not configured yet.

dpkg: error processing package gnome-software (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of unattended-upgrades:
 unattended-upgrades depends on python3; however:
  Package python3 is not configured yet.
No apport report written because MaxReports is reached already

dpkg: error processing package unattended-upgrades (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of apport:
 apport depends on python3; however:
  Package python3 is not configured yet.
 apport depends on python3-apport (>= 2.20.9-0ubuntu7.5); however:
  Package python3-apport is not configured yet.

dpkg: error processing package apport (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of update-manager:
 update-manager depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.
 update-manager depends on update-notifier; however:
  Package update-notifier is not configured yet.
 update-manager depends on policykit-1-gnome | polkit-kde-agent-1 | lxpolkit | lxqt-policykit | mate-polkit | polkit-1-auth-agent; however:
  Package policykit-1-gnome is not installed.
  Package polkit-kde-agent-1 is not installed.
  Package lxpolkit is not installed.
  Package lxqt-policykit is not installed.
  Package mate-polkit is not installed.
  Package polkit-1-auth-agent is not installed.
  Package gnome-shell which provides polkit-1-auth-agent is not configured yet.

dpkg: error processing package update-manager (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-gdbm:amd64:
 python3-gdbm:amd64 depends on python3 (>= 3.6.6-1~); however:
  Package python3 is not configured yet.
 python3-gdbm:amd64 depends on python3 (= 3.3.2-2~); however:
  Package python3 is not configured yet.
 python3-software-properties depends on python3; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-software-properties (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of gnome-menus:
 gnome-menus depends on python3:any (>= 3.1~); however:
  Package python3 is not configured yet.

No apport report written because MaxReports is reached already
                                                              No apport report written because MaxReports is reached already
                                            dpkg: error processing package gnome-menus (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-ttystatus:
 python3-ttystatus depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.
 python3-ttystatus depends on python3; however:
  Package python3 is not configured yet.

dpkg: error processing package python3-ttystatus (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of ttf-mscorefonts-installer:
 ttf-mscorefonts-installer depends on update-notifier-common (>= 0.119ubuntu2); however:
  Package update-notifier-common is not configured yet.

dpkg: error processing package ttf-mscorefonts-installer (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-lib2to3:
 python3-lib2to3 depends on python3 (>= 3.6.6-1~); however:
  Package python3 is not configured yet.
 python3-lib2to3 depends on python3 (= 3.6.6-1~); however:
  Package python3 is not configured yet.
 python3-distutils depends on python3 (= 3.6.4); however:
  Package python3-lib2to3 is not configured yet.

dpkg: error processing package python3-distutils (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of networkd-dispatcher:
 networkd-dispatcher depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package networkd-dispatcher (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python3-distupgrade:
 python3-distupgrade depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.
 python3-distupgrade depends on python3-update-manager (>= 1:0.196.2~); however:
  Package python3-update-manager is not configured yet.

dpkg: error processing package python3-distupgrade (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of xorg:
 xorg depends on xserver-xorg (>= 1:7.7+19ubuntu7.1); however:
  Package xserver-xorg is not configured yet.

dpkg: error processing package xorg (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of software-properties-common:
 software-properties-common depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.
 software-properties-common depends on python3; however:
  Package python3 is not configured yet.
 software-properties-common depends on python3-software-properties (= 0.96.24.32.5); however:
  Package python3-software-properties is not configured yet.

dpkg: error processing package software-properties-common (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of ubuntu-release-upgrader-gtk:
 ubuntu-release-upgrader-gtk depends on ubuntu-release-upgrader-core (= 1:18.04.29); however:
  Package ubuntu-release-upgrader-core is not configured yet.
 ubuntu-release-upgrader-gtk depends on update-manager; however:
  Package update-manager is not configured yet.
 ubuntu-release-upgrader-gtk depends on python3-distupgrade (= 1:18.04.29); however:
  Package python3-distupgrade is not configured yet.

dpkg: error processing package ubuntu-release-upgrader-gtk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-frozendict:
 python3-frozendict depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

No apport report written because MaxReports is reached already
                                                              No apport report written because MaxReports is reached already
                                            dpkg: error processing package python3-frozendict (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of update-manager-core:
 update-manager-core depends on python3:any (>= 3.2~); however:
  Package python3 is not configured yet.
 update-manager-core depends on python3-update-manager (= 1:18.04.11.7); however:
  Package python3-update-manager is not configured yet.
 update-manager-core depends on ubuntu-release-upgrader-core (>= 1:18.04.9); however:
  Package ubuntu-release-upgrader-core is not configured yet.

dpkg: error processing package update-manager-core (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of ubuntu-software:
 ubuntu-software depends on gnome-software (>= 3.28.1-0ubuntu4.18.04.4); however:
  Package gnome-software is not configured yet.

dpkg: error processing package ubuntu-software (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python3-apt:
 python3-apt depends on python3 (= 3.6~); however:
  Package python3 is not configured yet.
 python3-apt depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-apt (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python3-itypes:
 python3-itypes depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-itypes (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of gnome-software-plugin-snap:
 gnome-software-plugin-snap depends on gnome-software (= 3.28.1-0ubuntu4.18.04.4); however:
  Package gnome-software is not configured yet.

dpkg: error processing package gnome-software-plugin-snap (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of gdm3:
 gdm3 depends on gnome-shell (>= 3.19.92); however:
  Package gnome-shell is not configured yet.

dpkg: error processing package gdm3 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 python3
 update-notifier-common
 ubuntu-web-launchers
 python3-sqlparse
 python3-brlapi
 python3-django-restricted-resource
 python3-update-manager
 python3-wadllib
 gnome-shell
 apport-gtk
 python3-django
 apturl
 ubuntu-release-upgrader-core
 python3-apport
 xserver-xorg
 python3-problem-report
 ubuntu-drivers-common
 python3-pafy
 python3-uno
 software-properties-gtk
 apturl-common
 update-notifier
 gnome-software
 unattended-upgrades
 apport
 update-manager
 python3-gdbm:amd64
 python3-software-properties
 gnome-menus
 python3-ttystatus
 ttf-mscorefonts-installer
 python3-lib2to3
 python3-distutils
 networkd-dispatcher
 python3-distupgrade
 xorg
 software-properties-common
 ubuntu-release-upgrader-gtk
 python3-frozendict
 update-manager-core
 ubuntu-software
 python3-apt
 python3-itypes
 gnome-software-plugin-snap
 gdm3
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm usually pretty good at figuring this out as I always find answers on here but this one is stumping me!

Best Answer

  • Not sure if this will help, but perhaps try running sudo apt --fix-broken install Another thing that could be an issue is if there is something else like another apt install $PROGRAM running in the background, preventing access to that directory


    EDIT
    I think there was some sort of corruption issue with the hplip package. Purging then reinstalling seemed to fix the issue for OP
    sudo apt purge '^hplip' and then sudo apt install hplip-data hplip-gui