bin456789/reinstall

▲ 105 stars today★ 13,550⑂ 2,194

一键DD/重装脚本 (One-click reinstall OS on VPS)

About bin456789/reinstall

bin456789/reinstall is an open-source project on GitHub, mainly written in Shell. 一键DD/重装脚本 (One-click reinstall OS on VPS) It currently holds 13,550 stars and 2,194 forks with 45 open issues, and was last pushed on 2026-10-04 (repository created 2022-09-25).

Project Overview

Git Homed tracks it on the Today's Trending board, currently at rank #47 with 105 new stars today.

GitHub Repository Details

Repository bin456789/reinstall · default branch main · size 1894 KB · watchers 44 · source: GitHub REST API and repository README

README

reinstall

Codacy CodeFactor Lines of Code

https://github.com/bin456789/reinstall/blob/HEAD/bin456789%2Freinstall | Trendshift

一键 VPS 系统重装脚本 English

介绍

请我喝奶茶: Donate

Sponsors

反馈

GitHub Issues Telegram Group

快速开始

系统要求

原系统可以是表格中的任意系统

目标系统的配置要求如下:

| 系统 | 版本 | 内存 | 硬盘 | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------- | ------------ | | Alpine | 3.21, 3.22, 3.23, 3.24 | 256 MB | 1 GB | | Debian | 9 ELTS - 11 ELTS, 12, 13 | 256 MB | 1 ~ 1.5 GB ^ | | Kali | Last-Snapshot, Rolling (滚动) | 256 MB | 1 ~ 1.5 GB ^ | | Ubuntu | 18.04 LTS - 26.04 LTS | 512 MB \* | 2 GB | | Anolis | 7, 8, 23 | 512 MB \* | 5 GB | | RHEL   AlmaLinux   Rocky   Oracle | 8, 9, 10 | 512 MB \* | 5 GB | | OpenCloudOS | 8, 9, Stream 23 | 512 MB \* | 5 GB | | CentOS Stream | 9, 10 | 512 MB \* | 5 GB | | Fedora | 43, 44 | 512 MB \* | 5 GB | | openEuler | 20.03 LTS - 24.03 LTS, 26.09 | 512 MB \* | 5 GB | | openSUSE | Leap 16.0, Tumbleweed (滚动) | 512 MB \* | 5 GB | | NixOS | 26.05 | 512 MB | 5 GB | | Arch Linux / Arch Linux ARM | 滚动 | 512 MB | 5 GB | | Gentoo | 滚动 | 512 MB | 5 GB | | 安同 OS | 滚动 | 512 MB | 5 GB | | 飞牛 fnOS   FygoOS | 1 | 512 MB | 10 GB | | Windows (DD) | 任何 | 512 MB | 取决于镜像 | | Windows (ISO) | Vista, 7, 8.x (Server 2008 - 2012 R2) | 512 MB | 25 GB | | Windows (ISO) | 10, 11 (Server 2016 - 2025) | 1 GB | 25 GB |

\* 表示使用云镜像安装,非传统网络安装

^ 表示需要 256 MB 内存 + 1.5 GB 硬盘,或 512 MB 内存 + 1 GB 硬盘

[!WARNING]
> 本脚本理论上支持独服和 PC
> 但如果能使用 IPMI 或 U 盘,则不建议使用本脚本
[!WARNING]
> ❌ 本脚本不支持 OpenVZ、LXC 虚拟机
> 请改用

下载(当前系统是 Linux)

国外服务器:

curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh || wget -O ${_##*/} $_

国内服务器:

curl -O https://cnb.cool/bin456789/reinstall/-/git/raw/main/reinstall.sh || wget -O ${_##*/} $_

下载(当前系统是 Windows)

[!IMPORTANT]
请先关闭 Windows Defender 的 实时保护 功能。该功能会阻止 certutil 下载任何文件。

解决 Windows 7 下无法下载脚本

由于不支持 TLS 1.2、SHA-256、根证书没有更新等原因,Vista,7 和 Server 2008 (R2) 可能无法自动下载脚本,因此需要手动下载,具体操作如下:

用 IE 下载 (先在 IE 高级设置里启用 TLS 1.2),或者通过远程桌面,将这两个文件保存到同一个目录

  • -
使用时运行下载的 reinstall.bat

国外服务器:

certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat

国内服务器:

certutil -urlcache -f -split https://cnb.cool/bin456789/reinstall/-/git/raw/main/reinstall.bat

使用

所有功能 都可在 Linux / Windows 下运行

功能 1: 安装 Linux

[!CAUTION]
> 此功能会清除当前系统整个硬盘的全部数据(包含其它分区)!
> 如果不小心运行了脚本,可以在重启前运行 bash reinstall.sh reset 取消重装
bash reinstall.sh anolis      7|8|23
                  rocky       8|9|10
                  oracle      8|9|10
                  almalinux   8|9|10
                  opencloudos 8|9|23
                  centos      9|10
                  fnos        1
                  fygoos      1
                  nixos       26.05
                  fedora      43|44
                  debian      9|10|11|12|13
                  opensuse    16.0|tumbleweed
                  alpine      3.21|3.22|3.23|3.24
                  kali        last-snapshot|rolling
                  openeuler   20.03|22.03|24.03|26.09
                  ubuntu      18.04|20.04|22.04|24.04|26.04 [--minimal]
                  arch
                  gentoo
                  aosc
                  redhat      --img="http://access.cdn.redhat.com/xxx.qcow2"

可选参数

[!TIP]
> 可通过多种方式(SSH、HTTP 80 端口、商家后台 VNC、串行控制台)查看安装进度。
> 即使安装过程出错,也能连接 SSH 手动救砖。
> 目标系统非 Debian/Kali 时,可以运行 /trans.sh alpine 自动救砖成 Alpine 系统。

已弃用的功能

云镜像安装 Debian

  • 适合于 CPU 较慢的机器
bash reinstall.sh debian --ci

ISO 安装 CentOS, AlmaLinux, Rocky, Fedora

  • 仅支持内存大于 2G 且为动态 IP 的机器
  • 用户名 root,密码 123@@@,SSH 端口 22,不支持用参数修改
bash reinstall.sh centos --installer
bash reinstall.sh almalinux --installer
bash reinstall.sh rocky --installer
bash reinstall.sh fedora --installer

ISO 安装 Ubuntu

  • 仅支持内存大于 1G 且为动态 IP 的机器
  • 用户名 root,密码 123@@@,SSH 端口 22,不支持用参数修改
bash reinstall.sh ubuntu --installer

功能 2: DD RAW 镜像到硬盘

[!CAUTION]
> 此功能会清除当前系统整个硬盘的全部数据(包含其它分区)!
> 如果不小心运行了脚本,可以在重启前运行 bash reinstall.sh reset 取消重装
bash reinstall.sh dd --img "https://example.com/xxx.xz"

可选参数

[!TIP]
> --cloud-data 参数为本地目录或 HTTP 基础 URL,目录须包含 user-data 文件,meta-data、network-config 可选:
>
> seed/
├── user-data # 必须
├── meta-data # 可选
└── network-config # 可选
>
> # 使用本地目录
bash reinstall.sh dd --img "https://example.com/xxx.xz" --cloud-data /path/to/seed/
# 使用 HTTP 目录
bash reinstall.sh dd --img "https://example.com/xxx.xz" --cloud-data "https://example.com/seed/"
[!TIP]
> 可通过多种方式(SSH、HTTP 80 端口、商家后台 VNC、串行控制台)查看安装进度。
> 即使安装过程出错,也能连接 SSH 手动救砖
> 也可以运行 /trans.sh alpine 自动救砖成 Alpine 系统。

功能 3: 重启到 Alpine Live OS(内存系统)

[!TIP]
> 虽然运行的脚本叫 reinstall,但是此功能不会删除任何数据和进行自动重装,而是要用户手动操作
> 如果用户手动操作没有破坏原系统,再次重启将回到原系统
bash reinstall.sh alpine --hold 1

可选参数

功能 4: 重启到 netboot.xyz

[!TIP]
> 虽然运行的脚本叫 reinstall,但是此功能不会删除任何数据和进行自动重装,而是要用户手动操作
> 如果用户手动操作没有破坏原系统,再次重启将回到原系统
bash reinstall.sh netboot.xyz
netboot.xyz

功能 5: 安装 Windows ISO

Windows 安装界面
[!CAUTION]
> 此功能会清除当前系统整个硬盘的全部数据(包含其它分区)!
> 如果不小心运行了脚本,可以在重启前运行 bash reinstall.sh reset 取消重装

支持的系统

方法 1: 让脚本自动查找 ISO

bash reinstall.sh windows \
     --image-name "Windows 11 Enterprise LTSC 2024" \
     --lang zh-cn
--image-name 列表

以下版本支持自动查找,其它版本请用方法 2 手动指定 ISO 链接安装

Windows Vista Starter
Windows Vista HomeBasic
Windows Vista HomePremium
Windows Vista Business
Windows Vista Ultimate
Windows Vista Enterprise

Windows 7 Starter Windows 7 HomeBasic Windows 7 HomePremium Windows 7 Professional Windows 7 Ultimate Windows 7 Enterprise

Windows 8 Windows 8 Pro Windows 8 Enterprise

Windows 8.1 Windows 8.1 Pro Windows 8.1 Enterprise

Windows 10 Home Windows 10 Home Single Language Windows 10 Pro Windows 10 Pro Education Windows 10 Pro for Workstations Windows 10 Education Windows 10 Enterprise Windows 10 Enterprise 2015 LTSB Windows 10 Enterprise 2016 LTSB Windows 10 Enterprise LTSC 2019 Windows 10 Enterprise LTSC 2021 Windows 10 IoT Enterprise Windows 10 IoT Enterprise 2015 LTSB Windows 10 IoT Enterprise 2016 LTSB Windows 10 IoT Enterprise LTSC 2019 Windows 10 IoT Enterprise LTSC 2021

Windows 11 Home Windows 11 Home Single Language Windows 11 Pro Windows 11 Pro Education Windows 11 Pro for Workstations Windows 11 Education Windows 11 Enterprise Windows 11 Enterprise LTSC 2024 Windows 11 IoT Enterprise Windows 11 IoT Enterprise LTSC 2024 Windows 11 IoT Enterprise Subscription Windows 11 IoT Enterprise Subscription LTSC 2024

Windows Longhorn ServerWeb Windows Longhorn ServerWebCore Windows Longhorn ServerStandard Windows Longhorn ServerStandardCore Windows Longhorn ServerEnterprise Windows Longhorn ServerEnterpriseCore Windows Longhorn ServerDatacenter Windows Longhorn ServerDatacenterCore

Windows Server 2008 R2 ServerWeb Windows Server 2008 R2 ServerWebCore Windows Server 2008 R2 ServerStandard Windows Server 2008 R2 ServerStandardCore Windows Server 2008 R2 ServerEnterprise Windows Server 2008 R2 ServerEnterpriseCore Windows Server 2008 R2 ServerDatacenter Windows Server 2008 R2 ServerDatacenterCore

Windows Server 2012 ServerStandard Windows Server 2012 ServerStandardCore Windows Server 2012 ServerDatacenter Windows Server 2012 ServerDatacenterCore

Windows Server 2012 R2 ServerStandard Windows Server 2012 R2 ServerStandardCore Windows Server 2012 R2 ServerDatacenter Windows Server 2012 R2 ServerDatacenterCore

Windows Server 2016 ServerStandard Windows Server 2016 ServerStandardCore Windows Server 2016 ServerDatacenter Windows Server 2016 ServerDatacenterCore

Windows Server 2019 ServerStandard Windows Server 2019 ServerStandardCore Windows Server 2019 ServerDatacenter Windows Server 2019 ServerDatacenterCore

Windows Server 2022 ServerStandard Windows Server 2022 ServerStandardCore Windows Server 2022 ServerDatacenter Windows Server 2022 ServerDatacenterCore

Windows Server 2025 ServerStandard Windows Server 2025 ServerStandardCore Windows Server 2025 ServerDatacenter Windows Server 2025 ServerDatacenterCore

--lang 列表

支持这三种语言代码格式,不区分大小写

| CC 格式 | CC-CC 格式 | 语言 | | - | - | - | | ar | ar-sa | Arabic | | bg | bg-bg | Bulgarian | | cs | cs-cz | Czech | | da | da-dk | Danish | | de | de-de | German | | el | el-gr | Greek | | gb | en-gb | Eng_Intl | | en | en-us | English | | es | es-es | Spanish | | mx | es-mx | Spanish_Latam | | et | et-ee | Estonian | | fi | fi-fi | Finnish | | | fr-ca | FrenchCanadian | | fr | fr-fr | French | | he | he-il | Hebrew | | hr | hr-hr | Croatian | | hu | hu-hu | Hungarian | | it | it-it | Italian | | ja | ja-jp | Japanese | | ko | ko-kr | Korean | | lt | lt-lt | Lithuanian | | lv | lv-lv | Latvian | | no | nb-no | Norwegian | | nl | nl-nl | Dutch | | pl | pl-pl | Polish | | pp | pt-pt | Portuguese | | pt | pt-br | Brazilian | | ro | ro-ro | Romanian | | ru | ru-ru | Russian | | sk | sk-sk | Slovak | | sl | sl-si | Slovenian | | sr | sr-latn / sr-latn-rs | Serbian_Latin | | sv | sv-se | Swedish | | th | th-th | Thai | | tr | tr-tr | Turkish | | uk | uk-ua | Ukrainian | | cn | zh-cn | ChnSimp | | tw | zh-tw | ChnTrad | | hk | zh-hk | ChnTrad_Hong_Kong |

方法 2: 自行指定 ISO 连接

bash reinstall.sh windows \
     --image-name "Windows 11 Enterprise LTSC 2024 Evaluation" \
     --iso "https://go.microsoft.com/fwlink/?linkid=2289029"

或者磁力链接

bash reinstall.sh windows \
     --image-name "Windows 11 Enterprise LTSC 2024" \
     --iso "magnet:?xt=urn:btih:7352bd2db48c3381dffa783763dc75aa4a6f1cff"

以下网站可找到 ISO 链接
  • 正式版
  • (推荐,ISO 是最新版)
  • (推荐,ISO 是最新版)

GitHub Stars & Activity

13,550Stars
2,194Forks
45Open issues
ShellLanguage

GitHub Popularity

GitHub stars13,550
Forks2,194
Open issues45
Primary languageShell
LicenseGPL-3.0
Stars gained today105
Created2022-09-25
Last pushed2026-10-04

Trending History

Daily boardrank #47 · ▲ 105 stars

Related GitHub Projects

1

obra / superpowers

Shell★ 295,604⑂ 26,396▲ 404 stars
→
2

mattpocock / skills

Shell★ 276,956⑂ 23,203▲ 979 stars
→
3

ohmyzsh / ohmyzsh

Shell★ 190,166⑂ 28,495▲ 79 stars
→
4

msitarzewski / agency-agents

Shell★ 157,146⑂ 25,358▲ 595 stars
→
5

1N3 / Sn1per

Shell★ 11,368⑂ 2,207▲ 34 stars
→
6

affaan-m / ECC

JavaScript★ 273,517⑂ 40,814▲ 761 stars
→
7

ossu / computer-science

HTML★ 209,872⑂ 25,957▲ 115 stars
→
8

ollama / ollama

Go★ 182,251⑂ 18,104▲ 82 stars
→

More Trending Repositories