SfTian Debian10手搓到PVE8 # Debian10手搓到PVE8 ## 免责声明 > [!WARNING] > > 个人测试行为,请勿全部照搬,否则后果自负 ## 设置时区 ```shell timedatectl set-timezone Asia/Shanghai ``` ## 检查环境 `uname -r` 查看内核版本是否为 `4.19` 否则执行下面内容 ```shell rm -f /etc/apt/sources.list echo "deb https://mirrors.aliyun.com/debian/ buster main non-free contrib deb https://mirrors.aliyun.com/debian-security buster/updates main deb https://mirrors.aliyun.com/debian/ buster-updates main non-free contrib" > /etc/apt/sources.list apt update apt upgrade -y apt full-upgrade -y ``` upgrade期间可能会出现提示内容,输入q即可退出,之后有对话框,直接回车即可 upgrade成功之后输入 `reboot now` 重启服务器 ## 升级到Debian11 ```shell rm -f /etc/apt/sources.list echo "deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib deb https://mirrors.aliyun.com/debian-security/ bullseye-security main deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" > /etc/apt/sources.list apt update apt upgrade -y apt full-upgrade -y reboot now ``` 无需多言 ## 升级到Debian12 ```shell rm -f /etc/apt/sources.list echo "deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free non-free-firmware deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free non-free-firmware" > /etc/apt/sources.list apt update apt upgrade -y apt full-upgrade -y reboot now ``` ### 突发情况 > [!WARNING] > > 重启之后可能会出现如下内容 ```log Message from syslogd@bodmevqbvwhezrh at Apr 5 13:40:16 ... kernel:[ 148.158897] mce: [Hardware Error]: CPU 6: Machine Check: 0 Bank 5: c00d78c000010090 Message from syslogd@bodmevqbvwhezrh at Apr 5 13:40:16 ... kernel:[ 148.159153] mce: [Hardware Error]: TSC 0 Message from syslogd@bodmevqbvwhezrh at Apr 5 13:40:16 ... kernel:[ 148.159286] mce: [Hardware Error]: PROCESSOR 0:206d7 TIME 1712295616 SOCKET 0 APIC c microcode 70d ``` 请不必惊慌,自行百度解决问题,这里我选择比较硬核的方式---关闭报错提醒 ```shell nano /etc/rsyslog.conf ``` 翻到最下面注释如下内容 ```yaml # Everybody gets emergency messages #*.emerg * ``` 重启服务 ``` systemctl restart rsyslog ``` ## 删除老内容 > 既然已经升级到Debian12了,那么老东西留着也没用,直接删 删除内核参考链接 [删除Linux老内核](https://www.sysgeek.cn/remove-ubuntu-kernel/) ```shell apt autoremove apt remove linux-image-4* -y apt remove linux-image-5* -y dpkg --purge $(dpkg -l | awk '/^rc/{print $2}') ``` ## 手搓PVE ### 设置FQDN ```shell hostnamectl set-hostname pve.imxbt.cn --static # pve.imxbt.cn解析的IP必须如实填写,否则QEMU会无法正常访问 ``` ### 修改hosts ```shell ip ad #查看自己IP nano /etc/hosts ``` 修改内容如下 ```yaml 127.0.0.1 localhost 114.5.1.4 pve.imxbt.cn pve # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters ``` ### 添加PVE存储库 安装依赖项 ```shell apt install curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates -y ``` 添加存储apt源 ```shell echo "deb http://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription" | tee /etc/apt/sources.list.d/pve-install-repo.list curl -fsSL http://download.proxmox.com/debian/proxmox-release-bookworm.gpg| gpg --dearmor -o /etc/apt/trusted.gpg.d/proxmox.gpg ``` 更新一下(主要是为了更新grub) ```shell apt full-upgrade -y ``` [可选]添加PVE Ceph包(部分网络环境会很慢) ```shell echo "deb http://download.proxmox.com/debian/ceph-quincy bookworm main" | tee /etc/apt/sources.list.d/ceph.list ``` ### 安装PVE内核 ```shell apt install pve-kernel-6.2 -y #安装最新的pve内核 reboot now #重启后将使用pve内核 ``` ### 安装PVE基础包 ```shell apt update && apt install proxmox-ve postfix open-iscsi ``` > [!WARNING] > > postfix是一个邮件服务,他会让你手动设置邮件发送内容,如果你不知道选择什么请直接选择 `Local only` 系统邮件名称可以直接回车,但是你的shell的屏幕分辨率必须大于876*512,否则会因为显示不全导致无法正常选择 ### 删除老东西 ```shell apt remove linux-image-amd64 -y update-grub apt remove os-prober reboot now ``` ## 完成 重启后访问 `https://ip:8006` 即可 取消回复 发表新评论 提交评论