重新编译 deb
TIPS: 使用 src源 对应 os
1、添加 src 源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
apt-get clean all
apt update
2、安装编译环境
apt-get install dpkg-dev devscripts build-essential
3、编译
# 创建 文件夹
mkdir nginx
cd nginx
# 下载源码包
apt-get source nginx
# 修改 源码、编译参数
...
# 提交修改
dpkg-buildpackage commit
# 编译
dpkg-buildpackage -us -uc
# 清理
dpkg-buildpackage -rfakeroot -Tclean
评论