The critical error message (below) baffled me for a little bit until I walked through exactly what cowbuilder
(and the underlying pbuilder
tool) are trying to do.
Package cowdancer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
It is a confusing message because it only appears when executing cowbuilder --create
. In other words, when I invoke this command, it complains about missing a package I already installed. Weird.
Here is the missing link: cowbuilder
--and by extension, pbuilder
--are trying to create a clean, minimal, chroot environment, inside which there are no extra packages installed. Even though cowbuilder
is already installed outside the chroot, it appears to want to be installed inside the chroot as well. Inside and outside the chroot are totally different worlds. Outside the chroot (the regular environment), your /etc/apt/sources.list
file is king. But inside, it is a different set of rules. The default pbuilder
environment only includes the most critical and minimal repositories necessary for a base/clean install.
The accepted answer talks about adding the "COMPONENTS" argument and specifying some additional repositories. It did not work for me. I tried adding the COMPONENTS value to the /etc/pbuilderrc
file, my local .pbuilderrc
file, and also doing that on the command line as an environment variable. No luck. I did find a few references that mentioned how the COMPONENTS argument is not supported for cowbuilder
.
Finally, I stumbled upon a blog post that talked about adding a variable named OTHERMIRROR
to the /etc/pbuilderrc
file. For me, I simply added the following:
OTHERMIRROR="deb http://archive.ubuntu.com/ubuntu saucy main restricted universe multiverse | deb http://archive.ubuntu.com/ubuntu saucy-backports main restricted universe multiverse | deb http://archive.ubuntu.com/ubuntu saucy-security main restricted universe multiverse | deb http://archive.ubuntu.com/ubuntu saucy-updates main restricted universe multiverse"
[Note that you can update/change saucy
to whatever you would like (e.g. trusty
, raring
, precise
, or even wheezy
and sid
provided you have the appropriate debian mirrors, etc.).
Then, I simply ran the following from the command line and everything was created successfully and I was able to proceed:
sudo cowbuilder --create # defaults to using current distribution
Obviously you can change distributions using the "--distribution" command line argument. It takes a few minutes to establish the initial environment, but once it is created, you can easily update the packages, etc. using cowbuilder
.
The cowbuilder page on the Debian website talks about creating an Ubuntu-specific cowbuilder. It mentions that cowdancer
has been moved to the universe
repository. They reference running the following command to build a cowbuilder environment on Ubuntu:
DIST=trusty sudo cowbuilder --create --distribution trusty --components "main universe"
The --components="main universe"
flag is the critical piece to ensure the creation process has access to all the necessary repositories.
cowdancer
) enabled for the build; see John S. Gruber's answer.