Funny, this used to work. Since I don’t know OpenBSD very well, I had
to figure out what was going on.

According to the man page, the pkg_add command is configured via the
environment variable, PKG_PATH, which on my system looked like this:
http://ftp.openbsd.org/pub/OpenBSD/5.6/packages/amd64/. I browsed the server,
http://ftp.openbsd.org/pub/OpenBSD/, and, sure enough, the directory named “5.6”
was gone.

I know that OpenBSD only supports the current version and the one
previous (5.8 is the current release on the day I write this). What I
didn’t know was that the official repository would remove the old
files from the FTP server. Lesson learned.

My next question was, are there any mirrors that keep old packages?
Turns out the answer is yes. Reading the documentation on
the OpenBSD download page I saw this phrase at the end,

“Depending on the disk space available, mirrors may provide more contents, such
as older releases, current source tree, etc.”

If you’re running an unsupported version of OpenBSD, my first piece of
advice is to upgrade if you can. If you can’t, or if now isn’t a good
time, then you can surf the mirrors and find one that keeps older
versions around.

Here are a couple of mirror servers that I found which contain older
versions of OpenBSD. Please verify them yourself before you blindly
use them.

I wrote this blog post because when I tried searching the Internets for what was
going wrong, I didn’t find anything. Maybe this will save you a few minutes.
If you follow these instructions and they don’t work, please don’t spam the
OpenBSD mailing lists. That’s what the “unsupported” part of “unsupported
release” means.

Now, go upgrade your system. ;)

Further Reading

Here are some pointers to OpenBSD documentation about packaging and pkg_add.