惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
腾讯CDC
J
Java Code Geeks
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
雷峰网
雷峰网
B
Blog RSS Feed
博客园_首页
量子位
F
Fortinet All Blogs
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog

kkocdko's blog

Tasker 永久试用修改思路 - kkocdko's blog 极限压缩文档扫描件 - kkocdko's blog Bypass the Blank Chars Detection crknob - Chrome portable patch 我如何将博客首页体积降至 3 KB - kkocdko's blog 如何极限优化压缩文件体积 - kkocdko's blog EmEditor 精简版 - kkocdko's blog Backup Data from VSCode Web 优雅地游玩 Minecraft - kkocdko's blog 让程序以管理员权限运行的 PE 清单 - kkocdko's blog 注销 ZEIT 账号之后遇到的坑 - kkocdko's blog 本博客的协议已更改为 CC0 - kkocdko's blog mobp - 使 MSOffice 后台常驻 在安装 VS 生成工具时规避 .NET 安装错误 各种格式的占位空文件 - kkocdko's blog 优雅地游玩 Flash 游戏 - kkocdko's blog WPS 2016 极限精简版 - kkocdko's blog Convert Const to Let by Terser 规避 Visual Studio 许可证过期的 Bug 方便地使用 iPod - kkocdko's blog 用 UserJS 注入 UserCSS - kkocdko's blog 注册表修改文件关联(默认程序) - kkocdko's blog 周期精准的太阳系模型 - kkocdko's blog 关闭屏幕的 WinAPI - kkocdko's blog 重置 Windows 图标缓存 - kkocdko's blog AIDA64 极限精简单文件版 - kkocdko's blog 几何画板单文件精简版 - kkocdko's blog 世界之窗浏览器单文件版 - kkocdko's blog 在 MBR + Legacy 下用 Bootmgr 引导 Ubuntu 简洁的 Markdown 预览工具 - kkocdko's blog
Build Fedora ISO in 3 Commands
2026-04-11 · via kkocdko's blog

Why? In a word, you may be not satisfied by official build.

  • Many packages in the official build were outdated, even suffered by CVEs. Run dnf update in a newly installed environment will need to download a lot.

  • Remove rarely used packages to reduce iso size. Add packages, change theme, tweak some settings.

  • Enable more optimization to speed up livecd booting and install progress.

And there's a prebuilt custom fedora 37 x86_64 iso.

About this prebuilt ISO (Click to show)
  • Remove rarely used packages like gnome-weather to reduce size.

  • Use ZSTD compression instead of XZ.

  • Use adw-gtk3 theme to improve the style of gtk3 apps.

How

As the title, we only needs 3 commands:

# sudo setenforce 0 # if you get any errors like memory permission

# Clone repo
git clone --depth=1 https://github.com/kkocdko/utils4fedora

# Change dir
cd utils4fedora/mkimg

# chmod +x mkimg
./mkimg # needs docker and sudo inner

Then, see what's produced, ls -lh ./result/*. It takes 4 minutes on my machine with local mirror (make download time zero) and 15 minutes on GitHub Actions.

Using docker, easy to build and avoid most of troubles caused by environment.

Details

Like other distros, Fedora Linux is built on top of many prebuilt packages. You can still mount a raw img file and copy files into it manually, but Fedora usually uses lorax to build the image.

Lorax builds image / tarball from kickstart file, and Fedora's offical build (including spins) uses the kickstart files in https://pagure.io/fedora-kickstarts .

In this project (my utils4fedora), I include these in docker image. So now you only need to write a kickstart file.

# comments

%include fedora-live-workstation.ks # based on offical workstation edition

part / --size=8192 # set image root size
%packages # modify packages
-firefox # exclude a package
htop # include a package
%end # end this session

%post # run in the image's chroot
systemctl disable dnf-makecache
%end

If you want an origin workstation edition, remove all lines expect of %include fedora-live-workstation.ks. And kickstart file has a reference here.

After that, let's see the command line switches:

# we only want iso file
--make-iso --iso-only
# use zstd compression and tweak args, result in smaller size and faster decompression
--compression zstd --compress-arg=-b --compress-arg=1M --compress-arg=-Xcompression-level --compress-arg=22

Every time building the image will take about 1.7 GiB of data traffic, so running a local mirror may be a good idea if you want to build multi times. I recommend a HTTP proxy caching instead of a traditional mirror which used huge disk space. Try squid or my server program. See how fast it is:

2023-01-10 07:33:55,507: Starting package installation process
2023-01-10 07:33:56,507: Downloading packages
2023-01-10 07:33:58,508: Downloading 1132 RPMs, 52.95 MiB / 1001.38 MiB (5%) done.
2023-01-10 07:34:00,509: Downloading 1132 RPMs, 959.15 MiB / 1001.38 MiB (95%) done.
2023-01-10 07:34:01,511: Preparing transaction from installation source

Troubles

If you search "build fedora install iso" with Google, the first result is this one in Fedora wiki, but it's outdated now (20230110). As a result, I wasted a lot of time.

Then I found the osbuild, a "modern" way, but has many limitations. It may be suitable for some company's IT managers.

Finally, I found the right path. Ultramarine-Linux/build-scripts, a distro based on Fedora. Their repo shows the right way to build a custom Fedora image.

To be continue...