You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

升级apt失败后Ubuntu系统损坏无法启动求助

Fixing Ubuntu Boot & Update Freeze Issues

Hey Robbie, let's work through this problem step by step—you've already navigated a broken GRUB after a BIOS update, and now an apt upgrade freeze at 78% has left you stuck with a wonky login screen. Let's get your system back on track:

1. Boot into Recovery Mode

  • Restart your PC. When it boots up, hold down the Shift key to bring up the GRUB menu (if it doesn't show up automatically).
  • Select Advanced options for Ubuntu, then pick the kernel version marked with recovery mode—preferably the one you were using before the failed upgrade, since the freeze likely corrupted some packages or the new kernel.
  • From the recovery menu, choose root to drop into a root shell prompt.

2. Repair Corrupted Packages

First, remount your filesystem in read-write mode so you can make changes:

mount -o remount,rw /

Then run the built-in package repair tool to fix the incomplete installation:

apt --fix-broken install

This command will automatically finish any partial installs, resolve broken dependencies, and replace corrupted package files.

Once the repair is done, clear out old cache and unused packages to avoid conflicts:

apt clean
apt autoremove --purge

Now re-run the update process, adding a flag to handle missing packages:

apt update --fix-missing
apt upgrade

If you still hit issues during upgrade, you can try targeting specific problematic packages (if you can identify them) or use dist-upgrade to handle complex dependency changes:

apt upgrade --only-upgrade <problematic-package-name>
apt dist-upgrade # Use this cautiously—it can remove conflicting packages

4. Fix the Broken Login Screen

If the login screen still shows that orange dotted background instead of the normal one, your display manager or desktop environment is probably corrupted:

  • First, check which display manager you're using (most Ubuntu setups use GDM3):
systemctl status gdm3
  • Reinstall the display manager and desktop environment to reset them:
apt install --reinstall gdm3 ubuntu-desktop
  • Reconfigure the display manager to ensure it's set up correctly:
dpkg-reconfigure gdm3
  • Finally, reboot your system:
reboot

5. Troubleshoot Kernel Issues (Since You Fixed GRUB Earlier)

If you still can't boot normally, the upgraded kernel might be the culprit:

  • Reboot back into GRUB's advanced options and try booting with the older, working kernel. If that works, you can uninstall the problematic new kernel:
    1. List all installed kernels:
      dpkg --list | grep linux-image
      
    2. Purge the faulty kernel (replace <version> with the problematic kernel's version number):
      apt purge linux-image-<version>-generic
      
    3. Update GRUB to remove the broken kernel from the menu:
      update-grub
      

Pro Tip: If you can't even get into recovery mode, boot from an Ubuntu installation USB, select Try Ubuntu, mount your system partition, and run the same repair commands from there.

内容的提问来源于stack exchange,提问作者Robbie Tacescu

火山引擎 最新活动