之前用的萌咖脚本在Oracle Cloud 一键脚本重装系统,自2019年11月份后,萌咖的脚本貌似无法成功安装Ubuntu了,但像本博主对Ubuntu有特殊偏好的人可能就很蛋疼了,Google了整个网络,最终还是找到了可用的一键脚本,分享出来,供有需要的人使用,也为自己留个底儿。
wget --no-check-certificate -O AutoReinstall.sh https://git.io/AutoReinstall.sh && bash AutoReinstall.sh
我之前的系统是Oracle自带的Ubuntu,运行以上命令会有错误,错误的类型是无法找到以下路径
/etc/network/interfaces.d
通过以下两条命令可以解决此错误
mkdir /etc/network/interfaces.d
echo "# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens3
iface ens3 inet dhcp
" > /etc/network/interfaces
至此再运行安装脚本可完成系统重装
附注:对于Oracle自带的ubuntu,如果要开放端口,需要对防火墙进行设置,一劳永逸解决输入以下代码:
apt-get purge netfilter-persistent