Remove deleted/corrupt package(s) from pkgutil index?
Hi,
I'm running ML on a system, and I get complains about an old installation of XQuartz, but this version, or actually any version of XQuartz doesn't exist on the system. I get this message from brew:
$ brew doctor
Warning: Your XQuartz (2.6.4) is outdated
Please install XQuartz 2.7.7:
https://xquartz.macosforge.org
However there are some traces of an old X11 package, digging a little with pkgutil etc. shows traces of a old package:
$ pkgutil --pkgs | egrep -i "x11|XQuartz"
org.x.x11.pkg
$ pkgutil --pkg-info org.x.x11.pkg
package-id: org.x.x11.pkg
version: (null)
volume: /
location: (null)
install-time: 1221163667
…but only "general" directories are left on the system, no files AFAICT:
$ for i in `pkgutil --files org.x.x11.pkg`;do ls -ld /$i 2>/dev/null; done
drwxrwxr-x+ 217 root admin 7378 Jan 10 01:47 /Applications
drwxrwxr-x+ 35 root admin 1190 Jan 14 11:13 /Applications/Utilities
drwxr-xr-x+ 4 root wheel 136 Jun 26 2014 /System
drwxr-xr-x 75 root wheel 2550 Jun 26 2014 /System/Library
drwxr-xr-x 148 root wheel 5032 Jan 5 19:10 /System/Library/LaunchAgents
drwxr-xr-x 239 root wheel 8126 Jan 6 23:17 /System/Library/LaunchDaemons
drwxr-xr-x@ 8 root wheel 272 Dec 19 14:35 /private
drwxr-xr-x 118 root wheel 4012 Jan 14 10:47 /private/etc
drwxr-xr-x 3 root wheel 102 Jan 14 11:13 /private/etc/manpaths.d
drwxr-xr-x 3 root wheel 102 Jan 14 11:13 /private/etc/paths.d
drwxr-xr-x@ 10 root wheel 340 Jan 14 11:22 /usr
drwxr-xr-x 1070 root wheel 36380 Jan 6 23:17 /usr/bin
drwxr-xr-x 281 root wheel 9554 Jan 14 11:33 /usr/include
drwxr-xr-x 314 root wheel 10676 Jan 14 11:33 /usr/lib
drwxr-xr-x 53 root wheel 1802 Dec 19 13:20 /usr/share
drwxr-xr-x 13 root wheel 442 Jan 10 03:15 /usr/share/man
drwxr-xr-x 1853 root wheel 63002 Jan 5 19:10 /usr/share/man/man1
And trying to delete it using pkgutil with force doesn't work:
$ pkgutil -vf --forget org.x.x11.pkg
Unknown error Error Domain=NSCocoaErrorDomain Code=4 "âorg.x.x11.pkg.bomâ couldnât be removed." UserInfo=0x7fde1bd981f0 {NSFilePath=/var/db/receipts/org.x.x11.pkg.bom, NSUserStringVariant=(
Remove
), NSUnderlyingError=0x7fde1bdbb380 "The operation couldnât be completed. No such file or directory"}.
Forgot package 'org.x.x11.pkg' on '/'.
$ ls /var/db/receipts/org.x.x11.pkg
ls: /var/db/receipts/org.x.x11.pkg: No such file or directory
Even thought that I applied -f (force), it's still not removed from pkgutil's db/index:
$ pkgutil --pkgs | egrep -i "x11|XQuartz"
org.x.x11.pkg
So, is there a way I fix/rebuild pkgutil's db/index?
Mac Pro, OS X Mountain Lion (10.8.5)