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

Ubuntu 18.04.6 LTS(Bionic Beaver)升级问题求助

Ubuntu 18.04.6 LTS(Bionic Beaver)升级问题求助

Hey there! I’ve gone through Ubuntu LTS upgrades multiple times, so let’s break down your problem and fix it step by step.

First, why did you get that error with sudo do-release-upgrade -d?

The -d flag tells Ubuntu to upgrade to the development/unstable pre-release version (usually the latest non-LTS beta). Since your system is an LTS release (18.04), the default upgrade policy only allows moving to the next LTS version (not non-LTS builds)—hence that confusing error message. That flag isn’t what you need for a standard LTS upgrade.

Here’s the correct step-by-step upgrade process:

Before starting, BACK UP YOUR DATA FIRST—whether it’s a server snapshot, copying files to an external drive, or using tar to archive important directories. Upgrades usually go smoothly, but it’s always safe to have a fallback.

  1. Update your current system to the latest patch level
    Run these commands to ensure all existing packages are up-to-date before upgrading:

    sudo apt update
    sudo apt upgrade -y
    sudo apt dist-upgrade -y
    sudo apt autoremove -y && sudo apt clean
    

    Reboot your server if any kernel updates were installed:

    sudo reboot
    
  2. Verify your LTS upgrade channel is enabled
    Ubuntu LTS versions default to only upgrading to other LTS releases, but let’s double-check the config file:

    sudo nano /etc/update-manager/release-upgrades
    

    Make sure the line Prompt= is set to lts (it should be the default, but sometimes it gets changed). Save and exit nano by pressing Ctrl+O, then Enter, then Ctrl+X.

  3. Start the LTS upgrade
    For server systems, run the standard release upgrade command (without the -d flag):

    sudo do-release-upgrade
    

    Follow the on-screen prompts: you’ll be asked to confirm the upgrade, agree to package removals if needed, and confirm when the upgrade is complete.

  4. Upgrade to the latest LTS (22.04) if needed
    Ubuntu doesn’t support jumping directly from 18.04 to 22.04—you need to first upgrade to 20.04 LTS, then repeat the above steps to upgrade from 20.04 to 22.04 LTS.

Post-upgrade checks

After the upgrade finishes and you reboot:

  • Run lsb_release -a to confirm you’re on the new LTS version.
  • Check that all your essential services (like web servers, databases) are running correctly.
  • Run sudo apt update && sudo apt upgrade again to apply any post-upgrade patches.

备注:内容来源于stack exchange,提问作者Mohamed Nazar S.M.

火山引擎 最新活动