# Error: No pkg(8) database found



## KBr (Sep 23, 2014)

Trying to install packages generates above mentioned error message.I have done on a fresh installed 10.0 so far:
`pkg bootstrap`
*L*ater on I tried:
`pkg bootstrap -f`
`pkg2ng`
as I was unsure whether 10.0 uses the old pkg by default. I can not find any information on how to generate the missing database.

Can anyone help?


----------



## SirDice (Sep 23, 2014)

What error are you getting? Please post the _whole_ thing, not just the last line.


----------



## KBr (Sep 23, 2014)

That's the whole thing:

```
No pkg(8) database found
```


----------



## talsamon (Sep 23, 2014)

Speaks anything against a reinstall of ports-mgmt/pkg?

```
cd /usr/ports/ports-mgmt/pkg, make deinstall clean, make install clean
```


----------



## KBr (Sep 23, 2014)

Already done that. Same error. Version is 1.3.8 now. It registers everything installed from the ports just fine  but I get that error message if I try to install precompiled packages in the way suggested in the handbook.


----------



## talsamon (Sep 23, 2014)

Do you anything changed in /usr/local/etc/pkg.conf, /usr/local/etc/pkgtools.conf, /etc/pkg/FreeBSD.conf.  Whats in  /usr/local/etc/pkg/repos/FreeBSD.conf.

I don't believe it helps, but you can try to add another user, and try it with this user - if it's anything with the enviroment.


----------



## KBr (Sep 23, 2014)

I have renamed /usr/local/etc/pkg.conf.sample to pkg.conf but didn't change anything. As I understand it, there are just the defaults in it commented. That change was made after I realized that there is an issue of cause  so this definitely didn't cause the issue.


----------



## talsamon (Sep 23, 2014)

What tells `ls -lrt /var/backups/pkg*` ??


----------



## junovitch@ (Sep 23, 2014)

KBr said:
			
		

> I have done on a fresh installed 10.0 so far ... as I was unsure whether 10.0 uses the old pkg by default.



10.0-RELEASE used pkg by default.  So you have no need to convert it.  Additionally, you wouldn't have had a prior database on a fresh install anyway.   You should be good.


----------



## KBr (Sep 24, 2014)

talsamon said:
			
		

> What tells `ls -lrt /var/backups/pkg*` ??


It's empty


----------



## SirDice (Sep 24, 2014)

What does `ls -l /var/db/pkg/` show?


----------



## KBr (Sep 24, 2014)

SirDice said:
			
		

> What does `ls -l /var/db/pkg/` show?




```
root@bsdtest:~ # ls -l /var/db/pkg/
total 13764
-rw-r--r--  1 root  wheel      246 23 Sep 08:12 FreeBSD.meta
-rw-r--r--  1 root  wheel  7364608 23 Sep 20:52 local.sqlite
-rw-r--r--  1 root  wheel    63488 23 Sep 08:12 repo-FreeBSD.sqlite
-rw-r--r--  1 root  wheel  6565888 17 Jan  2014 repo-FreeBSD_install_cdrom.sqlite
root@bsdtest:~ #
```


----------



## wblock@ (Sep 24, 2014)

What we have not seen is the commands you are running to try to install packages.  As shown above, using ports worked.


----------



## KBr (Sep 24, 2014)

wblock@ said:
			
		

> What we have not seen is the commands you are running to try to install packages.  As shown above, using ports worked.


Indeed. I reinstalled pkg from the ports and meanwhile xorg. 
I tried things like `pkg search xorg` and `pkg install xorg`. `pkg info` does work as expected.
I tried to install packages from bsdconfig, using ftp or the install dvd. But it doesn't work either.
I have,besides this issue, issues with getting xorg running with a radeon card. I got the suggestion to try 10.1 beta2. I will do that as soon as I have downloaded the iso. There may have been something badly gone wrong with this install.


----------



## KBr (Sep 24, 2014)

I have just reinstalled the whole system with 10.1 beta2 AMD. Just after install I tried to install packages from DVD via `bsdconfig` without doing anything else after rebooting the box.
Inserted Install DVD again --> started bsdconfig --> selected '3 packages' --> '1 CD/DVD' --> selected ' iso9660/FREEBSD_INSTALL'
and got message Error No pkg(8) database found!.
But `pkg install` does now work! After the initial invocation, `pkg` noticed that there is no database and built it itself. I suppose invocation of `pkg` via `bsdconfig` should do the same trick to get it working. Like any new user would expect it to, instead of issuing an error message. Anyway, thank you for looking into this.

I am using FreeBSD on servers for about 15 years. I am testing it now as an educational system (as an alternative to linux, as that's getting more and more opaque lately). It must be installable for complete beginners on older Pentium4 hardware. That it still doesn't work with an old onboard radeon card is not very promising unfortunately.


----------



## talsamon (Sep 24, 2014)

No, pkg doesn't need the invocation via `bsdconfig`, it should work just after install without anything to do. There's something else wrong.


----------



## asnextage (Dec 2, 2014)

Same problem, help. FreeBSD 10.0-RELEASE.


```
No pkg(8) database found!
```


----------



## DutchDaemon (Dec 2, 2014)

You should not run 10.0-RELEASE anyway. Run 10.1-RELEASE.


----------



## asnextage (Dec 2, 2014)

I'm downloading 10.1-RELEASE. Thank you.


----------



## asnextage (Dec 2, 2014)

I've download 10.1-RELEASE (CD iso) and installed it in VBox. After entering `bsdconfig` it attempts to update the repository catalog but it takes too long for an update (40 minutes) and no response.


----------



## ljboiler (Dec 2, 2014)

Since you're  running FreeBSD in VirtualBox, make sure to check the first item under https://www.freebsd.org/releases/10.1R/errata.html#open-issues if you're running the i386 flavor...


----------



## asnextage (Dec 3, 2014)

It doesn't work. In the FreeBSD installation I've chosen sh (but it seems csh was selected as the default) and I tried this command from errata:

```
# setenv REPOS_DIR /dist/packages/repos
# pkg bootstrap
```
and I got this 
	
	



```
pkg already bootstrapped at /usr/local/sbin/pkg
```
 and then (just some test) `pkg install gnome` and I got this 
	
	



```
no valid repository found.
```


----------

