纯属瞎玩,可能有风险
1.安装工具
sudo apt install pacman-package-manager arch-install-scripts archlinux-keyring
2.创建要chroot的文件夹
mkdir directory-to-bootstrap
3.挂载chroot文件夹到chroot
sudo mount --bind directory-to-bootstrap directory-to-bootstrap
lsblk可以查看挂载情况
4.配置pacman的镜像源软件库
sudo vim /etc/pacman.conf
往里面加入,也可以是arch默认的pacman.conf配置文件
[options]
HoldPkg = pacman glibc
Architecture = auto
CheckSpace
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
[core]
Include = /etc/pacman.d/mirrorlist
#[extra-testing]
#Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
再加入镜像源
sudo vim /etc/pacman.d/mirrorlist
加入
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
5.安装arch到directory-to-bootstrap
先初始化GnuPG 密钥环
sudo pacman-key --init
再初始化 GnuPG 密钥环并导入密钥
sudo pacman-key --populate
最后安装arch
sudo pacstrap base directory-to-bootstrap
6.chroot到directory-to-bootstrap
sudo arch-chroot directory-to-bootstrap
标签:chroot,pacman,sudo,directory,debian12,arch,bootstrap
From: https://www.cnblogs.com/lookfeel/p/18076297