Darwin Ports could not open file

Today I ran into some trouble with Darwin Ports:

Error: Target com.apple.checksum returned: Could not open file: / 
opt/local/var/db/dports/distfiles/mysql5/mysql-5.0.19.tar.gz
Error: /opt/local/bin/port: Status 1 encountered during processing.

Ports was trying to delete an old file that no longer exists.

Running sudo port sync fixed this.

Another problem I got was the following error:

Error: Target com.apple.destroot returned: invalid command name "delete" 

This could be solved by running: sudo port -d selfupdate

admin