Archived
适配 trixie 版本
This commit is contained in:
+1
-1
@@ -207,7 +207,7 @@ $ cat /etc/fstab
|
|||||||
$ cat /etc/os-release
|
$ cat /etc/os-release
|
||||||
```
|
```
|
||||||
|
|
||||||
此处显示出 PVE 底层使用的是 Debian 的系统,代号为 `bookworm` ,该代号后续会使用到。
|
此处显示出 PVE 底层使用的是 Debian 的系统,代号为 `trixie` ,该代号后续会使用到。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,9 @@ $ apt install iftop iperf3 iperf
|
|||||||
|
|
||||||
## 根据 CPU 厂商安装 CPU 微码工具(可选,现已默认安装)
|
## 根据 CPU 厂商安装 CPU 微码工具(可选,现已默认安装)
|
||||||
$ apt install intel-microcode (amd64-microcode)
|
$ apt install intel-microcode (amd64-microcode)
|
||||||
|
|
||||||
|
## 刷新 systemd 日志分类索引
|
||||||
|
$ journalctl --update-catalog
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3.配置 PVE 网络
|
## 3.配置 PVE 网络
|
||||||
|
|||||||
+2
-25
@@ -6,29 +6,6 @@
|
|||||||
|
|
||||||
关于 [Neovim](https://neovim.io/) 的基础使用方法,请参阅:[Neovim 基础教程](https://cn.bing.com/search?q=Neovim+%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B) 。
|
关于 [Neovim](https://neovim.io/) 的基础使用方法,请参阅:[Neovim 基础教程](https://cn.bing.com/search?q=Neovim+%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B) 。
|
||||||
|
|
||||||
```bash
|
|
||||||
## 同步镜像仓库
|
|
||||||
$ apt update
|
|
||||||
|
|
||||||
## 安装系统软件
|
|
||||||
$ apt install btop lm-sensors tmux neovim unzip unattended-upgrades powermgmt-base sshguard
|
|
||||||
|
|
||||||
## 安装 CPU 调度调整工具
|
|
||||||
$ apt install linux-cpupower
|
|
||||||
|
|
||||||
## 根据 CPU 厂商安装 CPU 微码工具
|
|
||||||
$ apt install intel-microcode (amd64-microcode)
|
|
||||||
|
|
||||||
## 安装 Open vSwitch(可选)
|
|
||||||
$ apt install openvswitch-switch
|
|
||||||
|
|
||||||
## 安装网络检测工具(可选)
|
|
||||||
$ apt install iftop iperf3 iperf
|
|
||||||
|
|
||||||
## 更新 PCI 数据库
|
|
||||||
$ update-pciids
|
|
||||||
```
|
|
||||||
|
|
||||||
## 1.系统时区
|
## 1.系统时区
|
||||||
|
|
||||||
如果在安装 PVE 系统时选错了时区,导致系统时间和北京时间不一致,可以执行以下命令修正。
|
如果在安装 PVE 系统时选错了时区,导致系统时间和北京时间不一致,可以执行以下命令修正。
|
||||||
@@ -339,7 +316,7 @@ $ nvim /etc/apt/apt.conf.d/50unattended-upgrades
|
|||||||
|
|
||||||
配置文件中,被修改的参数解释如下:
|
配置文件中,被修改的参数解释如下:
|
||||||
|
|
||||||
- 启用了 Debian `bookworm-updates` 相关更新。
|
- 启用了 Debian `trixie-updates` 相关更新。
|
||||||
|
|
||||||
- 增加并启用 PVE 自有仓库的更新。
|
- 增加并启用 PVE 自有仓库的更新。
|
||||||
|
|
||||||
@@ -370,7 +347,7 @@ $ nvim /etc/apt/apt.conf.d/50unattended-upgrades
|
|||||||
|
|
||||||
## 按需添加 PVE Ceph 更新项目
|
## 按需添加 PVE Ceph 更新项目
|
||||||
|
|
||||||
"origin=Proxmox,codename=${distro_codename},label=Proxmox Ceph Debian Repository";
|
"origin=Proxmox,codename=${distro_codename},label=Proxmox Ceph 19 Squid Debian Repository";
|
||||||
|
|
||||||
## 在配置文件末尾增加以下配置项,代表启用,并调整参数
|
## 在配置文件末尾增加以下配置项,代表启用,并调整参数
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
本文将使用 Debian 的云镜像 `debian-12-generic-amd64.qcow2` 作为模板虚拟机的镜像。
|
本文将使用 Debian 的云镜像 `debian-12-generic-amd64.qcow2` 作为模板虚拟机的镜像。
|
||||||
|
|
||||||
访问 [Debian Official Cloud Images](https://cloud.debian.org/images/cloud/) 官方网站,下载最新版 `Bookworm` 云镜像以及对应的校验文件。
|
访问 [Debian Official Cloud Images](https://cloud.debian.org/images/cloud/) 官方网站,下载最新版 `Trixie` 云镜像以及对应的校验文件。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -104,10 +104,10 @@ $ cd /tmp/Debian
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
## 下载云镜像校验文件
|
## 下载云镜像校验文件
|
||||||
$ wget https://cloud.debian.org/images/cloud/bookworm/latest/SHA512SUMS
|
$ wget https://cloud.debian.org/images/cloud/trixie/latest/SHA512SUMS
|
||||||
|
|
||||||
## 下载云镜像
|
## 下载云镜像
|
||||||
$ wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2
|
$ wget https://cloud.debian.org/images/cloud/trixie/latest/debian-13-generic-amd64.qcow2
|
||||||
|
|
||||||
## 检查文件是否存在
|
## 检查文件是否存在
|
||||||
$ ls -lah
|
$ ls -lah
|
||||||
|
|||||||
+10
-57
@@ -51,76 +51,26 @@ $ sudo systemctl restart ssh.service
|
|||||||
|
|
||||||
当系统版本发生变化时,请参考 USTC 镜像站的官方说明 [USTC Mirror Help - Debian](https://mirrors.ustc.edu.cn/help/debian.html) 。
|
当系统版本发生变化时,请参考 USTC 镜像站的官方说明 [USTC Mirror Help - Debian](https://mirrors.ustc.edu.cn/help/debian.html) 。
|
||||||
|
|
||||||
Debian12 云镜像的软件源配置采用了 `DEB822` 格式,新版 `sources.list` 配置文件内容如下。
|
使用如下命令对 `debian.sources` 配置文件进行修改。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
## 查看镜像配置文件
|
## 配置 Debian 系统默认软件源脚本
|
||||||
$ cat /etc/apt/sources.list
|
|
||||||
|
|
||||||
#### 配置文件示例输出
|
|
||||||
# See /etc/apt/sources.list.d/debian.sources
|
|
||||||
```
|
|
||||||
|
|
||||||
进一步查看新配置文件 `debian.sources` 的内容,其配置包含 `3` 个部分。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
## 查看新版镜像配置文件
|
|
||||||
$ cat /etc/apt/sources.list.d/debian.sources
|
|
||||||
|
|
||||||
#### 新版配置文件示例输出 (主体部分)
|
|
||||||
Types: deb deb-src
|
|
||||||
URIs: mirror+file:///etc/apt/mirrors/debian.list
|
|
||||||
Suites: bookworm bookworm-updates bookworm-backports
|
|
||||||
Components: main
|
|
||||||
|
|
||||||
Types: deb deb-src
|
|
||||||
URIs: mirror+file:///etc/apt/mirrors/debian-security.list
|
|
||||||
Suites: bookworm-security
|
|
||||||
Components: main
|
|
||||||
|
|
||||||
## 查看关联的配置文件
|
|
||||||
$ cat /etc/apt/mirrors/debian.list
|
|
||||||
|
|
||||||
#### 关联配置文件示例输出 (关联部分 1 )
|
|
||||||
https://deb.debian.org/debian
|
|
||||||
|
|
||||||
## 查看关联的配置文件
|
|
||||||
$ cat /etc/apt/mirrors/debian-security.list
|
|
||||||
|
|
||||||
#### 关联配置文件示例输出 (关联部分 2 )
|
|
||||||
https://deb.debian.org/debian-security
|
|
||||||
```
|
|
||||||
|
|
||||||
因此,修改 Debian12 软件源的方式也有两种,本文将尝试使用第 `2` 种修改方案。
|
|
||||||
|
|
||||||
1. 删除当前软件源配置文件,重新启用常规 `sources.list` 配置文件的配置方案。
|
|
||||||
|
|
||||||
2. 根据当前软件源配置文件的语法规则,仅修改配置文件。
|
|
||||||
|
|
||||||
使用 `vim` 编辑器编辑 `debian.sources` 配置文件,执行以下命令。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
## 编辑 debian.sources 配置文件
|
|
||||||
$ sudo vim /etc/apt/sources.list.d/debian.sources
|
|
||||||
```
|
|
||||||
|
|
||||||
删除里面全部内容,添加以下配置项,并保存。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
## 系统软件源配置项
|
|
||||||
|
|
||||||
|
$ sudo cat > /etc/apt/sources.list.d/debian.sources <<EOF
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://mirrors.ustc.edu.cn/debian
|
URIs: https://mirrors.ustc.edu.cn/debian
|
||||||
Suites: bookworm bookworm-updates
|
Suites: trixie trixie-updates
|
||||||
Components: main contrib non-free non-free-firmware
|
Components: main contrib non-free non-free-firmware
|
||||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://mirrors.ustc.edu.cn/debian-security
|
URIs: https://mirrors.ustc.edu.cn/debian-security
|
||||||
Suites: bookworm-security
|
Suites: trixie-security
|
||||||
Components: main contrib non-free non-free-firmware
|
Components: main contrib non-free non-free-firmware
|
||||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
为了防止 `Cloud-Init` 服务意外修改软件源配置,需要添加文件保护,执行以下命令。
|
为了防止 `Cloud-Init` 服务意外修改软件源配置,需要添加文件保护,执行以下命令。
|
||||||
@@ -166,6 +116,9 @@ $ sudo apt install nftables sshguard lsof knot-dnsutils
|
|||||||
## 安装网络检测工具(可选)
|
## 安装网络检测工具(可选)
|
||||||
$ sudo apt install iftop iperf3 iperf
|
$ sudo apt install iftop iperf3 iperf
|
||||||
|
|
||||||
|
## 刷新 systemd 日志分类索引
|
||||||
|
$ sudo journalctl --update-catalog
|
||||||
|
|
||||||
## 写入磁盘
|
## 写入磁盘
|
||||||
$ sudo sync
|
$ sudo sync
|
||||||
```
|
```
|
||||||
|
|||||||
+12
-13
@@ -58,30 +58,26 @@ $ sudo systemctl restart ssh.service
|
|||||||
|
|
||||||
当系统版本发生变化时,请参考 USTC 镜像站的官方说明 [USTC Mirror Help - Debian](https://mirrors.ustc.edu.cn/help/debian.html) 。
|
当系统版本发生变化时,请参考 USTC 镜像站的官方说明 [USTC Mirror Help - Debian](https://mirrors.ustc.edu.cn/help/debian.html) 。
|
||||||
|
|
||||||
使用 `vim` 编辑器编辑 `debian.sources` 配置文件,执行以下命令。
|
使用如下命令对 `debian.sources` 配置文件进行修改。
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
## 编辑 debian.sources 配置文件
|
## 配置 Debian 系统默认软件源脚本
|
||||||
$ sudo vim /etc/apt/sources.list.d/debian.sources
|
|
||||||
```
|
|
||||||
|
|
||||||
删除里面全部内容,添加以下配置项,并保存。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
## 系统软件源配置项
|
|
||||||
|
|
||||||
|
$ sudo cat > /etc/apt/sources.list.d/debian.sources <<EOF
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://mirrors.ustc.edu.cn/debian
|
URIs: https://mirrors.ustc.edu.cn/debian
|
||||||
Suites: bookworm bookworm-updates
|
Suites: trixie trixie-updates
|
||||||
Components: main contrib non-free non-free-firmware
|
Components: main contrib non-free non-free-firmware
|
||||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://mirrors.ustc.edu.cn/debian-security
|
URIs: https://mirrors.ustc.edu.cn/debian-security
|
||||||
Suites: bookworm-security
|
Suites: trixie-security
|
||||||
Components: main contrib non-free non-free-firmware
|
Components: main contrib non-free non-free-firmware
|
||||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
为了防止 `Cloud-Init` 服务意外修改软件源配置,需要添加文件保护,执行以下命令。
|
为了防止 `Cloud-Init` 服务意外修改软件源配置,需要添加文件保护,执行以下命令。
|
||||||
@@ -101,10 +97,10 @@ $ lsattr /etc/apt/sources.list.d/debian.sources
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
## 添加 TS 签名密钥
|
## 添加 TS 签名密钥
|
||||||
$ curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg > /dev/null
|
$ curl -fsSL https://pkgs.tailscale.com/stable/debian/trixie.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg > /dev/null
|
||||||
|
|
||||||
## 添加 TS 软件源
|
## 添加 TS 软件源
|
||||||
$ curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
|
$ curl -fsSL https://pkgs.tailscale.com/stable/debian/trixie.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1.3.安装软件
|
### 1.3.安装软件
|
||||||
@@ -140,6 +136,9 @@ $ sudo apt install tailscale
|
|||||||
## 安装网络检测工具(可选)
|
## 安装网络检测工具(可选)
|
||||||
$ sudo apt install iftop iperf3 iperf
|
$ sudo apt install iftop iperf3 iperf
|
||||||
|
|
||||||
|
## 刷新 systemd 日志分类索引
|
||||||
|
$ sudo journalctl --update-catalog
|
||||||
|
|
||||||
## 写入磁盘
|
## 写入磁盘
|
||||||
$ sudo sync
|
$ sudo sync
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ Unattended-Upgrade::Origins-Pattern {
|
|||||||
"origin=Debian,codename=${distro_codename},label=Debian";
|
"origin=Debian,codename=${distro_codename},label=Debian";
|
||||||
"origin=Debian,codename=${distro_codename},label=Debian-Security";
|
"origin=Debian,codename=${distro_codename},label=Debian-Security";
|
||||||
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
|
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
|
||||||
|
// "o=Debian Backports,n=${distro_codename}-backports,l=Debian Backports";
|
||||||
|
|
||||||
// Archive or Suite based matching:
|
// Archive or Suite based matching:
|
||||||
// Note that this will silently match a different release after
|
// Note that this will silently match a different release after
|
||||||
@@ -39,7 +40,7 @@ Unattended-Upgrade::Origins-Pattern {
|
|||||||
// "o=Debian,a=stable";
|
// "o=Debian,a=stable";
|
||||||
// "o=Debian,a=stable-updates";
|
// "o=Debian,a=stable-updates";
|
||||||
// "o=Debian,a=proposed-updates";
|
// "o=Debian,a=proposed-updates";
|
||||||
// "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
|
// "o=Debian Backports,a=stable-backports,l=Debian Backports";
|
||||||
};
|
};
|
||||||
|
|
||||||
// Python regular expressions, matching packages to exclude from upgrading
|
// Python regular expressions, matching packages to exclude from upgrading
|
||||||
@@ -72,7 +73,7 @@ Unattended-Upgrade::Package-Blacklist {
|
|||||||
|
|
||||||
// Split the upgrade into the smallest possible chunks so that
|
// Split the upgrade into the smallest possible chunks so that
|
||||||
// they can be interrupted with SIGTERM. This makes the upgrade
|
// they can be interrupted with SIGTERM. This makes the upgrade
|
||||||
// a bit slower but it has the benefit that shutdown while a upgrade
|
// a bit slower but it has the benefit that shutdown while an upgrade
|
||||||
// is running is possible (with a small delay)
|
// is running is possible (with a small delay)
|
||||||
//Unattended-Upgrade::MinimalSteps "true";
|
//Unattended-Upgrade::MinimalSteps "true";
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://mirrors.ustc.edu.cn/debian
|
URIs: https://mirrors.ustc.edu.cn/debian
|
||||||
Suites: bookworm bookworm-updates
|
Suites: trixie trixie-updates
|
||||||
Components: main contrib non-free non-free-firmware
|
Components: main contrib non-free non-free-firmware
|
||||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: https://mirrors.ustc.edu.cn/debian-security
|
URIs: https://mirrors.ustc.edu.cn/debian-security
|
||||||
Suites: bookworm-security
|
Suites: trixie-security
|
||||||
Components: main contrib non-free non-free-firmware
|
Components: main contrib non-free non-free-firmware
|
||||||
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ Unattended-Upgrade::Origins-Pattern {
|
|||||||
"origin=Debian,codename=${distro_codename},label=Debian";
|
"origin=Debian,codename=${distro_codename},label=Debian";
|
||||||
"origin=Debian,codename=${distro_codename},label=Debian-Security";
|
"origin=Debian,codename=${distro_codename},label=Debian-Security";
|
||||||
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
|
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
|
||||||
|
// "o=Debian Backports,n=${distro_codename}-backports,l=Debian Backports";
|
||||||
"origin=Proxmox,codename=${distro_codename},label=Proxmox Debian Repository";
|
"origin=Proxmox,codename=${distro_codename},label=Proxmox Debian Repository";
|
||||||
// "origin=Proxmox,codename=${distro_codename},label=Proxmox Ceph Debian Repository";
|
// "origin=Proxmox,codename=${distro_codename},label=Proxmox Ceph 19 Squid Debian Repository";
|
||||||
|
|
||||||
// Archive or Suite based matching:
|
// Archive or Suite based matching:
|
||||||
// Note that this will silently match a different release after
|
// Note that this will silently match a different release after
|
||||||
@@ -41,7 +42,7 @@ Unattended-Upgrade::Origins-Pattern {
|
|||||||
// "o=Debian,a=stable";
|
// "o=Debian,a=stable";
|
||||||
// "o=Debian,a=stable-updates";
|
// "o=Debian,a=stable-updates";
|
||||||
// "o=Debian,a=proposed-updates";
|
// "o=Debian,a=proposed-updates";
|
||||||
// "o=Debian Backports,a=${distro_codename}-backports,l=Debian Backports";
|
// "o=Debian Backports,a=stable-backports,l=Debian Backports";
|
||||||
};
|
};
|
||||||
|
|
||||||
// Python regular expressions, matching packages to exclude from upgrading
|
// Python regular expressions, matching packages to exclude from upgrading
|
||||||
@@ -74,7 +75,7 @@ Unattended-Upgrade::Package-Blacklist {
|
|||||||
|
|
||||||
// Split the upgrade into the smallest possible chunks so that
|
// Split the upgrade into the smallest possible chunks so that
|
||||||
// they can be interrupted with SIGTERM. This makes the upgrade
|
// they can be interrupted with SIGTERM. This makes the upgrade
|
||||||
// a bit slower but it has the benefit that shutdown while a upgrade
|
// a bit slower but it has the benefit that shutdown while an upgrade
|
||||||
// is running is possible (with a small delay)
|
// is running is possible (with a small delay)
|
||||||
//Unattended-Upgrade::MinimalSteps "true";
|
//Unattended-Upgrade::MinimalSteps "true";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user