I'm trying to create a build environment for Lucid, and calling cowbuilder --create --distribution lucid fails with the messages below:

Get:1 http://us-east-1.ec2.archive.ubuntu.com lucid Release.gpg [189B]
Hit http://us-east-1.ec2.archive.ubuntu.com lucid Release
Hit http://us-east-1.ec2.archive.ubuntu.com lucid/main Packages
Fetched 189B in 0s (2376B/s)
Reading package lists...
I: Obtaining the cached apt archive contents
Reading package lists...
Building dependency tree...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
apt is already the newest version.
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
E: Package cowdancer has no installation candidate
I: unmounting dev/pts filesystem
I: unmounting proc filesystem
pbuilder create failed
  forking: rm -rf /opt/cowbuilder 
  • What does your ~/.pbuilderrc contain? Commented Aug 21, 2012 at 5:14
  • @Daenyth Is that the complete output? If so, then the problem is that you don't have the Universe repository (which provides cowdancer) enabled for the build; see John S. Gruber's answer. Commented Aug 21, 2012 at 7:50
  • @EliahKagan: It's not, as the complete output was very long. I'll pastebin it somewhere if it fails after trying John's suggestion
    – Daenyth
    Commented Aug 21, 2012 at 13:21
  • @JohnSGruber: Nothing. I'm trying your suggestion now.
    – Daenyth
    Commented Aug 21, 2012 at 13:25

2 Answers 2


Try adding the following to your ~/.pbuilderrc:

COMPONENTS="main universe multiverse restricted"

or, as SunSparc suggested, enter the command as follows:

COMPONENTS="main universe multiverse restricted" cowbuilder --create --distribution lucid

cowbuilder is in the universe component for lucid. I don't see the create operation trying to access universe in the output you included in your question.

The file ~/.pbuilderrc can be set up to set many pbuilder options that are used for cowbuilder as well.

  • Thanks, that got me farther. Failed after that trying to hardlink across partitions, but I should be able to solve that. I'm not left with a good impression of the robustness of this tool right now, I have to say.
    – Daenyth
    Commented Aug 21, 2012 at 13:29
  • I run it with a .pbuilderrc I picked up from here from about 22:00 and here, adding quantal, etc., as necessary. I often just use pbuilder as the speed difference isn't much. Both really need a good .pbuilderrc, however. Commented Aug 21, 2012 at 13:38
  • @Daenyth, I think for the cowbuilder technique to work both the .cow base and the temporary build directory must be on the same partition. The hardlinks are required as part of the .cow trick. Commented Aug 21, 2012 at 13:53
  • @SunSparc, It was messed up as it was. Thanks for pointing that out with your edit suggestion. Commented Nov 17, 2013 at 18:13

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.

  • Thanks for this, the accepted answer did not work for me either, but this one did. I am using the saucy distribution as well.
    – Paccc
    Commented Nov 22, 2013 at 21:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .