[Share Experiences] 在deepin25环境中创建无磐石的deepin25子系统
Tofloor
poster avatar
MeGusta
deepin
2025-06-05 23:17
Author

最近在deepin25上测试编译一些应用,有磐石系统总是不方便,而且编译要安装大量的工具,测试的时候也容易搞坏系统。在github高强度冲浪的时候,发现官方有发布deepin25的docker镜像,正好放到distrobox里面去。项目地址在:deepin-rootfs

image.png

使用以下这个脚本,你将得到一个容器名和主机名为 beige的套娃子系统,预装了玲珑环境,支持 amd64arm64架构,直接 distrobox enter beige就可以开始使用。

这样就可以随便乱造,不用担心搞坏主机系统了。

注意,脚本要和镜像文件放在同一个目录下deploy-subsystem.zip

image.png

#!/bin/bash
# deploy-subsystem.sh

set -e

# 检查 distrobox 是否已安装
if ! command -v distrobox &> /dev/null; then
    echo "错误: 未检测到 distrobox,请安装后再运行此脚本。"
    exit 1
fi

CONTAINER_NAME="beige"
CUSTOM_TAG="deepin:beige"

# 获取脚本所在的目录
SCRIPT_DIR=$(dirname "$(realpath "$0")")

# 判断系统架构
arch=$(uname -m)
case "$arch" in
    x86_64)
        OSARCH="amd64"
        ;;
    aarch64)
        OSARCH="arm64"
        ;;
    *)
        echo "不支持的系统构架:$arch,仅支持 amd64 或 arm64"
        exit 1
        ;;
esac

echo "当前系统构架为:$OSARCH"

TARBALL="$SCRIPT_DIR/deepin-docker-rootfs-${OSARCH}.tar.gz"

# 导入 rootfs 到 podman 镜像
echo "导入 rootfs 到镜像..."
podman import "$TARBALL" "$CUSTOM_TAG"

# 创建 Distrobox 容器
echo "创建 Distrobox 容器..."
distrobox create \
  --name "$CONTAINER_NAME" \
  --image "$CUSTOM_TAG" \
  --volume /persistent:/persistent \
  --hostname "$CONTAINER_NAME" \

# 初始化容器(第一次进入会自动设置环境)
echo "初始化容器..."
distrobox enter "$CONTAINER_NAME" -- bash -c "exit"

# 安装玲珑环境
echo "安装 linglong环境..."
distrobox enter "$CONTAINER_NAME" -- bash -c "
  sudo apt update && \
  sudo apt install -y apt-file fuse-overlayfs linglong-bin linglong-box linglong-builder
"

echo "✅ 操作完成"
echo "   distrobox enter $CONTAINER_NAME"

Reply Favorite View the author
All Replies
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2025-06-05 23:49
#1

直接用里面的debian和ubuntu子系统不行么?

Reply View the author
MeGusta
deepin
2025-06-05 23:53
#2

我是要把一个依赖非常多的软件在deepin25的包环境下编译。

Reply View the author
jjcui8595
deepin
Resources Team Moderator
2025-06-06 06:09
#3

like

Reply View the author
神末shenmo
deepin
Spark-App
Solutions Team Moderator
2025-06-06 12:00
#4
MeGusta

我是要把一个依赖非常多的软件在deepin25的包环境下编译。

有兴趣的话可以试试打一个 ACE deepin25?

https://gitee.com/amber-ce/ace-common#%E8%87%AA%E5%AE%9A%E4%B9%89rootfs%E7%9A%84ace%E5%85%BC%E5%AE%B9%E7%8E%AF%E5%A2%83

Reply View the author
zccrs
deepin
2025-06-06 13:02
#5

无限套娃?

Reply View the author
MeGusta
deepin
2025-06-06 14:28
#6
神末shenmo

有兴趣的话可以试试打一个 ACE deepin25?

https://gitee.com/amber-ce/ace-common#%E8%87%AA%E5%AE%9A%E4%B9%89rootfs%E7%9A%84ace%E5%85%BC%E5%AE%B9%E7%8E%AF%E5%A2%83

前天倒是用 ace-common 在 UOSV20上试了一下,beige-run倒是可以进去,但是系统自带的 supkexec就出问题了,没有进一步研究。后来是用 docker-ce跑的,编译东西是足够了。

Reply View the author
MeGusta
deepin
2025-06-06 14:28
#7
zccrs

无限套娃?

套了一次,做测试用,这样不会污染主机系统。

Reply View the author
神末shenmo
deepin
Spark-App
Solutions Team Moderator
2025-06-06 20:05
#8
MeGusta

前天倒是用 ace-common 在 UOSV20上试了一下,beige-run倒是可以进去,但是系统自带的 supkexec就出问题了,没有进一步研究。后来是用 docker-ce跑的,编译东西是足够了。

还留有报错的话,可以反馈一下,我去修

感谢测试

Reply View the author
MeGusta
deepin
2025-06-06 20:21
#9
神末shenmo

还留有报错的话,可以反馈一下,我去修

感谢测试

好的,我得空了再试一下,有问题我就去开issue

Reply View the author
Cosmos
deepin
2025-06-09 13:02
#10

[like].gif

Reply View the author
Flyingpie
deepin
2025-06-11 19:54
#11

like

Reply View the author