// 先设置成英文环境
[root@master rootfs]# export LC_ALL=C
[root@master rootfs]# mkdir rootfs
[root@master rootfs]# dnf --releasever 8 --disablerepo=* --enablerepo=baseos --installroot="$(pwd)/rootfs" groups install 'Minimal Install' 2>&1| tee dnf-rootfs.log Repository epel is listed more than once in the configuration
warning: Generating 18 missing index(es), please wait...
Loongnix server 8 - BaseOS 186 B/s | 169 B 00:00
Errors during downloading metadata for repository 'baseos':
- Status code: 404 for http://pkg.loongnix.cn/loongnix-server/8/BaseOS/loongarch64/release/repodata/repomd.xml (IP: 114.242.206.182)
Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
从错误信息可知是下载repomd.xml 文件失败,打这个网址确实出错,原因是LoongArch 没有8.0 的版本有8.3和8.4版本,所以将版本号改为 8.3
[root@master rootfs]# dnf --releasever 8.3 --disablerepo=* --enablerepo=baseos --installroot="$(pwd)/rootfs" groups install 'Minimal Install' 2>&1| tee dnf-rootfs.log
Repository epel is listed more than once in the configuration
Loongnix server 8.3 - BaseOS 1.1 MB/s | 6.6 MB 00:05
Last metadata expiration check: 0:00:03 ago on Thu Jun 2 11:28:53 2022.
no group 'guest-agents' from environment 'minimal-environment'
No match for group package "microcode_ctl"
No match for group package "kernel-tools"
No match for group package "prefixdevname"
No match for group package "biosdevname"
Dependencies resolved.
============================================================================================
Package Architecture Version Repo Size
============================================================================================
Installing group/module packages:
NetworkManager loongarch64 1:1.26.0-12.lns8 baseos 1.8 M
NetworkManager-team loongarch64 1:1.26.0-12.lns8 baseos 135 k
NetworkManager-tui loongarch64 1:1.26.0-12.lns8 baseos 275 k
audit loongarch64 3.0-0.17.20191104git1c2f876.1.lns8 baseos 225 k
authselect loongarch64 1.2.1-3.lns8 baseos 137 k
basesystem noarch 11-5.lns8 baseos 5.9 k
bash loongarch64 4.4.19-12.lns8 baseos 1.5 M
coreutils loongarch64 8.30-8.lns8 baseos 804 k
cronie loongarch64 1.5.2-4.lns8 baseos 112 k
curl loongarch64 7.61.1-15.1.lns8 baseos 300 k
dnf noarch 4.2.23-5.lns8 baseos 512 k
dnf-plugins-core noarch 4.0.17-5.lns8 baseos 65 k
。。。。
yum-4.2.23-5.lns8.noarch
zlib-1.2.11-16.3.lns8.loongarch64
Complete!
安装完成
[root@master rootfs]# ls
dnf-rootfs.log rootfs
[root@master rootfs]# du -sh rootfs
1.3G rootfs
[root@master rootfs]# chroot rootfs/
[root@master /]# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
[root@master /]# exit
exit
[root@master rootfs]#
dnf-rootfs.log 记录了所有包的下载,安装,校验的过程
制作完的系统通过chroot可以正常使用,就是体积点大,可以通过减少一些包来进行空间的压缩。
参考
- https://gist.github.com/imcsk8/78efd778b36bc6f3a29a872655643c79#:~:text=EOF%20%24%20mkdir%20rootfs%20%24%20sudo%20dnf%20–releasever,%28pwd%29%2Frootfs%22%20groups%20install%20%27Minimal%20Install%27%202%3E%261%7C%20tee%20dnf-rootfs.log
- http://www.loongnix.cn/zh/loongnix/
- http://pkg.loongnix.cn/loongnix-server/