安装依赖

1
sudo apt-get install -y xz-utils openssl gawk file

下载一键脚本

1
2
3
wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh' && chmod a+x InstallNET.sh

sed -i "" "s/http:\/\/archive.ubuntu.com/https:\/\/mirrors.tencentyun.com/g" InstallNET.sh

使用

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Usage:
bash InstallNET.sh -d/--debian [dist-name]
-u/--ubuntu [dist-name]
-c/--centos [dist-version]
-v/--ver [32/i386|64/amd64]
--ip-addr/--ip-gate/--ip-mask
-apt/-yum/--mirror
-dd/--image
-a/-m

# dist-name:发行版本代号
# dist-version:发行版本号
# -apt/-yum/--mirror:使用定义镜像
# -a/-m:询问是否能进入VNC自行操作。-a 为不提示(一般用于全自动安装),-m 为提示。

示例

1
2
#使用默认镜像全自动安装 ubuntu 18.04 x64
bash InstallNET.sh -u 18.04 -v 64 -a --mirror 'https://mirrors.tencentyun.com/ubuntu/'

可以在腾讯云后台vnc查看,因为中间可能需要一些手动操作

安装后默认用户: root

密码: MoeClub.org

Ubuntu 腾讯源

1
2
3
4
5
6
7
8
9
10
11
12
echo '''
deb http://mirrors.tencentyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.tencentyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.tencentyun.com/ubuntu/ bionic-updates main restricted universe multiverse
#deb http://mirrors.tencentyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
#deb http://mirrors.tencentyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.tencentyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.tencentyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.tencentyun.com/ubuntu/ bionic-updates main restricted universe multiverse
#deb-src http://mirrors.tencentyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
#deb-src http://mirrors.tencentyun.com/ubuntu/ bionic-backports main restricted universe multiverse
''' > /etc/apt/sources.list