# error when trying to usr pkg



## molofishy (Dec 20, 2018)

after typing this:
`pkg install py27-matplotlib`

The following is returned:

```
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory
```

And pretty much the same error for other pkg commands I try. Any ideas?

Thank you!


----------



## Rhadamanthys (Dec 20, 2018)

you can try removing everything from /var/db/pkg and try `pkg update`


----------



## SirDice (Dec 21, 2018)

Rhadamanthys said:


> you can try removing everything from /var/db/pkg


No, no, no! That will also remove local.sqlite, which is the database that holds a list of your currently installed packages. If you remove it the system will think there's nothing installed.



molofishy said:


> pkg: Repository FreeBSD load error: access repo file(/var/db/pkg/repo-FreeBSD.sqlite) failed: No such file or directory


You get this "error" the first time you run pkg(8), the locally cached repository data simply doesn't exist yet.


----------



## molofishy (Dec 21, 2018)

Appears I could not ping anything. e.g. _ping google.com_ returned nothing. This command fixed it: _ifconfig em0 up; dhclient em0. _Where em0 is the first thing that appears when I type _ifconfig. _

Now I can run the above pkg commands.


----------



## Sevendogsbsd (Dec 21, 2018)

Assume you have the configuration in /etc/rc.conf so your network settings persist across reboots? 

FreeBSD network set up


----------

