Ubuntu 16.04软件更新程序无响应。 不完整的更新

我在HP笔记本电脑上使用Windows 10双Ubuntu 16.04启动。 软件更新程序正在更新软件。 接近结束时,它出现了一些错误,卡住了,窗户变得反应迟钝。 它正在更新与perl相关的内容。

但很长一段时间后,我决定只关闭软件更新程序。 现在,如果我再次运行它,它无法检查更新,当我关闭它时,它给了我一个选项来运行部分升级,但这给了“无法获得独占锁定”,并说另一个应用程序,如apt-get或能力正在运行,我必须关闭它。 关闭之后,运行sudo apt-get update也给了我类似的东西。 如果我运行ps -A | grep apt ps -A | grep apt它给了我两个名为aptd进程。 我应该杀了这些并再试一次吗? 那会安全吗? 我还应该在ps -A寻找其他什么吗?

此外,软件更新程序的这个问题曾经发生过一次。 即使那个时候它冻结了,也正在开发与perl相关的东西。 我的软件更新程序或perl安装可能有任何问题吗?

删除锁定文件并运行sudo apt update后:

 Fetched 188 kB in 1s (122 kB/s) E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

我跑了那个命令并得到了这个:(经过多行处理和设置)

 Errors were encountered while processing: shim-signed cups unattended-upgrades 

sudo apt upgrade的完整输出:

 Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: iucode-tool libpango1.0-0 libpangox-1.0-0 linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-image-4.4.0-21-generic linux-image-extra-4.4.0-21-generic linux-signed-image-4.4.0-21-generic Use 'sudo apt autoremove' to remove them. The following packages will be upgraded: gnome-software gnome-software-common libprocps4 procps ubuntu-software update-notifier update-notifier-common 7 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 3 not fully installed or removed. Need to get 2,961 kB of archives. After this operation, 2,048 B of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libprocps4 amd64 2:3.3.10-4ubuntu2.2 [32.7 kB] Get:2 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 procps amd64 2:3.3.10-4ubuntu2.2 [222 kB] Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 update-notifier amd64 3.168.2 [48.2 kB] Get:4 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 update-notifier-common all 3.168.2 [163 kB] Get:5 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 ubuntu-software amd64 3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1 [11.7 kB] Get:6 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 gnome-software amd64 3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1 [226 kB] Get:7 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 gnome-software-common all 3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1 [2,257 kB] Fetched 2,961 kB in 5s (509 kB/s) debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable (Reading database ... 274520 files and directories currently installed.) Preparing to unpack .../libprocps4_2%3a3.3.10-4ubuntu2.2_amd64.deb ... Unpacking libprocps4:amd64 (2:3.3.10-4ubuntu2.2) over (2:3.3.10-4ubuntu2) ... Preparing to unpack .../procps_2%3a3.3.10-4ubuntu2.2_amd64.deb ... Unpacking procps (2:3.3.10-4ubuntu2.2) over (2:3.3.10-4ubuntu2) ... Preparing to unpack .../update-notifier_3.168.2_amd64.deb ... Unpacking update-notifier (3.168.2) over (3.168.1) ... Preparing to unpack .../update-notifier-common_3.168.2_all.deb ... Unpacking update-notifier-common (3.168.2) over (3.168.1) ... Preparing to unpack .../ubuntu-software_3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1_amd64.deb ... Unpacking ubuntu-software (3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1) over (3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu1~16.04.1) ... Preparing to unpack .../gnome-software_3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1_amd64.deb ... Unpacking gnome-software (3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1) over (3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu1~16.04.1) ... Preparing to unpack .../gnome-software-common_3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1_all.deb ... Unpacking gnome-software-common (3.20.1+git20160923.2.7374bdc-0ubuntu1~xenial1) over (3.20.1+git20160617.1.0440874.ubuntu-xenial-0ubuntu1~16.04.1) ... Processing triggers for libc-bin (2.23-0ubuntu4) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for systemd (229-4ubuntu12) ... Processing triggers for man-db (2.7.5-1) ... Processing triggers for gconf2 (3.2.6-3ubuntu6) ... Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ... Processing triggers for libglib2.0-0:amd64 (2.48.1-1~ubuntu16.04.1) ... Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160824-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ... Processing triggers for desktop-file-utils (0.22-1ubuntu5) ... Processing triggers for mime-support (3.59ubuntu1) ... Setting up libprocps4:amd64 (2:3.3.10-4ubuntu2.2) ... Setting up procps (2:3.3.10-4ubuntu2.2) ... update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults Setting up cups (2.1.3-4) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing package cups (--configure): subprocess installed post-installation script returned error exit status 1 Setting up shim-signed (1.19~16.04.1+0.8-0ubuntu2) ... E: Sub-process /usr/bin/dpkg returned an error code (1) 

安全启动

  1. 打开software-properties-gtk并禁用自动更新
  2. 使用以下命令检查运行APT: ps ax | grep apt ps ax | grep apt然后使用kill -9 ..或者如果它失败kill -2 ..
  3. 删除锁

     sudo find /var/lib/apt/ /var/lib/dpkg/ -iname lock -exec rm {} \; mkdir ~/backup; sudo mv /var/cache/debconf/*dat* ~/backup/ 
  4. 使用完成上次安装。

     sudo dpkg --configure -a sudo apt -f install 
  5. 运行更新以进行检查

     sudo apt update sudo apt upgrade sudo apt dist-upgrade 
  6. 打开software-properties-gtk并启用后退自动更新