
debian 前言
Debian是一个基于Linux内核的自由和开放源代码操作系统,由全球志愿者组成的Debian项目维护和开发。该项目始于1993年,由Ian Murdock发起,旨在创建一个完整的、基于Linux的自由软件操作系统。
debian download
|--------------------------------------------------------------|--------------------------------------------------------------------|-------------------------------------------------------------|----------------------------------------------------|----------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| debian | debian 历史版 | debian 发行版 | debian 安装 | debian preseed.cfg自动化编排 | Debian 全球镜像站 |
| download | download | 参考 | 参考 | 参考 | download |
| download | download | 参考 | 参考 | 参考 | download |
| download | download | 参考 | 参考 | 参考 | download |
开始安装debian

语言选择

时区设置

选择键盘模式:American English

配置网卡,选择GO Back

手动配置IP

ip 配置

子网掩码配置

网关配置

DNS配置

主机名称设置

设置域名:可不填写

root 密码配置

创建普通用户

普通用户密码配置

时间服务器配置

磁盘分区方式选择,使用所有分区
- Guided-use entire disk 带引导模式方式直接使用整块磁盘
- Guided-use entire disk and set up LVM 带引导模式方式使用整块磁盘并使用LVM,LVM(Logical Volume Mananger)逻辑卷管理,可对磁盘进行弹性管理
- Guided-use entire disk and set up encrypted LVM 带引导模式方式使用整块磁盘并使用加密的LVM
- Manual 完全手动模式

磁盘分区

所有的文件都位于一个分区中
- All files in one partition(recommended for new users) 所有的文件都位于一个分区中(推荐新用户)
- Separate /home partition 单独设置home分区
- Separate /home,/var,and /tmp partitions 单独设置home分区,var分区以及tmp分区

磁盘分区,提醒磁盘将被改变并设置LVM,选择:Yes

指定分区要使用的磁盘大小,默认使用整个磁盘的大小,默认即可

获取将要对磁盘的操作信息,选择:no

更改/分区为xfs,便于后期在线扩容



磁盘更改完成,选择yes ,格式化磁盘

开始安装系统

是否扫描安装介质,选择:No

是否使用网络镜像源,选择:yes
- 国内网络不好,此处可根据自身网络情况选择,选择no,后续手动更改源即可

选择网络源

配置包管理器

等待安装

是否参与使用系统调查(每周系统自动提交一个脚本给系统开发者),选择:No

命令行安装
standard
(标准工具)desktop
(图形化桌面)gnome-desktop
(Gnome 桌面)xfce-desktop
(XFCE 桌面)kde-desktop
(KDE Plasma 桌面)cinnamon-desktop
(Cinnamon 桌面)mate-desktop
(MATE 桌面)desktop)lxde-desktop
(LXDE 桌面)web-server
(web 服务器)ssh-server
(SSH 服务器)

安装中,等待

重启 reboot

shell 登录查看

远程SSH 连接配置
-
重启ssh
cat >>/etc/ssh/sshd_config<<EOF
add 18
PermitRootLogin yes
EOFsystemctl restart ssh
更换阿里云源
-
echo "Change the debian source"
mv /etc/apt/sources.list /etc/apt/sources.list.bakcat <<'EOF'>>/etc/apt/sources.list
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
EOFapt-get clean
apt-get update
apt install -y vim
切换sh为bash
ln -sf bash /bin/sh
Network 配置
nic_network_name=`ifconfig -s | awk 'NR>1 && !/^lo/ && !/^idrac/ && !/^br/ && !/^veth/ && !/^docker/{print $1; exit}'`
IP_ADDRESS="192.168.11.69"
PREFIX_mask="24"
GATEWAY="192.168.11.1"
DNS1="8.8.8.8"
echo "delete default interfaces"
rm -rf /etc/network/interfaces
echo "Function interfaces"
cat <<EOF>>/etc/network/interfaces
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
allow-hotplug $nic_network_name
iface $nic_network_name inet static
address $IP_ADDRESS/$PREFIX_mask
gateway $GATEWAY
dns-nameservers $DNS1
EOF
echo "Restart the NIC to take effect"
systemctl restart ifup@$nic_network_name