Vps2arch:修订间差异

来自MalacoKnowledge
imported>Malacology
(delete some useless)
imported>Malacology
(change structures)
 
第1行: 第1行:
[https://gitlab.com/drizzt/vps2arch vps2arch]是一个可以将CentOS、Debian等Linux发行版转换为ArchLinux,可以帮助用户快速将服务器转换为Arch,解决一些云服务器提供商不提供Arch的问题。目前推荐使用 ArchLinux TU 维护的 [https://github.com/felixonmars/vps2arch vps2arch fork]
[https://gitlab.com/drizzt/vps2arch vps2arch]是一个可以将CentOS、Debian等Linux发行版转换为ArchLinux,可以帮助用户快速将服务器转换为Arch,解决一些云服务器提供商不提供Arch的问题。目前推荐使用 ArchLinux TU 维护的 [https://github.com/felixonmars/vps2arch vps2arch fork]
==更新==
==安装==
<pre># wget https://felixc.at/vps2arch &amp;&amp; chmod +x vps2arch &amp;&amp; ./vps2arch -mhttps://mirrors.neusoft.edu.cn/archlinux/
<pre># wget https://felixc.at/vps2arch &amp;&amp; chmod +x vps2arch &amp;&amp; ./vps2arch -mhttps://mirrors.neusoft.edu.cn/archlinux/
# 可将 -m 后换成相应镜像,如 https://mirrors.ustc.edu.cn/archlinux/ , 但是m必须与镜像相连</pre>
# 可将 -m 后换成相应镜像,如 https://mirrors.ustc.edu.cn/archlinux/ , 但是m必须与镜像相连</pre>
===更换内核===
==更换内核==
<pre># pacman -S linux-lts linux-lts-headers
<pre># pacman -S linux-lts linux-lts-headers
# pacman -Rsdd linux  
# pacman -Rsdd linux  
# grub-mkconfig -o /boot/grub/grub.cfg</pre>
# grub-mkconfig -o /boot/grub/grub.cfg</pre>
===自动登录===
==自动登录==
<pre>su local_usr    # 本地linux
<pre>su local_usr    # 本地linux
ssh-keygen -t ed25519 -f ~/.ssh/vps
ssh-keygen -t ed25519 -f ~/.ssh/vps
第15行: 第15行:
vim .ssh/authorized_keys
vim .ssh/authorized_keys
# 写入 vps.pub 内容</pre>
# 写入 vps.pub 内容</pre>
===配置===
==配置==
安装必要软件<pre># pacman -S sudo git vim</pre>设置密码<pre># passwd</pre>设置时间,替换 <code>Asia/Shanghai</code> 为你需要的<pre># ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
安装必要软件<pre># pacman -S sudo git vim</pre>设置密码<pre># passwd</pre>设置时间,替换 <code>Asia/Shanghai</code> 为你需要的<pre># ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc
hwclock --systohc

2022年5月25日 (三) 05:10的最新版本

vps2arch是一个可以将CentOS、Debian等Linux发行版转换为ArchLinux,可以帮助用户快速将服务器转换为Arch,解决一些云服务器提供商不提供Arch的问题。目前推荐使用 ArchLinux TU 维护的 vps2arch fork

安装

# wget https://felixc.at/vps2arch && chmod +x vps2arch && ./vps2arch -mhttps://mirrors.neusoft.edu.cn/archlinux/
# 可将 -m 后换成相应镜像,如 https://mirrors.ustc.edu.cn/archlinux/ , 但是m必须与镜像相连

更换内核

# pacman -S linux-lts linux-lts-headers
# pacman -Rsdd linux 
# grub-mkconfig -o /boot/grub/grub.cfg

自动登录

su local_usr    # 本地linux
ssh-keygen -t ed25519 -f ~/.ssh/vps
cat /home/local_usr/.ssh/vps.pub
# 登录
ssh root@DOMAIN/IP
vim .ssh/authorized_keys
# 写入 vps.pub 内容

配置

安装必要软件

# pacman -S sudo git vim

设置密码

# passwd

设置时间,替换 Asia/Shanghai 为你需要的

# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

hwclock --systohc

  1. 设置时区

本地化

# vim /etc/locale.gen

移除需要语言的前面的#

locale-gen
vim /etc/locale.conf

添加

LANG=en_GB.UTF-8

新用户 NEW_USER

# useradd -m -G wheel NEW_USER
  1. passwd NEW_USER
  2. export EDITOR=vim
  3. visudo

yay

yay 是非常方便的 AUR helper

# pacman -S base-devel
su NEW_USER
$ cd
$ git clone https://aur.archlinux.org/yay-bin.git
$ cd yay-bin
$ makepkg -si
$ cd ..
$ rm -rf yay-bin

安装完成后就可以轻松安装 AUR 包了

重启

重启前请确保已经上传 ssh public key 到~/.ssh/authorized_keys或者passwd设置好了密码

# sync ; reboot -f

github连接

 ssh-keygen -t rsa -C YOUR_EMAIL
 cd && cd .ssh
 cat id_rsa.pub

将公钥上传至GitHub的 SSH Key 位置