您的位置:首页 > 其它

在Ubuntu17.10的系统升级中遇到内核升级问题,导致各种软件不能安装和卸载的解决方案(尝试结果,不喜勿骂)

2018-02-06 15:34 971 查看
因为电脑的配置只能安装Ubuntu17.10这个新系统,各种乱七八糟的问题一大堆,尤其是不小心系统升级过程中内核出现问题,导致任何软件的安装和卸载都会卡住,在安装和卸载的过程中会遇到诸如:

Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic

之类的提示,然后一直卡在此处过不去,不仅不能结束升级进程,也不能按照和卸载任何软件,因为显示dpkg一直被占用,当系统提示运行:
sudo dpkg --configure -a

以解决这个问题时,但同样也出现上述提示,并且一直过不去。

在经历各种尝试之后,在国外一个论坛找到解决方案:

1. Kill Synaptic with "System Monitor"
2. A dpkg process was left hung and was blocking further updates
- So in "System Monitor" search for and kill the dpkg process that's running and locking things.
- Searching the string "/var/lib/dpkg" found it for me.
- It had this process "linux-headers-4.3.0-17-generic.postinst"

3. Here's the trick that made it work (@ Giorgio Salluzzo's workaround)
Go to 非图形界面 CTRL+ALT+F3
Login as your user name and run this command from there
$ sudo dpkg --configure -a

4. That alone is probably the fix but I also ran these from the same virtual terminal(同样在非图形界面上执行)
$ sudo apt-get install -f
$ sudo apt-get clean
$ sudo apt-get update

5. CTRL+ALT+F2 to get back to the desktop(回到图形界面).

6. Then "Software Updater" popped up a message saying run a "Partial Upgrade".
Which I did. But it turned out I didn't need that so it stopped itself automatically!(这步很关键,必须要关闭升级)

7. Then I opened Synaptic and checked for updates. None.

8. Back-up any user data and reboot. For me all went well.
The new kernel was installed.

按照以上方案,成功解决了上述问题,
不过,第一步和第二步并不是必须的,可根据个人情况选择是否要进行第一步和第二步,我当初是直接进行的第三步。

以下是注意事项:

NOTES: I tried "sudo dpkg --configure -a" in a normal Terminal but it failed.
It just hung again like Synaptic did.
Giorgio Salluzzo's virtual console workaround was the trick.

But the virtual consoles can be weird.
CTRL+ALT+F1 locks my screen (and then the monitor switches off!) When you wake the screen you can't log back in!!! You have to use CTRL+ALT+F2 to get back to the desktop.

CTRL+ALT+F6 seemed to work best for me but when I tried it for the first time it was just a black screen with a cursor. When I came back later it had a promt for me to login with.

Virtual consoles tips: https://askubuntu.com/questions/157617/reverting-from-ctrl-alt-f1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐