我可以使用Debian软件包构建环境来构建Ubuntu软件包吗?

我有一台Debian wheezy服务器,我使用它来使用pbuilder和git-buildpackage构建软件包。目前,我可以为Debian sid、wheezy和squeeze构建软件包。
我希望能够使用同一台服务器来构建Ubuntu发行版的软件包。我尝试通过在/etc/pbuilder/trusty中创建一个trusty配置文件来实现这一点,但是我从debootstrap那里得到了错误信息。
 -> Invoking pbuilder
  forking: pbuilder create --configfile /etc/pbuilder/trusty --buildplace /var/cache/pbuilder/base-trusty.cow --mirror http://debian.stanford.edu/ubuntu --distribution trusty --no-targz --extrapackages cowdancer 
W: /root/.pbuilderrc does not exist
I: Running in no-targz mode
I: Distribution is trusty.
I: Current time: Thu Oct  2 14:24:21 PDT 2014
I: pbuilder-time-stamp: 1412285061
I: Building the build environment
I: running debootstrap
/usr/sbin/debootstrap
I: Retrieving Release
I: Retrieving Release.gpg
I: Checking Release signature
E: Release signed by unknown key (key id 3B4FE6ACC0B21F32)
E: debootstrap failed
W: Aborting with an error
pbuilder create failed
  forking: rm -rf /var/cache/pbuilder/base-trusty.cow 

这是apt-key list输出的结果:
/etc/apt/trusted.gpg
--------------------
pub   4096R/C0B21F32 2012-05-11
uid                  Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>

/etc/apt/trusted.gpg.d//debian-archive-squeeze-automatic.gpg
------------------------------------------------------------
pub   4096R/473041FA 2010-08-27 [expires: 2018-03-05]
uid                  Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>

/etc/apt/trusted.gpg.d//debian-archive-squeeze-stable.gpg
---------------------------------------------------------
pub   4096R/B98321F9 2010-08-07 [expires: 2017-08-05]
uid                  Squeeze Stable Release Key <debian-release@lists.debian.org>

/etc/apt/trusted.gpg.d//debian-archive-wheezy-automatic.gpg
-----------------------------------------------------------
pub   4096R/46925553 2012-04-27 [expires: 2020-04-25]
uid                  Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>

/etc/apt/trusted.gpg.d//debian-archive-wheezy-stable.gpg
--------------------------------------------------------
pub   4096R/65FFB764 2012-05-08 [expires: 2019-05-07]
uid                  Wheezy Stable Release Key <debian-release@lists.debian.org>

也许有人知道适当的配置,可以让我做到这一点。或者我应该放弃,基于Ubuntu自己构建一个独立的构建服务器?

1在这里添加debootstrap的确切错误可能会有所帮助。 - Jorge Castro
添加错误文本。 - rlandster
1个回答

问题在于debootstrap不使用您本地的密钥环,而是仅使用位于/usr/share/keyrings/下的密钥环,而不是/etc/apt/trusted.gpg或/etc/apt/trusted.gpg.d/中的密钥环。
从Debian 8 Jessie开始,您可以简单地安装(官方Debian)软件包ubuntu-archive-keyring,这应该可以解决您的问题。
在早期的Debian版本中,您可以使pbuilder将--keyring=/etc/apt/trusted.gpg传递给debootstrap,因为您已经在该文件中拥有正确的密钥。根据其手册页,在pbuilder调用中添加--debootstrapopts --keyring=/etc/apt/trusted.gpg应该可以实现这一点。