2

I'm trying to install coreutils on NetBSD 6.1.5 using the pkgsrc system.

This is on the default install of 6.1.5. The only change made has been to install zsh and set it as my default shell for users root and any local users.

As is the pkgsrc way, I change to the directory with the pkgsrc heirachy containing the package I want to install. In this case it is /usr/pkgsrc/sysutils/coreutils

When I enter this directory as root I type

make

and then get an error:

configure: error: you should not run configure as root (set
FORCE_UNSAFE_CONFIGURE=1 in environment to bypass this check)
See `config.log' for more details
*** Error code 1

This is not typical when using pkgsrc as root, and seems to be specific to gnu packages, as I have not experienced it with any other package in pkgsrc.

When I do make as a normal user in the same directory I don't have permission to write to any directory under /usr/pkgsrc and make fails due to a bunch of permission denied errors. For example:

sh: Cannot create configure.override: permission denied.

Copying the package directory to somewhere a local user has write permission and compiling would not seem to be in line with using pkgsrc.

Does the user have to be part of a special group to use pkgsrc?

14
  • Could you show the exact error messages and how are you trying to install them?
    – Braiam
    Commented Oct 12, 2014 at 20:25
  • Exact error message is permission denied. I can't copy and paste but a screen shot is at imgur.com/EimIoxU . I'm going into the directory above and typing make and pressing enter. Commented Oct 12, 2014 at 20:30
  • Instead of screnshots just copy and paste your terminal output and edit it into your question
    – Braiam
    Commented Oct 12, 2014 at 20:32
  • @Braiam I can't copy and paste. I'm using NetBSD in a virtual machine and don't have vmware tools setup. Screenshots are the best I can provide. Commented Oct 12, 2014 at 20:33
  • mmm... command > file then copy the file somewhere?
    – Braiam
    Commented Oct 12, 2014 at 20:39

2 Answers 2

5

Try the command indicated in the error message:

export FORCE_UNSAFE_CONFIGURE=1 && make

This being said, it is true the "unsafe configure" requirement seems a bit strange. Double-check the log (config.log) and see if there is something more explicit in there.

1
  • I've marked your answer as correct, as it is the only way to get around it. pkgsrc requires being root and I'm sure the pkgsrc maintainers take that into account. The behaviour of the GNU software in pkgsrc is a bug, which I've reported. Commented Oct 16, 2014 at 17:43
2

Alternately, read doc/pkgsrc.txt, and look at for WRKOBJDIR. Set it (in /etc/mk.conf) to a directory that is writable as the non-priviledged user you're wishing to build as.

The pkgsrc infrastructure will prompt for the root users password when it comes time to install the package you built.

1
  • That's interesting, thanks. I'll give it a try the next time I have to install some GNU software. Commented Oct 24, 2014 at 17:40

You must log in to answer this question.

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