# Help me install vim editor for my USB stick.



## valsorym (Nov 11, 2011)

Howdy all,
I have a little problem.
I created LiveUSB FreeBSD 9.0 use this handbook page. I modified /etc/fstab added RW opportunity. After, I reboot my PC and load <Live CD> FreeBSD 9.0.
Rewrited /etc/rc.conf I added options for my Network. Start Internt, and checked the availablity use "ping" tools. 
Okay,  Internet is active.

I am trying to install editors/vim on the stick (USB Flash).  Since it is not installed in the ports collection:

```
# pkg_add -r vim
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-
current/Latest/vim.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-
current/Latest/vim.tbz:' by URL
```

Okay, I think. Really address "ports/i386/packages-9-current/Latest/" not correct. Now correct adress "ports/i386/packages-9-stable/Latest/". I open ~/.cshrc and write at end of file:

```
setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/Latest/"
```
and save it, and use  `# rehash`

But 

```
# pkg_add -r vim
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-
current/Latest/vim.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-
current/Latest/vim.tbz:' by URL
```

again "ports/i386/packages-9-current/Latest/" - why system not use my PACKAGESITE?
Where write address "ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-current/Latest/" ? I'll rewrite this file. x(


----------



## SirDice (Nov 11, 2011)

doorways said:
			
		

> I open ~/.cshrc and write at end of file:
> 
> ```
> setenv PACKAGESITE "ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/Latest/"
> ...


The rehash command doesn't read ~/.cshrc.

Use
[cmd=]source ~/.cshrc[/cmd]

Or log out and back in again.


----------



## valsorym (Nov 11, 2011)

Yes, source - that's it!

```
# source ~/.cshrc
# pkg_add -r vim
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/
Latest/vim.tbz...pkg_add: find_play_pen: can't find enough temporary space to extract the 
files, please set your PKG_TMPDIR environment variable to a location with at least 0 bytes free.
```


```
# setenv PKG_TMPDIR /tmp
# pkg_add -r vim
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/
Latest/vim.tbz...pkg_add: find_play_pen: can't find enough temporary space to extract the 
files, please set your PKG_TMPDIR environment variable to a location with at least 0 bytes free.
```

I think that creating a LiveUSB so I created the size of slice on my flash drive, 500 MB (place 4 Gg). I will try to mount a slice from the HDD.

Oky, thank you!


----------



## valsorym (Nov 11, 2011)

For people's which to interesting this problem:
I partition my HDD use gpart tools.
-> as it was.
-> gpart details available here. 
Now I have a /dev/gpt/tmp - it is my one slice on my HDD (it has 4G size).
`# mount /dev/gpt/tmp /tmp`
But after this operation my Internet disconnected! 
I started looking for the problem and found it:

```
# ls -l /etc/resolv.conf
lrwxr-xr-x 1 root wheel 31 Oct 18 19:05 /etc/resolv.conf -> /tmp/bsdinstall_etc/resolv.conf
```
Taking the path of minimal resistance (see Ohm's law - Sorry, could not resist), I did:

```
# umount /tmp
# mkdir -p /mnt/tmp
# mount /dev/gpt/tmp /mnt/tmp
```

Reconfig my Internet, and.

```
# setenv PKG_TMPDIR /mnt/tmp
# pkg_add -r vim
```

This time is a download package, and I'm writing this post!


----------

