MacPorts Breaks After Trying to Remove Corrupt Archive
Posted by Tres Wed, 14 May 2008 00:51:00 GMT
I’m a big fan of package management systems for installing and managing everything on a *nix system. From portupgrade on FreeBSD to yum/RPM on RedHat, I use the package management system to install and maintain everything I possibly can.
On OS X, I’ve been using MacPorts back since they were Darwin Ports, and before that I was using Fink. MacPorts closely resembles portupgrade on FreeBSD.
MacPorts is generally excellent, especially because everything is tucked away in opt, so if I ever decide that I don’t want MacPorts around anymore, I have one place to go to get rid of everything.
Anyway, today was the first time I really had an issue with MacPorts. Trying to get Mysql5 installed on my laptop, I happened to download a corrupt tar archive.
sudo port install mysql5 ---> Fetching mysql5 ---> Attempting to fetch mysql-5.0.51.tar.gz from http://mysql.mirrors.pair.com/Downloads/MySQL-5.0/ ---> Attempting to fetch mysql-5.0.51.tar.gz from http://mysql.he.net/Downloads/MySQL-5.0/ ---> Verifying checksum(s) for mysql5 Error: Checksum (md5) mismatch for mysql-5.0.51.tar.gz Error: Checksum (sha1) mismatch for mysql-5.0.51.tar.gz Error: Checksum (rmd160) mismatch for mysql-5.0.51.tar.gz Error: Target org.macports.checksum returned: Unable to verify file checksums Error: Status 1 encountered during processing.
My response was to clean out the distfiles, like I would with FreeBSD. I thought I’d be nice and use the built-in port clean instead of just removing the downloaded file:
sudo port clean mysql5 ---> Cleaning mysql5
But that just made MacPorts angrier:
sudo port install mysql5 ---> Verifying checksum(s) for mysql5 Error: Target org.macports.checksum returned: Could not open file: /opt/local/var/macports/distfiles/mysql5/mysql-5.0.51a.tar.gz Error: Status 1 encountered during processing.
The key was to use the –all flag on the port clean command:
sudo port clean --all mysql5