配置ppa
- 登录launchpad.net网站后注册
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Bmcnf5mM-1693303850078)(http://43.138.79.14/static/img/eb6f2c5a3bd246f770bc90686f909bbb.image.png)]
- 安装依赖包
sudo apt install openssh-client gnupg
- 点击右上角,进入个人用户页面
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7PRTkewP-1693303850080)(http://43.138.79.14/static/img/ca9e4a242c7c950efc302beba3af0b2d.image.png)]
- 创建gpg
gpg --full-generate-key
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vQ8UCZoG-1693303850080)(http://43.138.79.14/static/img/ad29d7711e0d13321818ad38158b44c1.image.png)]
然后输入密码,用于加密时候使用。
- 导入gpg
# 查看gpg
gpg --list-keys
gpg --keyserver keyserver.ubuntu.com --send-key F229E3ACA0161D2DB9F077B82864BBF71A883753
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-oBLQUgGK-1693303850081)(http://43.138.79.14/static/img/ea34832aea5a1057bd98a012e60fdef3.image.png)]
- 输入指纹信息并导入
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-TbzmgFF0-1693303850081)(http://43.138.79.14/static/img/f944636ec8eeccc3dc1913d8a824e37f.image.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-i3zc3iHr-1693303850082)(http://43.138.79.14/static/img/d656c1043316f9053d86ceca25f6a7c0.image.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-EIxgC36l-1693303850082)(http://43.138.79.14/static/img/b149ba75e661c4434d9293eecf886948.image.png)]
- 然后查看邮件,会收到一封launchpad发来的gpg加密的邮件,将邮件中的这段内容存储在a.txt中:
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
hQEMAxTNJtYjyKZcAQgAoHkVeh+BTru2WZ1ZnNJokUhuOVdSkms15DmsDHjWGtFd
MIXczi6s7WHqx5PsbkqhQiiB53DuJeivuqShd8s8wi96i80LvyP5MyGQTvf9vioG
E8PKkZUzwMAGLjsjc+QbmBJYZKoFQGTwqrfwaps3/6Wz1D7MkRCUOvFcIQc1rugk
B5WxZ/c0YnAbZWnABL8j2o1DHCKwz+tn7nvjah5aYaynpin8WhnOIsE6Cp4J2KBs
U69qmcsZFrkhQEAd6sKqxzUm3TDgWd/9QpCUAPfogfRYi3J/VY1+XlmOB+2kuQjv
YhkGcBAhtJIi9mUlzk/ssvzho+tJZLYBBoiGcmN08tLAsQFaId27Z1vag85jU5kI
ZSd3f90YhoZGCo16sB5tx7sXfdLNg2P3X1nbYV4WqzWUGg/EpkMmzece7Gmlg9J4
xeHXyEDPO0FjZtaNicleA60VFoIyWCdPtXcDZKzEiYCMEksoJ6beT14FGu2qtYnA
tOqFp05J1GorEVDXlE3U76u+qCZGFU26Tgw/r/+lxSkQs344seKE5kKdRPrSEzhW
zMPMP72mz57ejRBv7yMHY/RQ5Sx73N+lVhDukjqvgpSbtY8DXI7O3V5VGS2Jkr9W
8ZFCBz57fwtuWdM+36lqAE2HF7yizZZz6/ZU2eK8x9sP1FyJP6B88O7uxGMa8wD/
jXCGB25b429jv8B3IWaIxmMwj3zneBLtZeeiLWm4I73YIvj+Wqy0vFA8UrETUzj9
OAynrYK/M78Mzhry3kFV7qEKlgcvnlUklYmvhKqxOhGezLBa8UMTrMwXNy3AcRfl
AH5AZ24F92uek/vGa617H1H7kw==
=kWLg
-----END PGP MESSAGE-----
- 解密后会得到一份链接,打开链接即可激活:
gpg -d a.txt
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nhXmXNPu-1693303850082)(http://43.138.79.14/static/img/fb75c80289af9a9cd818dc0ff97e8269.image.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vN2XKFt4-1693303850083)(http://43.138.79.14/static/img/e01269189d14f50ed3a32c217733c4db.image.png)]
- 生成ssh:
ssh-keygen
一直回车
cat ~/.ssh/id_rsa.pub
- 然后将ssh信息添加到ppa中:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-PyHPfh6A-1693303850083)(http://43.138.79.14/static/img/deb6a25045d212ffa2769fadb04e5849.image.png)]
- 创建一个ppa
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-M24BQKlQ-1693303850084)(http://43.138.79.14/static/img/89f4c88f9a2c1ab4c9b4a2da6376e40f.image.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-fPdZShZr-1693303850084)(http://43.138.79.14/static/img/cb8cf83321872037c3bbf58898df1f8a.image.png)]
- 记住ppa地址:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-I4UTx6kw-1693303850085)(http://43.138.79.14/static/img/4494754dd8e97c813ee2b1d4cc0b55e5.image.png)]
配置本地环境
- 基本配置
安装依赖:
sudo apt install dh-make debmake devscripts build-essential dput libgtk-3-dev mingw-w64 g++-mingw-w64
配置默认账户:
vim ~/.bashrc
DEBEMAIL="chendeqiang1024@qq.com"
DEBFULLNAME="Deqiang Chen"
export DEBEMAIL DEBFULLNAME
配置默认签名:
gpg --list-key
echo 'DEBSIGN_KEYID="4123F4902206125389BC83BCE33AB0A1D4282B6E"' >> ~/.devscript
- 创建一个二级目录
mkdir -p ~/test/hello-1.0
cd ~/test/hello-1.0
- 创建源码文件
vim hello.c
#include <stdio.h>
int main(void)
{
printf("%s\n","Hello");
return 0;
}
vim Makefile
hello:hello.o
gcc -o hello hello.o
hello.o:hello.c
gcc -o hello.o -c hello.c
.PHONY:rebuild clean
rebuild:clean hello
clean:
rm -f hello hello.o
- 生成debian目录
dh_make --createorig
- 配置debian目录
# 配置可执行文件安装目录
vim debian/install
hello /bin
dch
#配置changelog,jammy处填写系统版本代号
hello (1.0-1) jammy; urgency=medium
* Initial release (Closes: #nnnn) <nnnn is the bug number of your ITP>
*
-- Deqiang Chen <chendeqiang1024@qq.com> Sat, 19 Nov 2022 13:25:10 +0000
vim /debian/control
Source: hello
Section: misc #修改这里,misc代表杂项
Priority: optional
Maintainer: Deqiang Chen <chendeqiang1024@qq.com>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.6.0
Homepage: <insert the upstream URL, if relevant>
#Vcs-Browser: https://salsa.debian.org/debian/hello
#Vcs-Git: https://salsa.debian.org/debian/hello.git
Rules-Requires-Root: no
Package: hello
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
- 构建软件包
生成source.changes文件
debuild -S -sa -Inothing
- 上传到launchpad
dput ppa:chendeqiang1024/test ../hello_1.0-1_source.changes
在线编译
- 查看编译状态
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wPXgUsBm-1693303850085)(http://43.138.79.14/static/img/6b3f79289500facea3358265751bc3cd.image.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-eRVtwbPu-1693303850085)(http://43.138.79.14/static/img/a9fcde2fbbad029ed4d700ea91227b2a.image.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1jaYPJdS-1693303850086)(http://43.138.79.14/static/img/3609f241c5a3586cabbfa38892b4a219.image.png)]
- 添加仓库源
返回ppa:https://launchpad.net/~chendeqiang1024/+archive/ubuntu/test
查看源:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vJ5eCbYd-1693303850086)(http://43.138.79.14/static/img/66790597e3e614f7facd246adee8c267.image.png)]
常见错误
问题描述:
D: Splitting host argument out of ppa:chendeqiang1024/test.
D: Setting host argument.
Package has already been uploaded to ppa on ppa.launchpad.net
Nothing more to do for ../hello_1.0-1_source.changes
解决方案:
rm *source.ppa.upload