镜像安装

  • 用的是debian-12.8.0-amd64-DVD-1.iso

  • ventoy直接刷,不用网络镜像,不要桌面环境,要个ssh和基础系统工具就行,(分区如下

    分区 大小
    efi 256MB #以前500M感觉大了
    swap 8G #内存就8G
    / 20G #够用就行
    /home 剩余硬盘空间
  • 过程中遇到了些问题,grub没有被正确安装,导致bios认为我的硬盘没有操作系统,解决方式参考bilibili

    1. 还是先进安装镜像选Advanced optionsrescue mode
    2. 中间忘了,不过问题不大,能找到
    3. 点来点去来到Enter a device you wish to use as your root root file system
    4. 回想一下根目录在哪里(自动分区可能在/dev/sda2)手动分的/区在/dev/sda3
    5. Mount separate /boot/efi partition
    6. Force GRUB installation to the EFI removable media path把GRUB扔到这个分区来
    7. 拔U盘重启就可以正常引导了

初始配置

初始系统还是太简洁了,我也不知道要做些什么,慢慢来吧

ssh

# /etc/ssh/sshd_config 增加一条:PasswordAuthentication yes
systemctl restart ssh

网络设置

# /etc/network/interface

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp1s0
iface enp1s0 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        gateway 192.168.1.1
        dns-nameservers 114.114.114.114 114.114.115.115
# This is an autoconfigured IPv6 interface
iface enp1s0 inet6 auto

重启下网络服务:

systemctl restart networking.service

镜像源

使用USTC镜像软件源

# deb cdrom:[Debian GNU/Linux 12.8.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20241109-11:05]/ bookworm co>

# 默认注释了源码仓库,如有需要可自行取消注释
deb http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware
deb http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware

# backports 软件源,请按需启用
# deb http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware

sudo

# 首先普通用户登录
su -l # 进入超级用户,不能忘了-l 不然进去没有adduser命令

apt update && apt upgrade
apt install sudo # Debian最小化安装完没有sudo真搞吧

adduser USERNAME sudo # USERNAME为当前用户名
exit

groups #查看当前用户的组

再来一块硬盘

mkdir /home/wingchaos/Disk
sudo mount /dev/sdb1 /home/wingchaos/Disk

目前用到的软件

持续更新

sudo apt install wget   # wget倾向于下载文件,
sudo apt install curl   # 而这位更偏向网络调试工具,可以看看阮一峰的博客http://www.ruanyifeng.com/blog/2011/09/curl.html

Syncthing

Debian apt安装的版本实在是太老了,参考官方Linux安装文档

# Add the release PGP keys:
sudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg

# Add the "stable" channel to your APT sources:
echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list

# Update and install syncthing:
sudo apt-get update
sudo apt-get install syncthing

syncthing的默认ip设置为127.0.0.1无法在局域网中访问,需要更改设置:

# ~/.local/status/syncthing/config.xml
<address>0.0.0.0:8384</address>

官方的Linux自启动方案:

# 使用systemd设置用户服务
systemctl --user enable syncthing.service
systemctl --user start syncthing.service

# 如果需要在登录用户前启动
sudo loginctl enable-linger USERNAME

qBittorrent-nox

sudo apt install qbittorrent-nox
sudo adduser --system --group qbittorrent-nox
sudo adduser USERNAME qbittorrent-nox
sudo nano /etc/systemd/system/qbittorrent-nox.service
######
[Unit]
Description=qBittorrent Command Line Client
After=network.target

[Service]
Type=forking
User=qbittorrent-nox
Group=qbittorrent-nox
UMask=007
ExecStart=/usr/bin/qbittorrent-nox -d --webui-port=8080
Restart=on-failure

[Install]
WantedBy=multi-user.target
######
sudo systemctl daemon-reloa
sudo mkdir /home/qbittorrent-nox
sudo chown qbittorrent-nox:qbittorrent-nox /home/qbittorrent-nox
sudo usermod -d /home/qbittorrent-nox qbittorrent-nox
sudo systemctl enable qbittorrent-nox
sudo systemctl start qbittorrent-nox
sudo systemctl status qbittorrent-nox

filebrowser

sudo mkdir /usr/local/filebrowser && cd /usr/local/filebrowser
sudo wget https://github.com/filebrowser/filebrowser/releases/download/v2.31.2/linux-amd64-filebrowser.tar.gz
sudo tar -xvf linux-amd64-filebrowser.tar.gz
sudo nano config.json
{
    "address" : "0.0.0.0",
    "port" : 80,
    "database" : "/usr/local/filebrowser/filebrowser.db", 
    "root" : "/home/wingchaos/"
}
sudo nano /etc/systemd/system/filebrowser.service
######
[Unit]
Description=The filebrowser Process Manager
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/filebrowser/filebrowser -c /usr/local/filebrowser/config.json
ExecStop=/bin/killall filebrowser
PrivateTmp=true

[Install]
WantedBy=multi-user.target
######
sudo systemctl daemon-reload
sudo systemctl enable filebrowser.service
sudo systemctl start filebrowser.service