X

Upgrade deban9 to 11

2021/12/16

以前的 pacificrack vps 续款逾期了好几天,通知的邮件在垃圾箱。某天突然发现邮件,vps已经处在终结状态。也就是映像都被回收,好在这个vps也没放啥东西,就一个备用梯子,外带一个小站。9刀一年的小鸡,1G内存每月500G流量,还是很香的,不能扔了。续费后,厂商给了个新的,系统是Debian 9。新机第一习惯当然是更新到最新,那就简单记录下更新过程吧。

  1. 第一步当然是更新
    # If you haven't already, ensure all backups are up-to-date. 
    $ sudo apt update
    $ sudo apt upgrade
    

  1. 然后是修改源
    # In a text editor, replace the codename of your release with that of the next release in APT's package sources
    sudo nano /etc/apt/sources.list /etc/apt/sources.list.d/*
    

你需要替换 stretchbullseye

举个例子:

# For instance, the line
#    deb https://deb.debian.org/debian/ stretch main
# should be replaced with
#    deb https://deb.debian.org/debian/ bullseye main

  1. 如果遇到下面报错,这一快需要替换下
# If you got an error when trying to run apt update.
# E: The repository 'http://security.debian.org./debian-security 
# bullseye/updates Release' does not have a Release file.

# replace blow 
# deb http://security.debian.org/debian-security/ stretch/updates main
# deb-src http://security.debian.org/debian-security/ stretch/updates main
# width

deb http://security.debian.org/debian-security/ bullseye-security main
deb-src http://security.debian.org/debian-security/ bullseye-security main

  1. 然后是更新~
# Clean and update package lists
$ sudo apt clean
$ sudo apt update

# Perform the major release upgrade, removing packages if required
# Interrupting this step after downloading has completed is an excellent way to stress-test your backups
$ sudo apt full-upgrade

  1. 收尾工作 清理和重启
# Remove packages that are not required anymore
# Be sure to review this list: you may want to keep some of them
$ sudo apt autoremove

# Reboot to make changes effective (optional, but recommended)
$ sudo shutdown -r now
  1. 其它 重启后 登入vps 看看信息:
$  cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Commit