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

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

我在 HP 笔记本电脑上安装了 Ubuntu 16.04 和 Windows 10 双启动程序。软件更新程序正在更新软件。快结束时,它出现了一些错误,卡住了,窗口变得无响应。它正在更新与 perl 相关的东西。

但过了很长时间,我决定只关闭软件更新程序。现在,如果我再次运行它,它就无法检查更新,当我关闭它时,它会给我一个运行部分升级的选项,但这会给出“无法获得独占锁定”并说另一个应用程序(如 apt-get 或 aptitude)正在运行,我必须关闭它。关闭它后,运行sudo apt-get update也会给我类似的提示。如果我运行,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

  1. 打开software-properties-gtk并禁用自动更新
  2. 使用以下方法检查是否正在运行 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并启用自动更新

相关内容