Can't update MacPorts after upgrading to Mavericks I ran port selfupdate and MacPorts tried to upgrade itself to version 2.2.1, but eventually fails. When I add the -v flag, I can see the build fails after these lines:

checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions
Command failed: cd     /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base &amp;&amp; CC=/usr/bin/cc OBJC=/usr/bin/cc ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline &amp;&amp; make SELFUPDATING=1 &amp;&amp; make install SELFUPDATING=1
Exit code: 1


How can I get MacPorts back?
You need to update the command line tools Xcode installs. For whatever reason, Xcode doesn't seem to want to update them itself, but you can force it by running xcode-select --install. This will pop open a GUI prompt; select "Install" and let the installer do its thing. After this, MacPorts should build itself successfully. (You may need to rehash first; rehash in tcsh, hash -r in bash and zsh (I think).)