Install Old and Deprecated Ports on FreeBSD - 2024-02-01
The problem
One of my client runs an old database. How old? It’s MySQL 5.7.
That is a problem because MySQL 5.7 has been end of life since October 2023 and the FreeBSD port has been removed on 2023-12-31.
But we need a test system. Something that looks and feels like the production system. And we need to find a way to install MySQL 5.7.
The solution
Turns out you can download an old version of the ports tree and start there. There is no guarantee it will work but it is a start.
The FreeBSD ports are hosted on multiple platforms. You can choose whatever you like most.
The name of the port I’m using in this example is mysql57-server
.
- Search for your port on freshports
- Open the last commit which removed the port. It’s probably the first entry on freshports. (cgit, Codeberg, GitLab, GitHub)
- Go to parent commit where the port has not been removed yet (cgit, Codeberg, GitLab, GitHub)
- On cgit you can now download a
.tar.gz
or.zip
of the parent commit. On the other platforms, you need to click on “Browser files” or “Browse source” before you can download the source. - Extract the archive
- Move to the right directory:
cd databases/mysql57-server
- Compile and install it:
ALLOW_UNSUPPORTED_SYSTEM="YES"; BATCH="YES"; make install clean
ALLOW_UNSUPPORTED_SYSTEM
let’s you install the port on a different system than
it was planned to be installed on.
BATCH
uses the default values for every prompt that might come up while
installing a port.
Now you just need to wait for the port and all of its dependencies to be compiled.
Update from 2024-04-23:
I was made aware about a couple of fixes to make mysql57-server
compile on 14.0:
- Replace
-DWITH_EDITLINE=system
with-DWITH_EDITLINE=bundled
inMakefile
- Install openssl (
pkg install openssl
) - Set default to openssl in make.conf (
echo "DEFAULT_VERSIONS+=ssl=openssl" >> /etc/make.conf
)
Thank you Chr. Schmidt!