Cannot Make Install Clean Ports From User Account

So this is my first FreeBSD machine on a Dell 4600 and after having red the manual over while at work I thought I was confident enough to give the installation a go... well I already failed.

When I installed from the "FreeBSD-8.1-RELEASE-i386-disc1.iso" by CD I installed the ports collection that was on the CD and set up an additional user account. I added that account to the groups "wheel" and "operator." Anyhow, upon first boot I logged into my account and found out that if I tried to cd into a ports directory and install, say, Xorg, I received a long list of errors of "could not find pkg" or something to that effect. However, from using the root account I could use pkg_add -r and make install clean (I checked both).

Do I have to configure more permissions or something?

I also found it strange that when I installed the ports collection from the CD I could not install Xorg at installation-time. But when I started the computer after installation, Xorg was there in the ports... what gives? Do I need the DVD for that?
 
Yes, being in the "wheel" group allows you to su(1) to root.

You can also install security/sudo and learn to append to the fore of every command a "sudo".

I suppose if one were hacky enough one could make the ports directory owned by a user other than root. That sounds pretty difficult* and not very worthwhile, however.


* of course, changing the owner and group would take just a few keystrokes, but making it actually work might take a tiny bit more.
 
Welcome. Sounds like you have gotten very far. The ports system is mainly used by root. It installed the port globally. When you are ready to run make install. Type su() first and you will be prompted for roots password. to return to your user press ctrl-d or type exit.

If you want your user to have it's own private (local) programs you will need to create a bin dir in the users directory and compile from source.

If you must install in user dir look at ports() and find destdir. But once again note that you still need to be root to use it and it is unconventional.
 
You can build as a non-root user. Set WRKDIRPREFIX to a place where that user can write. You may also need to set DISTDIR (default is /usr/ports/distfiles/) so downloaded sources can be stored there.

Installing something the 'normal' way (using 'make install') does require root privileges unless you set DESTDIR to a place where said user can write.
 
Thanks all for the helpful response. I did install "sudo" as root and set up the sudoers file to include my user account and everything is working fine now.

I don't suppose there is a way to mark this as SOLVED now is there?
 
Back
Top