Liunx网络重装Debian11脚本

628次阅读
没有评论

暂不支持 Oracle Linux 作为原系统。创建新机器时请选择 Ubuntu 20.04 或 18.04 系统模板。

  • 下载脚本:
curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh && chmod a+rx debi.sh
  • 运行脚本:
sudo ./debi.sh --cdn --network-console --ethx --bbr --user root --password <新系统用户密码>
  • 进阶版DD运行脚本:
sudo ./debi.sh --ethx --user root --password 你的密码 --bbr --timezone Asia/Shanghai --dns '8.8.8.8 8.8.4.4' --ssh-port 你的ssh端口 --version 10 --hostname 你的主机名
  • Oracle DD 运行脚本:
sudo ./debi.sh --architecture arm64 --ethx --user root --password 你的密码 --bbr --timezone Asia/Shanghai --dns '8.8.8.8 8.8.4.4' --ssh-port ssh端口 --version 10 --hostname wenjian
  • 纯 IPV6 DD 运行脚本:
sudo ./debi.sh --ethx --user root --password 你的密码 --bbr --timezone Asia/Shanghai --ssh-port 你的端口 --version 10 --hostname wenjian --ip 2001:bc8:62c:173::1/64 --gateway 2001:bc8:62c:173:: --netmask 255.255.255.254 --dns '2001:67c:2b0::4'
  • OVH Cloud VPS DD 运行脚本:
sudo ./debi.sh --ethx --user root --password 你的密码 --bbr --timezone Asia/Shanghai --ssh-port 你的ssh端口 --version 11 --hostname wenjian --ip 51.81.xx.xx(改成你的ip) --gateway 51.81.xx.xx(改成route-n获取到的) --netmask 255.255.0.0(网关必须是这个)
  • 重启开始安装:
sudo shutdown -r now
  • 约 30 秒后可以尝试 SSH 登录 installer 用户,密码与之前设置的相同。如果成功连接,可以按 Ctrl-A 然后再按 4 监控安装日志。安装完成后会自动重启进入新系统。
  • 您可以运行此命令来还原脚本所做的所有更改:
sudo rm -rf debi.sh /etc/default/grub.d/zz-debi.cfg /boot/debian-* && { sudo update-grub || sudo grub2-mkconfig -o /boot/grub2/grub.cfg; }
  • 可用选项/参数
  • --interface <string> Manually select a network interface, e.g. eth1
  • --ethx Disable Consistent Network Device Naming to get interface names like ethX back
  • --ip <string> Disable the auto network config (DHCP) and configure a static IP address, e.g. 10.0.0.21.2.3.4/242001:2345:6789:abcd::ef/48
  • --netmask <string> e.g. 255.255.255.0ffff:ffff:ffff:ffff::
  • --gateway <string> e.g. 10.0.0.1none if no gateway
  • --dns '8.8.8.8 8.8.4.4' (Default IPv6 DNS: 2001:4860:4860::8888 2001:4860:4860::8844)
  • --hostname <string> FQDN hostname (includes the domain name), e.g. server1.example.com
  • --network-console Enable the network console of the installer. ssh installer@ip to connect
  • --version 11 Supports: 9101112
  • --suite bullseye For normal cases, please use --version instead. e.g. stabletestingsid
  • --release-d-i d-i (Debian Installer) for the released versions: 11 (bullseye), 10 (buster) and 9 (stretch)
  • --daily-d-i Use latest daily build of d-i (Debian Installer) for the unreleased version: 12 (bookworm), sid (unstable)
  • --mirror-protocol http or https or ftp
  • --https alias to --mirror-protocol https
  • --reuse-proxy Reuse the value of http(s)_proxy environment variable as the mirror proxy
  • --proxy, --mirror-proxy Set an HTTP proxy for APT and downloads
  • --mirror-host deb.debian.org
  • --mirror-directory /debian
  • --security-repository http://security.debian.org/debian-security Magic value: 'mirror' = <mirror-protocol>://<mirror-host>/<mirror-directory>/../debian-security
  • --no-account-setup, --no-user (Manual installation) Proceed account setup manually in VNC or remote console.
  • --username, --user debian New user with sudo privilege or root
  • --password <string> Password of the new user. You’ll be prompted if you choose to not specify it here
  • --authorized-keys-url <string> URL to your authorized keys for SSH authentication. e.g. https://github.com/torvalds.keys
  • --sudo-with-password Require password when the user invokes sudo command
  • --timezone UTC e.g. Asia/Shanghai for China (UTC+8) https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
  • --ntp 0.debian.pool.ntp.org
  • --no-disk-partitioning, --no-part (Manual installation) Proceed disk partitioning manually in VNC or remote console
  • --disk <string> Manually select a disk for installation. Please remember to specify this when more than one disk is available! e.g. /dev/sda
  • --no-force-gpt By default, GPT rather than MBR partition table will be created. This option disables it.
  • --bios Don’t create EFI system partition. If GPT is being used, create a BIOS boot partition (bios_grub partition). Default if /sys/firmware/efi is absent. See
  • --efi Create an EFI system partition. Default if /sys/firmware/efi exists
  • --esp 106 Size of the EFI system partition. e.g. 106538 and 1075 result to 100 MiB, 512 MiB, 1 GiB respectively
  • --filesystem ext4
  • --kernel <string> Choose an package for the kernel image
  • --cloud-kernel Choose linux-image-cloud-amd64 or ...arm64 as the kernel image
  • --bpo-kernel Choose the kernel image from Debian Backports (newer version from the next Debian release)
  • --no-install-recommends
  • --install 'ca-certificates libpam-systemd' Install additional APT packages. Space-separated and quoted.
  • --safe-upgrade (Default) apt upgrade --with-new-pkgsSee
  • --full-upgrade apt dist-upgrade
  • --no-upgrade
  • --bbr Enable TCP BBR congestion control
  • --ssh-port <integer> SSH port
  • --hold Don’t reboot or power off after installation
  • --power-off Power off after installation rather than reboot
  • --architecture <string> e.g. amd64i386arm64armhf, etc.
  • --firmware Load additional non-free firmwares
  • --no-force-efi-extra-removable See
  • --grub-timeout 5 How many seconds the GRUB menu shows before entering the installer
  • --force-lowmem <integer> Valid values: 0, 1, 2. Force low memory level. Useful if your machine has memory less than 500M where level 2 is set (see issue #45). --force-lowmem 1 may solve it.
  • --dry-run Print generated preseed and GRUB entry without downloading the installer and actually saving them

Presets

--cdn

  • --mirror-protocol https
  • --mirror-host deb.debian.org
  • --security-repository mirror

--aws

  • --mirror-protocol https
  • --mirror-host cdn-aws.deb.debian.org
  • --security-repository mirror

--china

  • --dns '223.5.5.5 223.6.6.6'
  • --mirror-protocol https
  • --mirror-host mirrors.aliyun.com
  • --security-repository mirror
  • --ntp ntp.aliyun.com
正文完
 
Wen' Jian
版权声明:本站原创文章,由 Wen' Jian 2022-12-04发表,共计5191字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)