我以前在Ubuntu 14.04 LTS和16.04 LTS上建立了适当地存储库,没有什么问题,但是正如我最近在18.04 LTS上再次尝试时,出现了问题,并且无法使用我的存储库。我相信与18.04适当地存在一些不兼容。
请注意,混淆了存储库,服务器和目录的名称。
首先要注意的是-batch选项不再起作用,因为gpg现在似乎要求在18.04中使用代理程序。
$ aptly publish repo -passphrase '********' -batch myrepo-unstable public/ubuntu
gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
为了进行签名,我必须设置我的gpg.conf文件:
$ cat ~/.gnupg/gpg.conf
pinentry-mode loopback
然后,我可以发布我的仓库:
$ aptly publish repo -passphrase '********' myrepo-unstable public/ubuntu
Loading packages...
Generating metadata files and linking package files...
Finalizing metadata files...
Signing file 'Release' with gpg, please enter your passphrase when prompted:
gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
Local repo myrepo-unstable has been successfully published.
Please setup your webserver to serve directory '/mydir/.aptly/public' with autoindexing.
Now you can add following line to apt sources:
deb http://your-server/public/ubuntu/ bionic-unstable main
Don't forget to add your GPG key to apt with apt-key.
You can also use `aptly serve` to publish your repositories over HTTP quickly.
我将以下存储库添加到/etc/apt/sources.list:
deb [arch=amd64 trusted=yes] http://your-server/public/ubuntu/ bionic-unstable main
但是,尝试更新存储库时出现以下错误
$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://your-server/public/ubuntu bionic-unstable InRelease [3,055 B]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Err:4 http://your-server/public/ubuntu bionic-unstable InRelease
Undetermined Error [IP: XXX.XXX.XXX.XXX 80]
Fetched 247 kB in 5s (47.3 kB/s)
Reading package lists... Done
W: Failed to fetch http://your-server/public/ubuntu/dists/bionic-unstable/InRelease Undetermined Error [IP: XXX.XXX.XXX.XXX 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
我可以看到文件已下载到/ var / lib / apt / lists / partial /,因此没有连接问题的证据,我通过在URL上手动运行wget并获得结果来进一步验证了连接问题。
我认为,问题出在GPG签名中。如果我适当地更改了publish命令以使其未签名,那么我没有问题:
$ aptly publish drop bionic-unstable public/ubuntu
Removing /mydir/.aptly/public/public/ubuntu/dists/bionic-unstable...
Cleaning up prefix "public/ubuntu" components main...
Published repository has been removed successfully.
$ aptly publish repo -skip-signing myrepo-unstable public/ubuntu
Loading packages...
Generating metadata files and linking package files...
Finalizing metadata files...
Local repo myrepo-unstable has been successfully published.
Please setup your webserver to serve directory '/mydir/.aptly/public' with autoindexing.
Now you can add following line to apt sources:
deb http://your-server/public/ubuntu/ bionic-unstable main
Don't forget to add your GPG key to apt with apt-key.
You can also use `aptly serve` to publish your repositories over HTTP quickly.
现在,我可以在目标计算机上更新APT列表:
$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Ign:4 http://your-server/public/ubuntu bionic-unstable InRelease
Get:5 http://your-server/public/ubuntu bionic-unstable Release [2,347 B]
Ign:6 http://your-server/public/ubuntu bionic-unstable Release.gpg
Get:7 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Fetched 249 kB in 1s (240 kB/s)
Reading package lists... Done
我现在也可以安装软件包。但是,我希望能够生成已签名的存储库,但是我不知道为什么登录会导致存储库不可用。
任何想法或建议将不胜感激。