安装基础软件包
1 | apt install devscripts equivs |
开启deb-src选项
比如需要再focal上编译jammy的源码,可以假如jammy的源码选项1
2
3
4
5$ cat /etc/apt/sources.list.d/jammy-source.list ─╯
deb-src https://mirrors.cloud.tencent.com/ubuntu/ jammy universe main restricted multiverse #Added by software-properties
deb-src https://mirrors.cloud.tencent.com/ubuntu/ jammy-updates universe main restricted multiverse #Added by software-properties
deb-src https://mirrors.cloud.tencent.com/ubuntu/ jammy-backports main restricted universe multiverse #Added by software-properties
deb-src https://mirrors.cloud.tencent.com/ubuntu/ jammy-security universe main restricted multiverse #Added by software-properties
获取源码安装编译依赖
假设需要编译vim1
2
3
4
5apt showsrc vim
apt source vim
apt build-dep vim
# or
mk-build-deps debian/control --install --remove
编译相关包
1 | fakeroot debian/rules binary |