217 | | === When uninstalling a port I get an error like `port uninstall failed: invalid command name "portuninstall::uninstall"`. What's going on? === |
218 | | |
219 | | This is a known error caused by left overs from old MacPorts installations, specifically the `${prefix}/share/darwinports/Tcl/port1.0/portuninstall.tcl` file that is no longer in the MacPorts source code (`${prefix}` expanding to whatever path was chosen upon initial installation of MacPorts, `/opt/local` by default). |
220 | | However, a reinstallation of the infrastructure (most commonly through `port selfudpate`) does not remove this file and therefore manual intervention is needed: |
221 | | |
222 | | {{{ |
223 | | rm -f ${prefix}/share/darwinports/Tcl/port1.0/portuninstall.tcl |
224 | | port -f selfupdate |
225 | | }}} |
226 | | |
227 | | These steps will remove the stray file and force a rebuild of the infrastructure, overriding the release number comparison done by "selfupdate" between the local copy and the one on the MacPorts rsync server. |
228 | | If this workaround does not clear the problem for you, please refer to the [http://lists.macosforge.org/mailman/listinfo/macports-users users mailing list] with as much information as possible. |
229 | | |
230 | | Be sure you have the latest MacPorts before removing `portuninstall.tcl`. I had the same problem that I couldn't uninstall ports and so I first ran a `sudo port selfupdate` to get the latest version of MacPorts and removed the tcl file afterwards. But when running `sudo port -f selfupdate` it gave me this error message: `Failed to initialize ports system, couldn't read file "/opt/local/share/darwinports/Tcl/port1.0/portuninstall.tcl": no such file or directory` and stopped working. |
231 | | |