受欢迎的博客标签

如何升级Ubuntu操作系统

Published

How to upgrade from Ubuntu 18.04 LTS to 22.04 LTS.Tutorial Upgrade Ubuntu 18.04 to 22.04 LTS

Upgrade to 20.04 LTS using the CLI

因为要安装1个软件,需要5.16的内核,只好升级操作系统。

Current System

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic
uname -r
4.15.0-101-generic

 

Step 1: Update Current System

需要确认当前系统本地的所有软件都是最新的版本

确保Ubuntu 20.04.4 LTS安装了所有最新的安全更新和补丁。

sudo apt update #<--Refresh the apt repo
sudo apt upgrade -y #<--Now apply all upgrades
sudo apt-get dist-upgrade -y

sudo apt-get autoremove
sudo apt-get clean

reboot

sudo apt install update-manager-core
sudo do-release-upgrade

step 2.处理一些错误

软件的PPA一直在报错,是之前安装的Bcompare软件,之前因为一些骚操作,导致public key有问题,显示没有Release文件供数据更新。

cd /etc/apt/sources.list.d/

直接删掉了相关的***.list以及***.list.save
再去更新就圆满完成!



安装中断时,出现锁错误

E: Could not get lock /var/lib/apt/lists/lock. It is held by process 211797 (jammy)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to lock directory /var/lib/apt/lists/

(Resolved)

 

 

Please install all available updates for your release before upgrading

(Resolved)

step3.

sudo apt-get autoremove
sudo apt-get clean

 

step 4.

#reboot

把nginx 配置文件初始化掉了

Step 5: Upgrade from Ubuntu 18.04 LTS to Ubuntu 20.04 LTS

sudo do-release-upgrade

step 6.

# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal
root@vultr:~# uname -r
5.4.0-200-generic

 

 

 

https://amtdev.com/how-to-upgrade-ubuntu-from-16-04-to-22-04