Skip to content

Instantly share code, notes, and snippets.

@rnelson
Last active November 4, 2023 15:11
Show Gist options
  • Save rnelson/1bc88584dd2e6af1814e7952cef1ab9e to your computer and use it in GitHub Desktop.
Save rnelson/1bc88584dd2e6af1814e7952cef1ab9e to your computer and use it in GitHub Desktop.
.NET 7 on FreeBSD 13.2

.NET 7 on FreeBSD 13.2

After getting it up and running, I sent a quick toot about having .NET 7 running on my FreeBSD VM. It got a lot of boosts and favorites.

To make the process easier for others and to make sure credit is given where due, I decided to make this little gist.

Credits

I did nothing here but find the right bits of instructions and follow them. It looks like Thefrank and sec are the driving forces behind getting .NET working on FreeBSD. More information is on the FreeBSD wiki's .NET page.

Prerequisites

  1. Install dependencies: # pkg install --yes libunwind icu libinotify krb5 openssl terminfo-db
  2. Create the necessary directories: # mkdir -p /usr/share/dotnet /var/cache/nuget

Set the permissions on those directories as you see fit.

Instructions

  1. Download the sdk .tar.gz and all of the .nupkg files from the latest release. At time of writing, that is 7.0.403-x64-native
  2. Extract the SDK: # tar xf dotnet-sdk-7.0.403-freebsd-x64.tar.gz -C /usr/share/dotnet/
  3. Move the NuGet packages to the cache: # mv *.nupkg /var/cache/nuget
  4. Create a symlink for ease of use: # ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet

Congrats, you now have a working .NET install!

rnelson@reject:/home/rnelson $ dotnet --list-sdks
7.0.403 [/usr/share/dotnet/sdk]
rnelson@reject:/home/rnelson $ dotnet --list-runtimes
Microsoft.AspNetCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
rnelson@reject:/home/rnelson $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment