vps2arch: VPS一键网络重装系统为 ArchLinux
简介
- Github地址
- 一个神奇的脚本,终于可以在“任意” KVM VPS 上面安装 ArchLinux 辣!
对,就是类似Vicer和建军大佬之前的一键网络重装,似乎还支持OpenVZ(这个很6.。。)
一键脚本: Debian(Ubuntu)网络安装/重装
一键脚本: CentOS 6.9 网络安装/重装
警告
- 请自行承担脚本执行的后果,运行前务必有这个觉悟!!!
- 会清除VPS的全部信息!!!
一键脚本
wget http://git.io/vps2arch
&& chmod +x vps2arch
&& ./vps2arch
附录
- 一份原作者的测试清单,DO宝宝是都支持的啦~
- 原作者的PP打赏地址
以下为原文的Read.me
VPS2Arch
The fastest way to convert a VPS to Arch Linux!
Author
Description
This script is used to convert a VPS, running another linux distro, to Arch Linux.
It should be only used if your VPS provider doesn’t provide you an Arch Linux image.
Disclaimer
I’m not responsible for any damage in your system and/or any violation of the agreement between you and your vps provider.
Use at your own risk!
How To
Download the script on your VPS and execute it with root privileges
WARNING The script will delete any data in your VPS!
wget http://git.io/vps2arch
chmod +x vps2arch
./vps2arch
Some Debian VPS images don’t have the CA certificates installed, so wget
will give you the following errors:
ERROR: The certificate of `raw.githubusercontent.com' is not trusted.
ERROR: The certificate of `raw.githubusercontent.com' hasn't got a known issuer.
To fix them just execute apt-get install ca-certificates
and then re-execute the previous commands.
How does it work?
It’s Black Magic.
Just kiddin’ ????, the script itself is very simple.
In a nutshell, it will download the Arch Linux Bootstrap Image and (see the wiki),
extract the image to / and configure the Bootstrap chroot.
Now, about the critical part:
How can you wipe the system without breaking everything?
It’s simple: using ld.so
from the Bootstrap chroot to launch the chroot
tool.
Since it will erase all the system directories except from the Bootstrap chroot, /dev
, /proc
, /sys
and the like,
the only way to launch a command inside the Bootstrap chroot is to using ld.so from the Bootstrap chroot itself.
At this point Arch Linux has been installed, but not configured.
The script will provide a SSH-able system automagically configuring grub (or syslinux), network and restoring the root password from the original system (or by using vps2arch
as password if no root password was set).
Once done doing its job, the script will ask you to manually reboot your VPS and voilà, PROFIT!
Does it really work?
Yes, it does!
On the Tested VPS Providers wiki page you can find a list of Tested VPS Providers.
Theoretically it should also work on real computers (running linux), but I think it’s not worth it,
because you can install it in the canonical way.
Contributing
If you have any useful modification, please use Pull requests.
If you have successfully used this script on a different distro – VPS combination, please contact me so that I can update the above list.
If you are not a developer, but you still want to contribute, you can donate me an account on your VPS provider and I’ll do my best to support it.
Or you can just donate me some bucks I’ll spend to buy a VPS on your provider in order to support it.
Caveats
IPv6 currently is not supported. If you need to use it, please configure it manually.