# root -> permission denied ?!!



## nORKy (Sep 3, 2009)

I have a problem with many ports :


```
Making install in docs
/bin/sh ../mkinstalldirs /usr/local/;/usr/local/info;/usr/local/info/
/usr/local/info: Permission denied
*** Error code 126
```


I'm root.

So, what is the problem ??


----------



## DutchDaemon (Sep 3, 2009)

Do you run at an elevated securelevel? Are you using chflags anywhere?


----------



## DutchDaemon (Sep 3, 2009)

nORKy said:
			
		

> ```
> Making install in docs
> /bin/sh ../mkinstalldirs /usr/local/;/usr/local/info;/usr/local/info/
> /usr/local/info: Permission denied
> ...



Did you copy this, or type it by hand? Because it looks like the script is trying to actually *execute* /usr/local/info, which is a directory, not an executable. And that leads to a 'permission denied' error in the Bourne shell.

If this happens with many ports, something is wrong with the underlying port building structure. Maybe libtool is old (it is very important) and/or your ports tree is outdated? See /usr/ports/UPDATING for pointers.


----------



## nORKy (Sep 3, 2009)

no special level, no chflags
I copied it.

I updated libtool as write in UPDATING... perhaps somethings failed



> # portmaster -o devel/libtool22 devel/libtool15
> 
> ===>>> The second argument can be a port in /var/db/pkg,
> or a port directory from /usr/ports
> ...



libtool15 is not installed


----------



## nORKy (Sep 3, 2009)

Try a portmaster -r libtool22 => 



> nstall-info --quiet /usr/local/;/usr/local/info;/usr/local/info/libtool.info /usr/local/;/usr/local/info;/usr/local/info/dir
> install-info: No dir file specified; try --help for more information.
> *** Error code 1
> 
> ...


----------



## DutchDaemon (Sep 3, 2009)

I suggest removing /usr/ports and starting with a fresh [cmd=]portsnap fetch extract[/cmd] to rule out any damage/inconsistencies in the current ports tree. Also check for possible weirdness in /etc/make.conf, like compiler flags (which should be left alone) and such. After that, run [cmd=]pkg_version -vL "="[/cmd] and update ports one by one, keeping an eye on /usr/ports/UPDATING.


----------



## nORKy (Sep 4, 2009)

:-(

```
# rm -Rf /usr/ports
# portsnap fetch extract
# pkg_version -vL "="
apache-2.2.11_7                     <   needs updating (port has 2.2.13)
boost-1.37.0_1                      <   needs updating (port has 1.39.0)
compat5x-i386-5.4.0.8_9             <   needs updating (port has 5.4.0.8_11)
diablo-jdk-1.6.0.07.02_5            <   needs updating (port has 1.6.0.07.02_6)
dri-7.4.2_1,2                       <   needs updating (port has 7.4.4,2)
fftw3-3.2.1_1                       <   needs updating (port has 3.2.2_1)
firefox-3.5.1,1                     <   needs updating (port has 3.5.2,1)
firefox3-i18n-3.0.11                <   needs updating (port has 3.0.13)
gedit-2.26.3                        <   needs updating (port has 2.26.3_1)
gio-fam-backend-2.20.4              <   needs updating (port has 2.20.5)
git-1.6.4.1                         <   needs updating (port has 1.6.4.2)
gtk-2.16.5_1                        <   needs updating (port has 2.16.6)
libgda4-4.0.2_2                     <   needs updating (port has 4.0.4)
mysql-client-5.1.36                 <   needs updating (port has 5.1.37)
mysql-server-5.1.36                 <   needs updating (port has 5.1.37)
nvidia-driver-180.60                <   needs updating (port has 185.18.29)
p5-Test-Simple-0.92                 <   needs updating (port has 0.94)
wireshark-lite-1.2.0                <   needs updating (port has 1.2.1)

# portmaster gtk-2.16.5_1
...
===> Configuring for libtool-2.2.6a
...
install-info --quiet /usr/local/;/usr/local/info;/usr/local/info/libtool.info /usr/local/;/usr/local/info;/usr/local/info/dir
install-info: No dir file specified; try --help for more information.
*** Error code 1

Stop in /usr/ports/devel/libtool22.

===>>> Installation of libtool-2.2.6a (devel/libtool22) failed
===>>> Aborting update

===>>> Update for /usr/ports/devel/libtool22 failed
===>>> Aborting update
```

my make.conf :

```
# Begin portconf settings
# Do not touch these lines
.if !empty(.CURDIR:M/usr/ports*) && exists(/usr/local/libexec/portconf)
_PORTCONF!=/usr/local/libexec/portconf
.for i in ${_PORTCONF:S/|/ /g}
${i:S/%/ /g}
.endfor
.endif
# End portconf settings
.include "/usr/local/etc/ports_sites.conf"
WITH_GECKO=xulrunner
# added by use.perl 2009-06-10 13:06:32
PERL_VERSION=5.8.9
```


----------



## DutchDaemon (Sep 4, 2009)

I have no idea what is going on here, though it looks like a 'circular bootstrapping' problem: you can't build the tool needed to build a tool.

Try removing libtool and installing it as a package for now (pkg_add -r).


----------



## nORKy (Sep 7, 2009)

:-((((


```
# uname -a                             
FreeBSD pc-Joff.rmidom.intra 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
# pkg_add -r ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/libtool.tbz
# cd /usr/ports/devel/glib12
# make install clean
...
Making install in docs
/bin/sh ../mkinstalldirs /usr/local/;/usr/local/info;/usr/local/info/
/usr/local/info: Permission denied
*** Error code 126

Stop in /usr/ports/devel/glib12/work/glib-1.2.10/docs.
```


----------



## DutchDaemon (Sep 7, 2009)

Weird. This is what I get:


```
[...]
libtool: link: ar cru .libs/libgthread.a  gthread.o
libtool: link: ranlib .libs/libgthread.a
libtool: link: ( cd ".libs" && rm -f "libgthread.la" && ln -s "../libgthread.la" "libgthread.la" )
Making all in docs
[/usr/ports/devel/glib12]#
```

Yes, that's a silent installation of docs, which does succeed.

Which version of pkg-config are you running?


----------



## nORKy (Sep 7, 2009)

```
% pkg-config --version
0.23
```


----------



## DutchDaemon (Sep 7, 2009)

Have you run a 'make clean' on the glib port before trying again? Or you will just reuse faulty code and perpetuate the error.


----------



## nORKy (Sep 7, 2009)

I did a make distclean

And, today, I upgraded: 7.0 -> 7.1 and 7.1 -> 7.2

but, the error is still here ! :-(


----------



## DutchDaemon (Sep 7, 2009)

Are you sure about that portconf stuff in /etc/make.conf? Make sure that it's not introducing some 'interesting' error by taking it for granted.

Other than that: at this point, I'd probably make a list of my 'root' and 'leaf' ports (portmaster -L, 1st and 4th block), remove everything under /usr/local (backup any configs in /usr/local/etc/ first) and reinstall the root/leaf ports from scratch. They should come back with the same options you installed them with, if you don't delete /var/db/ports/. If you want a really pristine ports installation, remove that one as well.


----------



## nORKy (Sep 7, 2009)

You can see my make.conf above

So.. let's go install all again..


----------



## DutchDaemon (Sep 7, 2009)

I know your make.conf -- I don't know what you're doing with portconf. Any chance you can do a trial port install without that make.conf first?


----------



## nORKy (Sep 9, 2009)

What is portconf ??

I move /etc/make.conf to /etc/make.conf.bak, it changed nothings..


----------



## nORKy (Sep 9, 2009)

```
# env
...
INFO_PATH=;/usr/local/info
...
# exort INFO_PATH=
# cd /usr/ports/devel/libtool22/ && make install clean
...
===>   Registering installation for libtool-2.2.6a
```

Thanks you for your help DutchDaemon !


----------



## DutchDaemon (Sep 9, 2009)

Where did *that* come from?


----------



## nORKy (Sep 10, 2009)

.zshrc


----------

