mirror of
https://github.com/bohanyang/debi.git
synced 2026-09-27 14:36:20 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e856aca7c3 | ||
|
|
2de8a1a23d |
@@ -1,58 +1,22 @@
|
||||
# Debian Network Reinstall Script
|
||||
|
||||
[General description in English ↓](#introduction)
|
||||
|
||||
## VPS 网络重装 Debian 12 脚本
|
||||
|
||||
下载脚本:
|
||||
|
||||
```
|
||||
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),添加 `--ustc` 可使用中科大镜像源。
|
||||
|
||||
如果没有报错可以重启:
|
||||
|
||||
```
|
||||
sudo shutdown -r now
|
||||
```
|
||||
|
||||
约 30 秒后可以尝试 SSH 登录 `installer` 用户,密码与之前设置的相同。如果成功连接,可以按 Ctrl-A 然后再按 4 监控安装日志。安装完成后会自动重启进入新系统。
|
||||
|
||||
|
||||
### [Oracle 自动获取 IPv6](https://github.com/bohanyang/debi/wiki/%E7%94%B2%E9%AA%A8%E6%96%87%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%87%AA%E5%8A%A8%E8%8E%B7%E5%8F%96-IPv6)
|
||||
### [Oracle 纯 IPv6 网络(无公网 IPv4)下安装方法](https://github.com/bohanyang/debi/wiki/%E7%94%B2%E9%AA%A8%E6%96%87%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BA%AF-IPv6-%E7%BD%91%E7%BB%9C%EF%BC%88%E6%97%A0%E5%85%AC%E7%BD%91-IPv4%EF%BC%89%E4%B8%8B%E5%AE%89%E8%A3%85%E6%96%B9%E6%B3%95)
|
||||
[中文说明 ↓](#中文说明)
|
||||
|
||||
## Introduction
|
||||
|
||||
This script is written to reinstall a VPS/virtual machine to minimal Debian 10/11/12.
|
||||
This script is written to reinstall VPS/VMs to minimal Debian.
|
||||
|
||||
## Should Work On
|
||||
## Platforms
|
||||
|
||||
### 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
|
||||
* RHEL/CentOS/Alma/Rocky/Oracle Linux 7 or later
|
||||
- ✔ KVM or physical machines ❌ Containers
|
||||
- ✔ Debian or Ubuntu or Red Hat Linux as original OS with GRUB 2 bootloader
|
||||
- ✔ MBR or GPT partition table
|
||||
- ✔ Multiple disks or LVM
|
||||
- ✔ IPv4 or IPv6
|
||||
- ✔ Legacy BIOS or UEFI boot
|
||||
- ✔ Most VPS or cloud providers
|
||||
- ⚠️ Google Compute Engine - **MUST** manually specify IP/CIDR and gateway of VPC
|
||||
- ⚠️ AWS EC2 or Lightsail - Does **NOT** work with UEFI boot
|
||||
|
||||
## How It Works
|
||||
|
||||
@@ -162,3 +126,31 @@ Otherwise, you can run this command to revert all changes made by the script:
|
||||
* `--force-lowmem <integer>` Valid values: 0, 1, 2. Force [low memory level](https://salsa.debian.org/installer-team/lowmem). 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
|
||||
* `--cidata ./cidata-example` Custom data for cloud-init. **VM provider's data source will be IGNORED.** See example.
|
||||
|
||||
## 中文说明
|
||||
|
||||
下载脚本:
|
||||
|
||||
```
|
||||
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),添加 `--ustc` 可使用中科大镜像源。
|
||||
|
||||
如果没有报错可以重启:
|
||||
|
||||
```
|
||||
sudo shutdown -r now
|
||||
```
|
||||
|
||||
约 30 秒后可以尝试 SSH 登录 `installer` 用户,密码与之前设置的相同。如果成功连接,可以按 Ctrl-A 然后再按 4 监控安装日志。安装完成后会自动重启进入新系统。
|
||||
|
||||
Reference in New Issue
Block a user