Ubuntu Server 22.04 已经发布一年多,但我一直没去升级,甚至腾讯云也早就有了镜像。最近突然想到去升级一下,这次我准备使用 do-release-upgrade 来升级系统版本。

备份

直接通过云硬盘的快照功能。

升级

参考 How To Upgrade to Ubuntu 22.04 Jammy Jellyfish

sudo apt update && sudo apt upgrade && sudo apt dist-upgrade
sudo do-release-upgrade

升级过程中提示我开放 1022 端口。

接下来会将 focal 重命名为 jammy,我之前设置的镜像源直接就可以使用,不需要做额外修改。

Do you want to start the upgrade?


12 packages are going to be removed. 168 new packages are going to be
installed. 875 packages are going to be upgraded.

You have to download a total of 1,032 M. This download will take
about 5 minutes with your connection.

Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.

 Continue [yN]  Details [d]

确认之后就是漫长的等待,等一切就绪就会提示是否重启。重启之后,便成功升级到 22.04.

报错

W: http://mirrors.tencentyun.com/docker-ce/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
apt sudo apt-key export 0EBFCD88 | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/docker.gpg

重装系统

我似乎把 Python 环境弄坏了,poetry 工作不正常,总是提示我找不到 pip。想了想,还是像 之前 那样直接重装系统吧。

Docker

这次 Docker 直接通过 get.docker.com 的脚本来安装,比之前真是方便太多了。

curl -fsSL https://get.docker.com -o install-docker.sh
sudo sh install-docker.sh --mirror Aliyun

接下来是设置文件夹权限,除了 postgres/pgdataroot:rootblog/usrwww-data:www-data,其他都设置为当前用户。

配置

通过之前写好的 dotfiles,基本上需要的东西都可以自动安装。

git clone https://github.com/he0119/dotfiles.git
WAKATIME_API_KEY=key ./install.sh

标签: Ubuntu, 服务器