Downgrading ports


by ross at 07:56:21 on December 20, 2015

I use net/minidlna on the home server to watch films over WiFi on my TV. The latest version doesn't work well so I use it to show how to downgrade a port to any previous version.

We will use portdowngrade utility to downgrade ports:

> cd /usr/ports/ports-mgmt/portdowngrade
> sudo make install clean

Let's see..

> pkg query %n-%v minidlna

OK, we have version 1.1.5,1 installed.

> sudo service minidlna stop
> sudo pkg remove minidlna

Now we need a revision number to downgrade to:

> portdowngrade net/minidlna | less
Choose a revision from this list and run /usr/local/sbin/portdowngrade net/minidlna revision
r403959 | madpilot | 2015-12-18 12:23:49 +0200 (Fri, 18 Dec 2015) | 6 lines

Update to 1.1.5

PR:             205389
Submitted by:   me
Approved by:    wg (maintainer)

r397778 | bapt | 2015-09-25 01:41:13 +0300 (Fri, 25 Sep 2015) | 2 lines

Convert to @sample

r390310 | antoine | 2015-06-22 21:33:20 +0300 (Mon, 22 Jun 2015) | 2 lines

Convert to USES=jpeg

... output skipped ...

We've got a list of revisions in reverse order. Here we can see that r403959 is when the port switched to version 1.1.5. So we need the revision before that which is r397778.

> portdowngrade net/minidlna r397778
A    minidlna/files
A    minidlna/pkg-plist
A    minidlna/Makefile
A    minidlna/distinfo
A    minidlna/files/extra-patch-kqueue
A    minidlna/files/patch-minidlna.conf
A    minidlna/files/patch-minissdp.c
A    minidlna/files/patch-upnpsoap.c
A    minidlna/files/
A    minidlna/files/patch-getifaddr.c
A    minidlna/files/patch-utils.c-mpo
A    minidlna/files/
A    minidlna/files/patch-upnpreplyparse.c
A    minidlna/pkg-descr
Checked out revision 397778.
You should be done-- now cd into minidlna and you can run
# make deinstall install clean

Please note that portdowngrade no longer modifies the ports tree; the
checked out port is at

The utility has created minidlna directory in my home with that revision.

Let's build and install it:

> cd ~/minidlna
> make build
> sudo make install

The last step is to lock the package so it won't get updated on next "pkg upgrade" or "portupgrade -a":

> sudo pkg lock minidlna

Remeber to clear the application files before starting it (as the format of the files sometimes changes with new version):

> sudo rm -rf /var/db/minidlna
> sudo service minidlna start