Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 
share|improve this question
    
What does your ~/.pbuilderrc contain? –  John S Gruber Aug 21 '12 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. –  Eliah Kagan Aug 21 '12 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 Aug 21 '12 at 13:21
    
@JohnSGruber: Nothing. I'm trying your suggestion now. –  Daenyth Aug 21 '12 at 13:25
add comment

2 Answers 2

up vote 3 down vote accepted
+50

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.

share|improve this answer
    
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 Aug 21 '12 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. –  John S Gruber Aug 21 '12 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. –  John S Gruber Aug 21 '12 at 13:53
    
@SunSparc, It was messed up as it was. Thanks for pointing that out with your edit suggestion. –  John S Gruber Nov 17 '13 at 18:13
add comment

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 not 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. raring, precise, 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.

share|improve this answer
    
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 Nov 22 '13 at 21:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.