快捷导航

云服务器升级 Debian 7 到 Debian 8

[复制链接]
查看: 431|回复: 0
发表于 2023-6-29 15:34:13 | 显示全部楼层 |阅读模式
升级 Debian 7 到 Debian 8

切换到 jessie 源:

vi /etc/apt/sources.list

修改为以下内容:

deb http://ftp.debian.org/debian/ jessie main

deb-src http://ftp.debian.org/debian/ jessie main

deb http://security.debian.org/debian-security jessie/updates main

deb http://security.debian.org/ jessie/updates main

deb-src http://security.debian.org/ jessie/updates main

# jessie-updates, previously known as 'volatile'

deb http://ftp.debian.org/debian/ jessie-updates main

deb-src http://ftp.debian.org/debian/ jessie-updates main

更新软件索引:

apt-get update

在执行 apt-get update 时,可能出现下面的错误:

The following signatures were invalid: KEYEXPIRED 1668892417 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA8E81B4331F7F50

可以执行下面的命令(实际操作时,key 可能会不一样,请注意替换),之后再重新执行 apt-get update。

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50

升级软件包并更新系统:

apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoremove -y

如果出现升级失败的情况,可以尝试加上 --force-yes 参数,比如:

apt-get upgrade -y --force-yes

apt-get dist-upgrade -y --force-yes

接下来就是系统升级的过程了,其中有一些选项需要操作,基本都是按回车或者输入 Y 并回车即可。

升级完成后需要重启一下系统:

reboot

升级 Debian 8 到 Debian 9

更新软件索引以及本地已有软件:

apt update && apt upgrade -y

切换到 stretch 源:

sed -i 's/jessie/stretch/g' /etc/apt/sources.list

更新软件索引并升级系统:

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

接下来就是系统升级的过程了,其中有一些选项需要操作,基本都是按回车或者输入 Y 并回车即可。

重启系统:

reboot

升级 Debian 9 到 Debian 10

更新软件索引以及本地已有软件:

apt update && apt upgrade -y

切换 stretch 源到 buster 源

sed -i 's/stretch/buster/g' /etc/apt/sources.list

更新软件索引并升级系统:

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

重启系统:

reboot

升级 Debian 10 到 Debian 11

更新软件索引以及本地已有软件:

apt update && apt upgrade -y

切换到 bullseye 源:

vim /etc/apt/sources.list

修改为以下内容:

deb http://deb.debian.org/debian/ bullseye main contrib non-free

deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free

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

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

deb http://ftp.debian.org/debian bullseye-backports main contrib non-free

更新软件索引并升级系统:

apt update && apt upgrade -y && apt full-upgrade -y && apt autoremove -y

重启系统:

reboot

注意事项:

理论上支持跨版本升级,但版本跨度建议不要太大,比如可以尝试直接从 Debian 7 升级到 Debian 9,从 Debian 9 升级到 11。

如果升级之后出现无法使用密码登录的情况,可以使用 VNC 登录服务器,编辑 /etc/ssh/sshd_config,将 PermitRootLogin without-password 替换为:PermitRootLogin yes
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

精彩推荐

尚云驿站

  • 投诉建议:350467567@qq.com
  • 软文投稿:350467567@qq.com
  • 友情链接:350467567@qq.com

云服务支持

精彩文章,快速检索

Copyright 尚云驿站  Powered by©  技术支持:飛    ( 闽ICP备2025116718号-15 )