# "pkg_add -r pkg" fails with could not find package



## cartland (Nov 8, 2012)

My first time installing FreeBSD. After a week of pouring over the forums, handbook, etc, and several attempts (taking incremental snapshots), I finally got an error free installation in a VirtualBox VM including KDE and NFS to the Ubuntu host (Linux Mint 13 actually) :e.

I still haven't quite grokked the packages/ports RELEASE/STABLE/CURRENT stuff yet. So thought I'd finally ask a question relating to packaging.

Based on ports-mgmt/pkg, I run "pkg_add -r pkg" and get

```
Error: Unable to get [url]ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.0-release/Latest/pkg.tbz:[/url] File unavailable (e.g., file not found, no access)
```
Since my understanding is somewhat :q despite reading the handbook (probably missed something), can someone point me in the right direction - i.e. what are the high-level steps I need to take to install pkgng?

BTW:
I notice pkg-1.0.1.tbz exists in
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/ports-mgmt
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/ports-mgmt
So I tried the stable version (pkg_add ftp:.....). Seemed to work but is this approach advisable in general?

thanks


----------



## SirDice (Nov 8, 2012)

If you installed the 9.1 release candidate you can simply run *pkg* and it'll bootstrap itself.


----------



## cartland (Nov 9, 2012)

After running pk2ng I get errors:


```
pkg: Skipping malformed dependency perl-threaded
```
I originally removed it with pkg_delete -f because some *sysinstall* package wanted the non-threaded version which conflicted (can't remember the package - kde or X11 I think).


```
pkg: lstat(....): No such file or directory
```
Got a bunch of these.

3. Finally at the end:

```
Some packages failed to register .. : libungif-4.1.4_5
```
And with PACKAGESITE = ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.0-RELEASE/packages/Latest/

*pkg update* gives

```
pkg: [url]ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/9.0-RELEASE/packages/Latest//repo.txz:[/url] File unavailable (e.g., file not found, no access)
```

How best should I proceed?

thanks


----------



## jb_fvwm2 (Nov 9, 2012)

set PACKAGESITE to 9-STABLE? (Search the forum for PACKAGESITE threads, one or more will show completely how.)


----------



## cartland (Nov 9, 2012)

jb_fvwm2 said:
			
		

> set PACKAGESITE to 9-STABLE? (Search the forum for PACKAGESITE threads, one or more will show completely how.)



Thanks - I've had a search around - most discussion is related to pkg_add.

At the moment I am getting by using *pkg_add* with 
PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/

However I'd like to get *pkgng* working.

In my pkg.conf file, I tried a few different variations under "http://pkgbeta.freebsd.org/freebsd-9-amd64/" where repo.txz exists

but they all give the same error below - e.g.

```
pkg: [url]http://pkgbeta/freebsd.org/freebsd-9-amd64/latest/repo.txz:[/url] No address record
```


----------



## cartland (Nov 9, 2012)

jb_fvwm2 said:
			
		

> set PACKAGESITE to 9-STABLE? (Search the forum for PACKAGESITE threads, one or more will show completely how.)



Updating /usr/local/etc/pkg.conf with PACKAGESITE: http://pkgbeta.freebsd.org/freebsd-9-amd64/latest (not http://pkgbeta/freebsd.org/freebsd-9-amd64/latest :r) worked.

thanks.


----------

