FreeBSD port downgrade with ports-mgmt/portdowngrade utility

By | November 20, 2015

WARNING: Its really important you do not run portdowngrade from within the /usr/ports directory. Doing so really fucked up my server and I needed to delete all ports and reinstall into them from a list I had available.

First install ports-mgmt/portdowngrade and rehash to update cache
Then OUTSIDE OF THE PORTS TREE (cd ~ is a good start) perform the following command

portdowngrade dns/p5-Net-DNS

This will provide you with a list of revisions. Take a copy of the revision number and use that in the final command.

portdowngrade dns/p5-Net-DNS r397160

In my case i needed to downgrade p5-Net-DNS from 1.03 to 1.02 due to a incompatible change with SpamAssassin.

The output of the command will tell you want you need to do next…

# portdowngrade dns/p5-Net-DNS r397160
A p5-Net-DNS/Makefile
A p5-Net-DNS/distinfo
A p5-Net-DNS/pkg-plist
A p5-Net-DNS/pkg-descr
Checked out revision 397160.
You should be done-- now cd into p5-Net-DNS and you can run
# make deinstall install clean
Please note that portdowngrade no longer modifies the ports tree; the
checked out port is at
/home/spectrum/p5-Net-DNS

Having been already bitten earlier in the day I took the more cautious approach and did the following :-

# cd /home/spectrum/p5-Net-DNS
# make
# make deinstall
# make install

resolved my problem in this case.
I then locked the port so I couldn’t accidentally do it again in future…

# pkg lock p5-Net-DNS