This article is published under a SIGNATURE 4.0 International (CC BY 4.0) license. Signature 4.0 International (CC BY 4.0)
Author: Su Yang
Creation time: April 25, 2020 statistical word count: 6119 words reading time: 13 minutes to read this article links: soulteary.com/2020/04/25/…
Ubuntu 20.04 LTS upgrade records on the server
This article will show you how to upgrade from the server version of Ubuntu 18.04 LTS to the latest version of Ubuntu 20.04 LTS at the current point in time, as well as some details of the upgrade process. Hopefully, it will help those who want to try it out.
You need to back up data by yourself and ensure network stability. You are advised to perform all operations on the server springboard.
This article is currently running on Ubuntu 20.04 LTS
The preparatory work
Use apt Update first to see what can be updated.
apt update Hit:1 http://mirrors.aliyun.com/ubuntu bionic InRelease Get:2 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB] Get: 3 http://mirrors.aliyun.com/ubuntu bionic ws-security InRelease [88.7 kB] Get: 4 http://mirrors.aliyun.com/ubuntu bionic-updates/universe Sources [281 kB] Get:5 http://mirrors.aliyun.com/ubuntu bionic-updates/main Sources [315 kB] Get:6 http://mirrors.aliyun.com/ubuntu bionic-updates/main amd64 Packages [915 kB] Get:7 http://mirrors.aliyun.com/ubuntu bionic-updates/main i386 Packages [669 kB] Get:8 http://mirrors.aliyun.com/ubuntu bionic-updates/main Translation-en [315 kB] Get:9 http://mirrors.aliyun.com/ubuntu bionic-updates/universe i386 Bionic Packages [1014 kB] Get: http://mirrors.aliyun.com/ubuntu - updates/universe amd64 Packages [1065 kB] Get: 11 http://mirrors.aliyun.com/ubuntu bionic-updates/universe Translation-en [331 kB] Hit:12 https://download.docker.com/linux/ubuntu bionic InRelease Get:13 http://mirrors.aliyun.com/ubuntu bionic-security/universe Sources [168 kB] Get:14 http://mirrors.aliyun.com/ubuntu bionic-security/main Sources [146 kB] Get:15 http://mirrors.aliyun.com/ubuntu bionic-security/main amd64 Packages [692 kB] Get:16 http://mirrors.aliyun.com/ubuntu bionic-security/main i386 Packages [459 kB] Get:17 http://mirrors.aliyun.com/ubuntu bionic-security/universe amd64 Packages [657 kB] Get:18 http://mirrors.aliyun.com/ubuntu bionic-security/universe i386 Packages [618 kB] Touched7,823 kBin 3s (3,106 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
19 packages can be upgraded. Run 'apt list --upgradable' to see them.
Copy the code
Then execute apt upgrade-y and wait for the software upgrade to complete. If you’ve updated recently, you’ll get something like the following.
apt update
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Copy the code
If you feel that the software source is slow during the upgrade process, you can try to replace the source, such as the following operation.
sed -i -e "s/mirrors.cloud.aliyuncs.com/mirrors.tuna.tsinghua.edu.cn/" /etc/apt/sources.list
Copy the code
Little annoyances in the upgrade process
When we perform do-release-upgrade in an attempt to upgrade, there are three possible situations that tell us that we cannot upgrade.
There are incomplete software upgrades in the system
When you finish executing the command, you may get the message “Please install all available updates for your release before upgrading”, indicating that you have not completed upgrading all the software.
do-release-upgrade
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.
Copy the code
You may be wondering why this happens when I have already performed update and upgrade.
There is a great possibility that apt-mark has been used to lock part of the software version, which needs to be unlocked first, such as:
apt-mark unhold docker-ce
Copy the code
How do you see which software needs to be upgraded or unlocked?
This can be queried using the apt update && apt list –upgradable command:
apt list --upgradable
...
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable'to see it. ... Listing... Done Docker-CE/Bionic 5:19.03.8~3-0~ Ubuntu-Bionic AMD64 [upgradable From: 5:19.03.6~3-0~ Ubuntu-Bionic] N: There are 23 additional versions. Please use the'-a' switch to see them.
Copy the code
Then execute apt upgrade-y again to complete all software upgrades.
But don’t count your chickens before they hatch, because there may be more to come.
Unlock the system upgrade
When all the software has been upgraded, continue to upgrade the software using do-release-upgrade and you will see a message similar to the following.
do-release-upgrade
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS develoment release
set Prompt=normal in /etc/update-manager/release-upgrades.
Copy the code
Since version push has not been officially enabled on the official website, it is necessary to add the command line parameter -d to do-release-upgrade to allow obtaining the latest upgrade package if you want to obtain a version update.
Usage: do-release-upgrade [options]
Options:
-d, --devel-release If using the latest supported release, upgrade to the
development release
Copy the code
Select an upgrade route
If you are an Ubuntu 18.04 LTS user, at this point we need to make a decision whether to upgrade one version at a time or directly across versions. If you are an Ubuntu 19.10 user, it is much easier because there is no cross-version problem, just upgrade the latter part of the content one by one.
Let’s talk in detail about two types of upgrades.
Ubuntu 18.04 Upgrade Ubuntu 20.04 version by version
The popular phrase “don’t take too big a step” can sometimes be applied to software updates.
Open the /etc/update-manager/release-upgrades file and see the instructions for the upgrades:
[DEFAULT]
# Default prompting behavior, valid options:
#
# never - Never check for, or allow upgrading to, a new release.
# normal - Check to see if a new release is available. If more than one new
# release is found, the release upgrader will attempt to upgrade to
# the supported release that immediately succeeds the
# currently-running release.
# lts - Check to see if a new LTS release is available. The upgrader
# will attempt to upgrade to the first LTS release available after
# the currently-running one. Note that if this option is used and
# the currently-running release is not itself an LTS release the
# upgrader will assume prompt was meant to be normal.
Prompt=lts
Copy the code
Change Prompt= LTS to Prompt=normal and execute do release-upgrade -d to start phase 1 upgrade:
do-release-upgrade -d
Checking forA new Ubuntu release Get:1 Upgrade tool signature [1,554b] Get:2 Upgrade tool [1,329 kB] touch1,331 kBin 0s (0 B/s)
authenticate 'eoan.tar.gz' against 'eoan.tar.gz.gpg'
extracting 'eoan.tar.gz'
Reading cache
...
Copy the code
Depending on the situation, after we “Next” all the way, we will see the following prompt when we are about to complete the upgrade:
. System upgrade is complete. Restart required To finish the upgrade, a restart is required. If you select'y' the system will be restarted.
Copy the code
After the system restarts, log in and you will see that Ubuntu 19.10 has been successfully upgraded:
Welcome to Ubuntu 19.10 (GNU/Linux 5.3.0-46-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Ubuntu 20.04 LTS is out, raising the bar on performance, security,
and optimisation for Intel, AMD, Nvidia, ARM64 and Z15 as well as
AWS, Azure and Google Cloud.
https://ubuntu.com/blog/ubuntu-20-04-lts-arrives
Copy the code
We changed the value of /etc/update-manager-release-upgrades file to Prompt= LTS and performed do-release-upgrade -d again to start the second stage of the upgrades. The operation process was the same as the previous one. With a glass of water, the server restarts again and Ubuntu 20.04 LTS is ready to upgrade.
Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-26-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
* Ubuntu 20.04 LTS is out, raising the bar on performance, security,
and optimisation for Intel, AMD, Nvidia, ARM64 and Z15 as well as
AWS, Azure and Google Cloud.
https://ubuntu.com/blog/ubuntu-20-04-lts-arrives
Copy the code
After verifying the version-by-version upgrade, let’s try a one-step cross-version upgrade.
Upgrade Ubuntu 20.04 across Ubuntu 18.04 versions
You can also use apt full-upgrade-y to upgrade your software packages. You can use apt full-upgrade-y to upgrade your software packages.
Unlike upgrades one version at a time, we no longer need to modify the release-upgrades configuration file, but only need to confirm whether the value of the /etc/update-manager-release-upgrades file is set to LTS before upgrading.
After confirming that the value is correct, run the do-release-upgrade -d command to configure Ubuntu 20.04 according to your requirements. After “All the way Next”, the upgrade is complete.
The last
The arrival of Ubuntu 20.04 LTS, just a year after upgrading all machines to 18.04, was a pleasant surprise.
Under normal circumstances, we can smoothly complete the upgrade by using the combination of update, upgrade and do-release-upgrade. However, at the current point in time, the official website has not officially provided the release upgrade scheme, so this article comes into being.
Well, another reason for this article is that I went home and went to bed and forgot to feed the cat and was woken up by a child protesting…
–EOF
I now have a small toss group, which gathered some like to toss small partners.
In the case of no advertisement, we will talk about software, HomeLab and some programming problems together, and also share some technical salon information in the group from time to time.
Like to toss small partners welcome to scan code to add friends. (Please specify source and purpose, otherwise it will not be approved)
All this stuff about getting into groups