# Unable to deinstall port. port-blabla has a different PREFIX: /s/usr-local, skipping



## mamalos (Sep 5, 2012)

Hi all,

I am facing this problem on my recent FreeBSD-9-STABLE servers built with jails and I'm sure I must be missing something very trivial but my head is stuck. I've build my jails in a way similar to the "Application of Jails" section of FreeBSD Handbook, so my portsbuild directory is /s/portbuild and /usr/local is a symlink to ..s/usr-local, as shown:


```
[root@samba-manage /]# ls -l /usr/local
lrwxr-xr-x  1 root  wheel  - 14  5 Î£ÎµÏ€ 14:16 /usr/local@ -> ../s/usr-local
[root@samba-manage /]# ls /s/usr-local/
./       ../      bin/     etc/     include/ info/    lib/     libdata/ libexec/ man/     samba/   sbin/    share/   www/
[root@samba-manage /]# cat /etc/make.conf
WRKDIRPREFIX?= /s/portbuild
# added by use.perl 2012-06-26 17:09:01
PERL_VERSION=5.12.4
CPUTYPE?=native
CFLAGS= -O2 -pipe -march=native -mtune=native
COPTFLAGS= -O2 -pipe -march=native -mtune=native
```

Now, my problem is that after I install a port and then wish to deinstall it using:

[CMD="[root@samba-manage /]#"] make deinstall[/CMD]

I get the error of my post's title. In particular, when I wish to remove samba-3.6.5 I get:

```
[root@samba-manage samba36]# make deinstall
===>  Deinstalling for net/samba36
===>   samba36-3.6.5 has a different PREFIX: /s/usr-local, skipping
```
What is the different PREFIX it is talking about? I mean what should it be and what does it think it is? A search in /var/db/pkg/samba36-3.6.5/+CONTENTS returns:

```
[root@samba-manage samba36-3.6.5]# grep usr-local /var/db/pkg/samba36-3.6.5/+CONTENTS 
@cwd /s/usr-local
```
Which seems rational...
I know it must be something trivial that I am missing, and I know I can use:

[CMD="[root@samba-manage /]#"]pkg_delete -f samba\*[/CMD]

in order to complete my task, but I want to understand what I've done wrong and corrected in the last 8 servers that I have set up.

PS. How can I use vi/vim to read a filename starting with a '+' character (like +CONTENTS mentioned in the last paragraphs) without giving the full path? (the file is in the CWD).

Thanx all in advance!


----------



## SirDice (Sep 5, 2012)

mamalos said:
			
		

> PS. How can I use vi/vim to read a filename starting with a '+' character (like +CONTENTS mentioned in the last paragraphs) without giving the full path? (the file is in the CWD).


The + probably gets interpreted as an option. Normally you use double dashes -- to indicate to stop processing options and accept the rest as arguments.

[cmd=]vi -- +CONTENTS[/cmd]


----------



## mamalos (Sep 5, 2012)

Thanx SirDice, 

I had totally forgotten about --...what a shame!


----------



## mamalos (Sep 5, 2012)

Guys?

No thoughts on my main problem? Come on, someone must have a hint on where the PREFIX is found and how it is validated, no? 

Thanx all again!


----------



## SirDice (Sep 5, 2012)

PREFIX is normally set to /usr/local/ for ports.


----------



## bthomson (Mar 19, 2013)

I ran into the same problem after following the handbook instructions. It seems like you can fix this temporarily with `make deinstall PREFIX=/s/usr-local`, where /s/usr-local is whatever make spits out when you type `make deinstall`. If you followed the handbook instructions exactly it will be /s/usr-local.

I am not familiar enough with how port building works to know if setting PREFIX in make.conf is a good idea.

Anyway, I will try to submit a PR so we can get a note about this into the handbook.


----------

