|
FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD. |
|
Thread Tools | Display Modes |
|
|||
pkg_add -r does not use exported packagesite
Without knowing if this is appropriate to do, my problem is:
I want to use a binary package in /packages-7-stable/Latest/ so I use Code:
export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/ Code:
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.0-release/Latest/"the package": File unavailable (e.g., file not found, no access) pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.0-release/Latest/"the package"' by URL Why does it not search using PACKAGESITE? |
|
|||
from the pkg_add man page
Quote:
__________________
"No, that's wrong, Cartman. But don't worry, there are no stupid answers, just stupid people." -- Mr. Garrison Forum Netiquette |
|
|||
Sorry for me being a bit slow, but what do you mean? Should I set packageroot instead of packagesite?
|
|
|||
eeh well that is what I have tried and with some other variants too. with a Latest/. also as the path. First I thought that the enviroment variable was not available when I sudo but it is. So i guess I just have to look hard at the man page and find out what I'm doing wrong
|
|
|||
Thanks for the replies, but I'm sorry to say that it is not working.
The variable PACKAGESITE is exported but it does not work. Perhaps if I could use setenv instead, but I guess that does not work in bash. Also I cannot use setenv if I switch to sh since it complains that, setenv cannot be found. I cannot locate setenv, so I don't know if I have it. I find the man files for setenv but nothing more. That is weird since I use the standard installation of Freebsd 7 |
|
|||
Ok, still it does not work if I use setenv in csh. But for you, is all that you do just to set the variable PACKAGESITE and then when you use pkg_add -nr , it searches according to PACKAGESITE?
|
|
|||
I don't know if it is against the rules to bump the thread, but since I still haven't solved this problem I hope that I do not offend anyone by doing so.
so here goes nothing - bump! |
|
|||
What is the output of
Code:
env | grep PACKAGESITE
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
thank you for your replies, I feel somewhat honored that the two big shots here take the time to deal with this.
J65nko: before I have exported PACKAGESITE, env |grep PACKAGESITE gives nothing then if i export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/ I get stable-7 in env | grep PACKAGESITE Carpetsmoker: with pf turned off and with packagesite set as above I get Code:
[viktor@Dell /usr/home/viktor]$ env |grep PACKAGESITE PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/ [viktor@Dell /usr/home/viktor]$ sudo pkg_add -nr add Password: Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.0-release/Latest/add.tbz... Done. Code:
[viktor@Dell /usr/home/viktor]$ uname -a FreeBSD Dell 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 |
|
||||
Quote:
From sudoers(5): Code:
env_reset If set, sudo will reset the environment to only contain the LOGNAME, SHELL, USER, USERNAME and the SUDO_* vari- ables. Any variables in the caller's environment that match the env_keep and env_check lists are then added. The default contents of the env_keep and env_check lists are displayed when sudo is run by root with the -V option. If sudo was compiled with the SECURE_PATH option, its value will be used for the PATH environment variable. This flag is on by default. Code:
-E The -E (preserve environment) option will override the env_reset option in sudoers(5)). It is only available when either the match- ing command has the SETENV tag or the setenv option is set in sudo- ers(5).
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
My hat's off to you Mr Carpetsmoker ! -You're surely good at debugging these kind of problems.
Do you know if this is something that is mentioned often in all the guides that recommend the new users to utilize sudo? I guess that from now on I should not overlook the manfiles of the commands that I think I understand. |
|
|||
The newer versions of sudo let the user only inherit a limited set of the environment variables.
However, you can add environment variables you want to inherit through the /etc/sudoers file. From my OpenBSD box (sudo is maintained by OpenBSD developers): Code:
# $OpenBSD: sudoers,v 1.12 2007/08/09 16:12:08 ajacoutot Exp $ # # sudoers file. # # This file MUST be edited with the 'visudo' command as root. # # See the sudoers man page for the details on how to write a sudoers file. # # Host alias specification # User alias specification # Cmnd alias specification # Defaults specification Defaults env_keep +="DESTDIR FETCH_CMD FLAVOR FTPMODE MAKE MULTI_PACKAGES OKAY_FILES PKG_DBDIR PKG_D ESTDIR PKG_CACHE PKG_PATH PKG_TMPDIR PORTSDIR RELEASEDIR SUBPACKAGE" By adding PACKAGESITE to your FreeBSD sudoers file you will have solved this nasty issue
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
Tags |
packagesite, pkg_add, sudo |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pkg_add problems with connecting | Mr-Biscuit | NetBSD Package System (pkgsrc) | 2 | 26th May 2009 11:44 AM |
pkg_add - can't resolve <packagename> | nihonto | OpenBSD Packages and Ports | 11 | 28th January 2009 10:03 PM |
My version of pkg_add :) | DNAeon | FreeBSD Ports and Packages | 26 | 15th October 2008 06:58 AM |
pkg_add g95;g95 x.f95: cannot find g95 | enpey | OpenBSD Packages and Ports | 8 | 27th August 2008 12:48 AM |
pkg_add error | buba | OpenBSD Packages and Ports | 4 | 13th June 2008 03:29 PM |