# Error uninstalling python27



## Driftwood (Jun 29, 2013)

Hi

I am trying to uninstall python27 to solve the exact error encountered in this post and run into a very similar error to the one he encountered while trying to uninstall phyton27, namely 

```
===>   Deinstalling python27-2.7.5_1
pkg_delete: unable to completely remove directory '/usr/local/lib/python2.7/site-packages'
pkg_delete: unable to completely remove directory '/usr/local/lib/python2.7'
pkg_delete: couldn't entirely delete package `python27-2.7.5_1'
(perhaps the packing list is incorrectly specified?)
```
with the addition of 

```
pkg_delete: unable to completely remove directory '/usr/local/include/python2.7'
```
which is basically the same but contains no reference to libyam1 or any other port that may be causing this issue.

Is it possible to force removal without wrecking the system, or is there another solution?


----------



## kpa (Jun 30, 2013)

This is not a real error but a side effect of removing the lang/python27 package before the site-packages directory has been emptied of files that are not tracked by any package.


----------



## Driftwood (Jun 30, 2013)

Ah that would explain why after manually removing the directories I don't get those errors, thank you for that.

I am however still getting the following error when trying to install gobject-introspection:


```
Software# make install clean
===>  Building for gobject-introspection-1.34.2
gmake  all-recursive
gmake[1]: Entering directory `/usr/ports/devel/gobject-introspection/work/gobject-introspection-1.34.2'
Making all in .
gmake[2]: Entering directory `/usr/ports/devel/gobject-introspection/work/gobject-introspection-1.34.2'
  CC     _giscanner_la-giscannermodule.lo
In file included from /usr/local/include/glib-2.0/glib/deprecated/gthread.h:124,
                 from /usr/local/include/glib-2.0/glib.h:108,
                 from giscanner/sourcescanner.h:26,
                 from giscanner/giscannermodule.c:26:
/usr/local/include/pth/pthread.h:285: error: conflicting types for 'pthread_t'
/usr/include/sys/_pthreadtypes.h:65: error: previous declaration of 'pthread_t' was here
/usr/local/include/pth/pthread.h:286: error: conflicting types for 'pthread_attr_t'
/usr/include/sys/_pthreadtypes.h:68: error: previous declaration of 'pthread_attr_t' was here
/usr/local/include/pth/pthread.h:288: error: conflicting types for 'pthread_once_t'
/usr/include/sys/_pthreadtypes.h:74: error: previous declaration of 'pthread_once_t' was here
/usr/local/include/pth/pthread.h:289: error: conflicting types for 'pthread_mutexattr_t'
/usr/include/sys/_pthreadtypes.h:70: error: previous declaration of 'pthread_mutexattr_t' was here
/usr/local/include/pth/pthread.h:290: error: conflicting types for 'pthread_mutex_t'
/usr/include/sys/_pthreadtypes.h:69: error: previous declaration of 'pthread_mutex_t' was here
/usr/local/include/pth/pthread.h:291: error: conflicting types for 'pthread_condattr_t'
/usr/include/sys/_pthreadtypes.h:72: error: previous declaration of 'pthread_condattr_t' was here
/usr/local/include/pth/pthread.h:292: error: conflicting types for 'pthread_cond_t'
/usr/include/sys/_pthreadtypes.h:71: error: previous declaration of 'pthread_cond_t' was here
/usr/local/include/pth/pthread.h:293: error: conflicting types for 'pthread_rwlockattr_t'
/usr/include/sys/_pthreadtypes.h:76: error: previous declaration of 'pthread_rwlockattr_t' was here
/usr/local/include/pth/pthread.h:294: error: conflicting types for 'pthread_rwlock_t'
/usr/include/sys/_pthreadtypes.h:75: error: previous declaration of 'pthread_rwlock_t' was here
/usr/local/include/pth/pthread.h:357: error: conflicting types for 'pthread_kill'
/usr/include/signal.h:75: error: previous declaration of 'pthread_kill' was here
gmake[2]: *** [_giscanner_la-giscannermodule.lo] Error 1
gmake[2]: Leaving directory `/usr/ports/devel/gobject-introspection/work/gobject-introspection-1.34.2'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/ports/devel/gobject-introspection/work/gobject-introspection-1.34.2'
gmake: *** [all] Error 2
*** Error code 1

Stop in /usr/ports/devel/gobject-introspection.
```

Any help would be much appreciated.


----------



## jozze (Jun 30, 2013)

Hi!

This can happen because of different things. For starters, let's rule out some more common errors, or at least fix them, if they are indeed the reason.


 If you're running FreeBSD 10-CURRENT you may be out of luck. Tell us which FreeBSD version you're using.
 Show your /etc/make.conf, if you did some configuration there.
 Make sure your ports tree is up to date (you can bring it up to date with `# portsnap fetch update`).
 Upgrade your ports as well, check /usr/ports/UPDATING before upgrading any of them, this file may warn you if any of the ports' upgrade requires special treatment. To see which ports require upgrading, you can use `# pkg_version -v | grep -v =`, or, if you use PKGNG, `# pkg version -v | grep -v =`. If you don't know what PKGNG is, don't install it, just use the first command.

 If you used ports-mgmt/portmaster or ports-mgmt/portupgrade to do the upgrade of your ports, you're in for a treat, since my next suggestion is to (re)build the port along with all dependencies. Try `# portmaster -Rf /usr/ports/devel/gobject-introspection`, or (if you use portupgrade) `# portupgrade -RNcf devel/gobject-instrospection`.
For the portupgrade command I'm not so sure, and I suspect it will try just to install missing dependencies, so go with portmaster on this one.

I hope some of these suggestions will be helpful. If not, tell us what's still wrong.


----------



## wblock@ (Jun 30, 2013)

Careful, the portupgrade and portmaster options are not all the same.  -R and -r both mean different things to both programs.

But the error in post #3--isn't that the old "must rebuild Python with the threads option the opposite of what it is now" problem?


----------



## jozze (Jun 30, 2013)

You're right; and I'm not very experienced in portmaster, but won't this command do the same thing in this case? I checked the portmaster(8)() page, and maybe I didn't understand it correctly.


----------



## wblock@ (Jun 30, 2013)

In portupgrade, -R means "every port that this one depends on".

portmaster does not do that.  It checks that the ports the current one depends on are the latest versions, but there's no way to force it to rebuild them.  -R is an option to skip rebuilding ports that have already been rebuilt.

I think the portmaster command in post #4 will just rebuild devel/gobject-introspection and, by default, anything that depends on it that portmaster thinks needs to be rebuilt.

The portupgrade command will force a rebuild of everything that devel/gobject-introspection depends on, and then rebuild devel/gobject-introspection itself.


----------



## DutchDaemon (Jun 30, 2013)

I'm pretty sure `portmaster -f` rebuilds a port _and_ the ports it depends on, whether they're up to date or not. Without the -f, portmaster will (indeed) just rebuild the port.


----------



## wblock@ (Jul 1, 2013)

That's right.  I was so distracted by the -R that I didn't think about the -f.


----------



## EW1 (Jul 5, 2013)

wblock@ said:
			
		

> Careful, the portupgrade and portmaster options are not all the same.  -R and -r both mean different things to both programs.
> 
> But the error in post #3--isn't that the old "must rebuild Python with the threads option the opposite of what it is now" problem?



Having hit that bump in the road recently (as in the last 12 hours), I suspect your observation is correct.

Driftwood, try rebuilding Python without GNU threads (pth) in the configuration dialog, then building gobject-introspection.


----------

