Install a specific port version (revision) in FreeBSD using subversion

I find subversion more flexible and faster than portsnap. And in this article we will look at one of its abilities – update port to specific version (revision). If you are interested in subversion I already have an article about it: Install ports with svnlite

Note that the commands below suitable both for using with Subversion


and for using with Subversion Lite


But I will show by svnlite example.

Let’s define the port that we will use as an example. Let it be dwm. It is minimalistic window manager. It is placed in /usr/ports/x11-wm/dwm.

Now I have the latest version installed:

dwm -v

I delete this because I’m going to install another version:

sudo pkg delete dwm

The current revision of the port and the whole root can be checked with the following command:

svnlite info /usr/ports/x11-wm/dwm
Revision: 501227  (Root revision)
Last Changed Rev: 496110   (Port revision)
Last Changed Date: 2019-03-17  21:33:01  +0000  (Sun, 17 Mar 2019)

The list of port revisions in the repository can be viewed with the following command. It is started from the freshest to the oldest:

svnlite log /usr/ports/x11-wm/dwm | less
Revision number, last modified date, list of changes, author of revision
List of revisions and their description

We can scroll down and select the revision we want. Let’s take, for example, 475000 revision. To roll back the port to this revision exit log file and use the following command:

sudo svnlite update -r475000 /usr/ports/x11-wm/dwm
svnlite update -r475000 /usr/ports/x11-wm/dwm
Update port to a specific revision in FreeBSD

As we can see, the port has been updated back to our revision:

Updated to revision 475000
The port has been successfully updated to a specific version

Now go to the port directory and install it:

cd /usr/ports/x11-wm/dwm
sudo make install clean

Check the version of the package, make sure that it is now a different version:

dwm -v

Yes, I managed to roll back to the previous version of this program.

If you need to return the port to the latest revision use the following command:

sudo svnlite update /usr/ports/x11-wm/dwm

Otherwise, it will be updated the next time the local repository will updated:

sudo svnlite update /usr/ports