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

在Ubuntu17.10系统升级过程中遇到内核问题,导致软件安装和卸载受阻。通过在国外论坛找到的解决方案,成功解决了这一困扰。步骤包括:可选的系统恢复和内核清理,以及关键的更新和安装操作。

因为电脑的配置只能安装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



评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值