8000 GitHub - mushchen123321/debi: Reinstall your VPS to minimal Debian
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mushchen123321/debi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Debian Network Reinstall Script

General description in English ↓

VPS 网络重装 Debian 11 脚本

暂不支持 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 <新系统用户密码>
  • --bbr 开启 BBR
  • --ethx 网卡名称使用传统形式,如 eth0 而不是 ens3
  • --cloud-kernel 安装占用空间较小的 cloud 内核,但可能会导致 UEFI 启动的机器(如 Oracle、Azure 及 Hyper-V、Google Cloud 等)VNC 黑屏。BIOS 启动的普通 VPS 则没有此问题。
  • 默认时区为 UTC,添加 --timezone Asia/Shanghai 可使用中国时区。
  • 默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加 --china 可使用阿里云镜像源。

如果没有报错可以重启:

sudo shutdown -r now

约 30 秒后可以尝试 SSH 登录 installer 用户,密码与之前设置的相同。如果成功连接,可以按 Ctrl-A 然后再按 4 监控安装日志。安装完成后会自动重启进入新系统。

Introduction

This script is written to reinstall a VPS/virtual machine to minimal Debian 11.

Should Work On

Virtualization Platform

  • SolusVM/OpenStack/DigitalOcean/Vultr/Linode/Proxmox/QEMU KVM (BIOS boot)
  • Oracle Cloud Infrastructure (UEFI boot)
  • Google Cloud Compute Engine (Must manually configure the VPC internal IP and the gateway. UEFI boot with Secure Boot support)
  • AWS EC2 & Lightsail (BIOS boot)
  • Hyper-V & Azure (Generation 1 BIOS boot & Generation 2 UEFI boot)

Original OS

  • Debian 8 or later
  • Ubuntu 14.04 or later
  • CentOS 7 or later

How It Works

  1. Generate a preseed file to automate installation
  2. Download the 'Debian-Installer' to the /boot directory
  3. Append a menu entry of the installer to the GRUB2 configuration file

Usage

1. Download

Download the script with curl:

curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh

# for IPv6-only machines
curl -fLO --resolve 'raw.githubusercontent.com:443:2a04:4e42::133' https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh

or wget:

wget -O debi.sh https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh

2. Run

Run the script under root or using sudo:

chmod a+rx debi.sh
sudo ./debi.sh

By default, an admin user debian with sudo privilege will be created during the installation. Use --user root if you prefer.

3. Reboot

If everything looks good, reboot the machine:

sudo shutdown -r now

Otherwise, you can run this command to revert all changes made by the script:

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; }

Available Options