# using packages locally



## delProfundo (Jul 22, 2010)

Ok so I am very new to FreeBSD and am having some issues with packages.

What I would like to do is move the packages folder onto the device I am building so I can build the machine away from the internet. The machine only has a cdrom so I have built it using the cd and not the dvd. I have now copied the packages folder onto the machine.

Next I tried to set the package location with the PKG_PATH variable but still get "can't stat package" for any package I try to install using pkg_add. I have found a few different pieces of advice on how to set the PKG_PATH variable but none seem to be working.

Any advice would be appreciated.


----------



## SirDice (Jul 22, 2010)

Just install the packages from that location. No need to use the *-r* (remote) option to pkg_add. You also don't need to set any variables.


----------



## delProfundo (Jul 22, 2010)

Thanks SirDice, I have had a crack and still failed. Here is exactly what I have done:

1) packages located at /usr/ports/packages/
2) I traversed to /usr/ports/packages/x11
3) executed pkg_add xorg

Error returned:
pkg_add can't stat package file 'xorg'           (error occurs no matter what package i try)

I have taken the name xorg from the handbook assuming it is correct. There is obviously something I am missing.

Thanks


----------



## Beastie (Jul 22, 2010)

When using pkg_add locally, you must pass it the exact filename, including the "extension" (and the version if available), e.g.
`# pkg_add xorg.tbz`
or
`# pkg_add xorg-7.x.tbz`


----------



## SirDice (Jul 22, 2010)

Hint: use TAB for filename completion.


----------



## delProfundo (Jul 22, 2010)

Ok guys first of all thanks for rapid responses. Still not working.

Using both your suggestions I have tried this:

`pkg_add xorg-7.4_2.tbz`


```
To only get this error:
tar: Unrecognized archive format
tar: +CONTENTS: Not found in archive
tar: Error exit delayed from prefious errors.
pkg_add: tar extract of /usr/ports/packages/x11/xorg-7.4_2.tbz failed!
pkg_add: unable to extract of table of contents file from 'usr/ports/packages/x11
```


I am wondering if this is to do with the zip libraries present? I have a standard build only addition is bzip2 from ports.

Thanks again guys.


----------



## delProfundo (Jul 22, 2010)

oops I truncated the last line of the error:


```
pkg_add: unable to extract of table of contents file from 'usr/ports/packages/x11/xorg-7.4_2.tbz' - not a package?
```


----------



## SirDice (Jul 22, 2010)

It's either not a package or it got corrupted when transfered to this system.


----------



## delProfundo (Jul 22, 2010)

Well it turns out that the files are fine. It wouldn't let me do it from the port like folder (so x11 folder) but if you go into the All folder where the actual files aer and run the same command it works.

I was sure I tried this but wasn't using tab yet so probably was me doing typos.

Thanks for ur time guys I really appreciate it.

b


----------

