# ports deadlock



## Business_Woman (Jan 30, 2010)

Hi,

I've run into a nasty ports deadlock. It has got to do with the recent update of policykit. I didn't update the ports in the correct order and now everything has gone fubar.

I tried removing both policykit and polkit, but no luck.

How do you remove all ports that depend on a specific port wich isn't installed? 

For example i want to delete and rebuild all the ports that depend on polkit and policykit, but neither of them are installed!

I've heard something about the env FORCE_PKG_REGISTER.

//Business_woman

edit: just discovered i posted this wrong, forgive me...


----------



## Business_Woman (Jan 31, 2010)

Please?


----------



## sixtydoses (Jan 31, 2010)

I think I've encountered this before but unfortunately I don't really remember exactly what I did to solve it (think it has something to do with some of my settings in /etc/make.conf).

Anyway, see if this helps:
http://freebsd.munk.me.uk/archives/199-Portupgrade-fails-to-upgrade-dependencies.html


----------



## Business_Woman (Feb 1, 2010)

Also, it seems like you are unable to run portupgrade when you have an inconsistent package database. Why?

This causes a catch 22 situation where some ports fail to install because of dependencies that are not up to date.


----------



## phoenix (Feb 2, 2010)

If the port is uninstalled without updating the dependency info in /var/db/pkg, you can use grep to find packages that require polkit/policykit like so: `$ grep -ri /var/db/pkg/*/+REQUIRED_BY`

Then you can use `# pkg_delete -fxi <portname>` to forcibly remove them (-x allows you to specify partial names, -i will ask you if you actually want to delete it, -f will force it even if other apps depend on it).

Then use portmaster (or whatever tool you prefer) to re-install polkit/policykit and everything you just removed.


----------



## phoenix (Feb 2, 2010)

Business_Woman said:
			
		

> Also, it seems like you are unable to run portupgrade when you have an inconsistent package database. Why?



That's one of the issues with using portupgrade.  It uses separate INDEX.db and pkgdb.db databases for it's searches and dependency tracking.  On the one hand, these are binary databases so searches are extremely fast.  On the other hand, these are separate from the actual ports tree INDEX and installed packages database so they can get out-of-sync and cause issues.

This is the main reason for portmaster's existence, and why a lot of us prefer portmaster now.


----------



## DutchDaemon (Feb 2, 2010)

You can also regenerate portupgrade's pkgdb file by removing (or setting aside) /var/db/pkg/pkgdb.db and running `# pkgdb -u`. This usually succeeds in getting past roadblocks that `# pkgdb -F` cannot tackle. Assuming one tackles roadblocks.


----------

