# pkg search/pkg install finds nothing



## raindog308 (Jan 15, 2015)

Usual high likelihood of pilot error here, but I'm stumped.

I stood up a new FreeBSD 10.1-RELEASE VM on Digital Ocean, which announced support for FreeBSD this week.  After logging in, I cannot find anything via `pkg search`.  For example:


```
root@vanadium:~ # pkg search sqlite3
root@vanadium:~ # pkg search curl
root@vanadium:~ # pkg search emacs
root@vanadium:~ #
```

Likewise, installs don't work:


```
root@vanadium:/usr/ports/editors # pkg install curl
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
pkg: No packages available to install matching 'curl' have been found in the repositories

root@vanadium:/usr/ports/editors # pkg install editors/emacs
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
pkg: No packages available to install matching 'editors/emacs' have been found in the repositories
```

In /etc/pkg I see a FreeBSD.conf, the non-comments section of which is:


```
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
```

I also see files in /var/db/pkg:

```
root@vanadium:/etc # ll /var/db/pkg
total 3324
-rw-r--r--  1 root  wheel  246 Jan 15 21:24 FreeBSD.meta
-rw-r--r--  1 root  wheel  3282944 Jan 15 21:50 local.sqlite
-rw-r--r--  1 root  wheel  54272 Jan 15 21:25 repo-FreeBSD.sqlite
```

There is a /usr/local/etc/pkg.conf.sample though no pkg.conf, though based on comments on that file this appears to not be a problem.

I can query installed packages.  For example:


```
root@vanadium:/etc # pkg -N
pkg: 37 packages installed
```

`pkg info` works as well.  DNS works fine.  The pkg version is 1.4.4.

I'm a bit stumped - what am I missing?


----------



## phoenix (Jan 15, 2015)

What's the output of:
`# pkg update`


----------



## raindog308 (Jan 15, 2015)

```
root@vanadium:~ # pkg update
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
root@vanadium:~ # pkg search curl
root@vanadium:~ #
```


----------



## raindog308 (Jan 16, 2015)

Oddly, dropping the VM and recreating it fixed the problem.


----------



## phoenix (Jan 16, 2015)

Weird.  My next suggestion was going to be to force the update:  `# pkg update -f`


----------



## raindog308 (Jan 16, 2015)

That's valuable advice that I'll keep tucked away.  In this case, I had work to do so I pursued the quick solution to see if it fixed the issue, which it did.

Does `pkg update -f` "nuke and rebuild" the package database?


----------



## phoenix (Jan 16, 2015)

Yes.  It's described in the pkg-update(8) man page.


----------

