# help with pkgdb



## Beju (Aug 13, 2009)

Hello, I am new to FreeBSD so please be patient with me

I am trying to upgrade my ports with portupgrade, and since I haven't touched my system for a while, 90% of it is oudated. When  I'm doing "pkgdb -F", as it's recommended in the handbook, I'm getting some kind of "circular dependency": the program fails with message saying that I should run "pkgdb -F" to fix the problem  Here is the listing:

```
[root@cephiro /usr/ports/lang/mono]# pkgdb -OF
--->  Checking the package registry database
Stale origin: 'devel/monodoc': perhaps moved or obsoleted.
-> The port 'devel/monodoc' was removed on 2009-06-19 because:
	"Now included in lang/mono"
-> Hint:  monodoc-1.2.5 is required by the following package(s):
	gnome-sharp-2.16.0_4
	gmime-sharp-2.2.10
	gnome2-2.20.1
	tomboy-0.8.0_1
	gtk-sharp-2.10.2_1
-> Hint: checking for overwritten files...
 -> No files installed by monodoc-1.2.5 have been overwritten by other packages.
Deinstall monodoc-1.2.5 ? [no] yes
Stale dependency: monodoc-1.2.5 --> mono-1.2.5.1 -- manually run 'pkgdb -F' to fix, or specify -O to force.
Command failed [exit code 1]: /usr/local/sbin/pkg_deinstall monodoc-1.2.5
```

Could someone help me?


----------



## phoenix (Aug 13, 2009)

You'll have to manually uninstall the monodoc package, and then upgrade the lang/mono port, which will reinstall the docs.  Something like 
	
	



```
# pkg_delete -xi monodoc
# portupgrade lang/mono
```
 should take care of it.  Afterwards, re-run *pkgdb -F* and it should fix things up for you.  (Note, I haven't used portupgrade in many years, so the exact syntax for the portupgrade command above may be incorrect -- I've been using portmaster.)


----------



## SirDice (Aug 13, 2009)

If you have that many things out of date it's usually simpler to just remove all the packages and start from scratch. This will also prevent weird results when certain ports aren't updated in the correct order.


----------



## Beju (Aug 14, 2009)

SirDice said:
			
		

> If you have that many things out of date it's usually simpler to just remove all the packages and start from scratch. This will also prevent weird results when certain ports aren't updated in the correct order.



I thought about it, but I have no idea how to do it:\ Or maybe You meant I should format the disk and reinstall freebsd? Upgrading all of those packages is really pain in the ass


----------



## phoenix (Aug 14, 2009)

He means to use *pkg_delete* to uninstall all your apps, then either use the ports tree to reinstall them all manually, or use something like *portmaster* or *portupgrade* (or similar tools) to install them semi-automatically.

If /usr/local is a separate filesystem, you can also just copy /usr/local/etc to somewhere (`# cp -Rp /usr/local/etc ~/`), then re-format just that filesystem (`# umount /usr/local; newfs /dev/ad0s1d` where ad0s1d is the partition name for /usr/local), and then purge the installed packages database (`# rm -rf /var/db/pkg/*`).  That will generally be faster.  Be sure to recreate /usr/local/etc and to copy the contents of that directory back.  (If any of that sounds overly complicated, you probably shouldn't try it on a system you care about.)


----------



## Beju (Aug 15, 2009)

Thanks Although I didn't make /usr/local a separate fs, I've deleted all of my packages && I am currently reinstalling them by hand. Everything seems to be on a good way


----------

