我尝试通过 更新我的 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?
答案1
我想分享我解决该问题的步骤。
首先,我需要手动关闭终端。然后,我必须移除锁:
sudo rm /var/lib/dpkg/lock
之后我就可以执行以下命令了:
sudo dpkg --configure --pending
sudo dpkg --configure -a
sudo apt install -f
感谢Linux 组帮助我解决这个问题的成员以及其他试图帮助我的人。
答案2
与这种情况几乎完全相同:Ubuntu 18.04 卡在升级 linux-header 上
以下是获得 5 个赞同(现在为 6 个)的被接受的答案
TLDR:禁用安全启动。
大约一个月前我开始遇到同样的问题。对我来说,解决方案是禁用安全启动。自从我安装 Ubuntu 18.04 以来,我就禁用了安全启动,升级没有任何问题。然而,大约一个月前,我更新了 BIOS,重新启用了安全启动(我当时不知道这一点)。升级冻结令人沮丧,我终于弄明白了,因为我的 VirtualBox 安装也无法正常工作。VirtualBox 的修复方法是禁用安全启动,这也修复了我的linux-headers-<version>-generic
升级。
正如问题中指出的那样,它会在这里冻结:
...
Setting up linux-headers-4.15.0-38-generic (4.15.0-38.41) ...
禁用安全启动后,我得到:
...
Setting up linux-headers-4.15.0-38-generic (4.15.0-38.41) ...
/etc/kernel/header_postinst.d/dkms:
Secure Boot not enabled on this system.
...
done
答案3
升级 Ubuntu 版本的另一种更简单的方法是通过以下命令:
do-release-upgrade