一键脚本|Debian|Ubuntu 网络安装|重装系统|纯净安装

cera cera

本脚本在 SolusVM KVM VPS 和 阿里巴巴云主机 上测试无问题,系统为 Debian 8/9 & Ubuntu 16.04/18.04

简介

 

准备工作

  • 一个KVM虚拟化的 VPS,需要有 GRUB2 和 VNC。
  • 检查 /etc/default/grub ,确保没有 GRUB_HIDDEN_TIMEOUT_QUIET 和 GRUB_HIDDEN_TIMEOUT如果有请删除。
  • 确保 GRUB_DEFAULT 超时参数,如果不懂,配置为 GRUB_DEFAULT=999 即可,大概是16分钟的意思。
  • 安装依赖:
sudo apt update && sudo apt -y install ca-certificates cpio wget whois

运行脚本

  • 注意将下面的 <OPTIONS> 替换为你的选择
sudo sh -c "$(wget -O - https://github.com/brentybh/debian-netboot/raw/master/netboot.sh)" -- <OPTIONS>

注意:使用sudo需要输入你当前用户的密码,然后输入新用户的密码

参数介绍

-c US Debian 安装国家
-fqdn localhost.localdomain FQDN 包含hostname和域名
-proto https 传输协议,可以选择 http、https、ftp等
-host dpvctowv9b08b.cloudfront.net 镜像源
-dir /debian 镜像源的路径
-suite stretch Suite (stable, testing, stretch, etc.)
-u ubuntu 拥有sudo权限的用户名
-p secret 上述用户名的密码
-tz UTC 时区
-ntp time.google.com NTP服务器
-upgrade full-upgrade 是否升级(none, safe-upgrade, full-upgrade)
-s https://dpvctowv9b08b.cloudfront.net/debian-security 自定义安全镜像源
-ip 1.2.3.4 自定义IPv4地址
-cidr 255.255.255.0 自定义网络掩码
-gw 1.2.3.1 自定义网关
-ns "1.1.1.1 156.154.70.5 8.8.8.8" 自定义DNS
-add "ca-certificates curl openssl" 增加额外要安装的包

中国特殊参数

安装

  • 保持你的SSH连接,同时打开 VNC
  • 在SSH内输入 sudo reboot 你的虚拟机 重启
  • 快速 切换到你的 VNC 窗口,输入 GRUB 选择菜单
  • 通过键盘 选择 New Install 并 点击回车。 同时,请迅速,千万不要超过你配置的 GRUB_DEFAULT 超时时间!
  • 最后,你会看到机器安装完成 Debian,自动配置完后,重启后完成。

cera cloudiplc tengxunyun

相关推荐

mjjping.com cera cera cloudiplc