# How to install a binary package without Internet access?



## MrStalker (Nov 3, 2013)

Hello!

I'm trying FreeBSD 10.0-BETA2. For the Internet connection (L2TP) I use MPD5. Earlier I could install the MPD5 package by the command `# pkg_add mpd-5.7.tbz`. But in FreeBSD 10 `pkg_add` is no longer available. *pkgng* requires installing from Internet.

```
root@Test:/home/mrstalker # pkg add
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]:
```
How to install the binary package in this situation? Or in RELEASE will be the preinstalled pkgng?


----------



## Beastie (Nov 3, 2013)

Perhaps you could try to build it from source. You can get it from one of these mirrors.


----------



## MrStalker (Nov 4, 2013)

@Beastie, thanks! As an alternative, a very good solution.


----------



## Beastie (Dec 1, 2013)

This comes a bit late, but it may help you or someone else in the future.

It's a solution I found on the PKG primer and it's faster as it installs the package itself using the static binary included inside.

First fetch the package on a machine with an access to the Internet: `fetch [url=http://pkg1.nyi.freebsd.org/freebsd:10:x86:64/latest/All/pkg-1.2.1.txz]http://pkg1.nyi.freebsd.org/freebsd:10: ... -1.2.1.txz[/url]`. Then on the second machine:

```
tar xf ./pkg-1.2.1.txz -s ",/.*/,,g" "*/pkg-static"
./pkg-static add ./pkg-1.2.1.txz
```


----------



## MrStalker (Dec 16, 2013)

Today I'_ve_ tried pkg add on FreeBSD 10.0-RC2, it works! Thanks developers.

But... I'm faced with a problem. I downloaded the package http://pkg.freebsd.org/freebsd:10:x86:6 ... pd-5.7.txz and tried:

```
# pkg add mpd-5.7.txz
Signature for pkg not available.
```
What's wrong?


----------



## ShelLuser (Dec 16, 2013)

MrStalker said:
			
		

> ```
> # pkg add mpd-5.7.txz
> Signature for pkg not available.
> ```
> What's wrong?


Most likely your repository file. I think you've told pkg to use fingerprints as the signature_type but the binary repository doesn't seem to support that right now.

The easiest solution is not to specify signature_type so that it defaults to NONE. See pkg.conf(5) for more information on that.


----------



## MrStalker (Jan 2, 2014)

I tried this is on FreeBSD 10-RC4, the situation is the same. I've edited /etc/pkg/FreeBSD.conf by recommendation of @ShelLuser. But it caused a new problem:

```
pkg: fail to extract pkg-static
```
However, @Beastie's solution works without problems.


----------



## sudiv (Jan 3, 2014)

I also tried 10-RC4. It gives the same problem as in the first post. Previous releases in this regard have been easier. Thanks @Beastie. I will try your option to install packages.


----------



## Cogentleman (Apr 4, 2014)

Just thought I'd put my own experience out there, I was just having this problem whenever I tried to install `pkg` with the pkg: fail to extract pkg-static message. As per the recommendation of ShelLuser, I edited etc/pkg/FreeBSD.conf and logged in as root and was able to get it to work properly. Thanks, ShelLuser!


----------



## Handy92 (Apr 30, 2017)

Solved - https://forums.freebsd.org/threads/60723/


----------

