我试图通过 更新我的 Ubuntu 16.04 sudo apt-get dist-upgrade
,但现在终端被冻结(终端 1)。
我让它运行了一整天(超过 24 小时),我只是暂停了一次操作系统。
我已经尝试遵循互联网上的一些提示(例如这里),但不幸的是无济于事。
我在互联网上找到的一些代码,我无法使用它们,因为 Ubuntu 说它is locked by another process
(终端 2)。
有人知道会发生什么吗?或者我能做些什么来解决它?因为我不知道是失败还是成功,或者它是否仍在运行,因为我已经尝试输入一些“enter”,但是没有任何反应,也没有在终端上创建一个新行,它是冻结。
先感谢您。
1号航站楼
$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-headers-4.4.0-148 linux-headers-4.4.0-148-generic
linux-image-4.4.0-148-generic linux-modules-4.4.0-148-generic
linux-modules-extra-4.4.0-148-generic linux-tools-4.4.0-148
linux-tools-4.4.0-148-generic
The following packages will be upgraded:
linux-generic linux-headers-generic linux-image-generic linux-tools-virtual
4 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 69,1 MB of archives.
After this operation, 314 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-modules-4.4.0-148-generic amd64 4.4.0-148.174 [12,0 MB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-image-4.4.0-148-generic amd64 4.4.0-148.174 [6.925 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-modules-extra-4.4.0-148-generic amd64 4.4.0-148.174 [36,6 MB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-generic amd64 4.4.0.148.156 [1.784 B]
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-image-generic amd64 4.4.0.148.156 [2.750 B]
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-148 all 4.4.0-148.174 [9.982 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-4.4.0-148-generic amd64 4.4.0-148.174 [810 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-headers-generic amd64 4.4.0.148.156 [2.582 B]
Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-tools-4.4.0-148 amd64 4.4.0-148.174 [2.850 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-tools-4.4.0-148-generic amd64 4.4.0-148.174 [2.598 B]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-tools-virtual amd64 4.4.0.148.156 [2.610 B]
Fetched 69,1 MB in 2min 11s (526 kB/s)
Selecting previously unselected package linux-modules-4.4.0-148-generic.
(Reading database ... 302549 files and directories currently installed.)
Preparing to unpack .../linux-modules-4.4.0-148-generic_4.4.0-148.174_amd64.deb ...
Unpacking linux-modules-4.4.0-148-generic (4.4.0-148.174) ...
Selecting previously unselected package linux-image-4.4.0-148-generic.
Preparing to unpack .../linux-image-4.4.0-148-generic_4.4.0-148.174_amd64.deb ...
Unpacking linux-image-4.4.0-148-generic (4.4.0-148.174) ...
Selecting previously unselected package linux-modules-extra-4.4.0-148-generic.
Preparing to unpack .../linux-modules-extra-4.4.0-148-generic_4.4.0-148.174_amd64.deb ...
Unpacking linux-modules-extra-4.4.0-148-generic (4.4.0-148.174) ...
Preparing to unpack .../linux-generic_4.4.0.148.156_amd64.deb ...
Unpacking linux-generic (4.4.0.148.156) over (4.4.0.146.154) ...
Preparing to unpack .../linux-image-generic_4.4.0.148.156_amd64.deb ...
Unpacking linux-image-generic (4.4.0.148.156) over (4.4.0.146.154) ...
Selecting previously unselected package linux-headers-4.4.0-148.
Preparing to unpack .../linux-headers-4.4.0-148_4.4.0-148.174_all.deb ...
Unpacking linux-headers-4.4.0-148 (4.4.0-148.174) ...
Selecting previously unselected package linux-headers-4.4.0-148-generic.
Preparing to unpack .../linux-headers-4.4.0-148-generic_4.4.0-148.174_amd64.deb ...
Unpacking linux-headers-4.4.0-148-generic (4.4.0-148.174) ...
Preparing to unpack .../linux-headers-generic_4.4.0.148.156_amd64.deb ...
Unpacking linux-headers-generic (4.4.0.148.156) over (4.4.0.146.154) ...
Selecting previously unselected package linux-tools-4.4.0-148.
Preparing to unpack .../linux-tools-4.4.0-148_4.4.0-148.174_amd64.deb ...
Unpacking linux-tools-4.4.0-148 (4.4.0-148.174) ...
Selecting previously unselected package linux-tools-4.4.0-148-generic.
Preparing to unpack .../linux-tools-4.4.0-148-generic_4.4.0-148.174_amd64.deb ...
Unpacking linux-tools-4.4.0-148-generic (4.4.0-148.174) ...
Preparing to unpack .../linux-tools-virtual_4.4.0.148.156_amd64.deb ...
Unpacking linux-tools-virtual (4.4.0.148.156) over (4.4.0.146.154) ...
Setting up linux-modules-4.4.0-148-generic (4.4.0-148.174) ...
Setting up linux-image-4.4.0-148-generic (4.4.0-148.174) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.4.0-146-generic
I: /initrd.img.old is now a symlink to boot/initrd.img-4.4.0-146-generic
I: /vmlinuz is now a symlink to boot/vmlinuz-4.4.0-148-generic
I: /initrd.img is now a symlink to boot/initrd.img-4.4.0-148-generic
Setting up linux-modules-extra-4.4.0-148-generic (4.4.0-148.174) ...
Setting up linux-image-generic (4.4.0.148.156) ...
Setting up linux-headers-4.4.0-148 (4.4.0-148.174) ...
Setting up linux-headers-4.4.0-148-generic (4.4.0-148.174) ...
2号航站楼
$ sudo dpkg --configure --pending
dpkg: error: dpkg frontend is locked by another process
$ sudo dpkg --configure -a
dpkg: error: dpkg frontend is locked by another process
$ sudo apt -f install
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
我想分享我为解决问题所做的步骤。
首先,我需要手动关闭终端。然后,我不得不删除锁:
之后,我能够执行以下命令:
感谢帮助我解决这个问题的Linux 小组成员以及其他试图帮助我的人。
几乎与这种情况相同:Ubuntu 18.04 卡在升级 linux-header
有5个赞成票(现在6个)接受的答案如下
TLDR:禁用安全启动。
大约一个月前,我开始遇到同样的问题。对我来说,事实证明解决方案是禁用安全启动。自从我安装了 Ubuntu 18.04 以来,我已经禁用了安全启动,并且它升级没有任何问题。然而,大约一个月前,我更新了我的 BIOS,它重新启用了安全启动(当时我不知道)。升级冻结令人沮丧,我终于弄明白了,因为我的 VirtualBox 安装也无法正常工作。VirtualBox 的修复是禁用安全启动,这也修复了我的
linux-headers-<version>-generic
升级。如问题所述,它会在这里冻结:
禁用安全启动后,我得到:
通过以下命令升级 Ubuntu 版本的另一种更简单的方法: