debian 前言
Debian是一個基于Linux內核的自由和開放源代碼操作系統,由全球志愿者組成的Debian項目維護和開發。該項目始于1993年,由Ian Murdock發起,旨在創建一個完整的、基于Linux的自由軟件操作系統。
debian download
- debian 百度網盤離線
- PXE Server 自動化部署debian參考
debian | debian 歷史版 | debian 發行版 | debian 安裝 | debian preseed.cfg自動化編排 | Debian 全球鏡像站 |
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,后續手動更改源即可
選擇網絡源?
- 清華大學開源軟件Debian鏡像站
- 全球鏡像站
- 阿里巴巴開源鏡像站
配置包管理器
等待安裝
是否參與使用系統調查(每周系統自動提交一個腳本給系統開發者),選擇: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
?更換阿里云源
- 清華大學開源軟件Debian鏡像站
- 阿里巴巴開源鏡像站
- 全球鏡像站
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/interfacesecho "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
EOFecho "Restart the NIC to take effect"
systemctl restart ifup@$nic_network_name