This is a way to install .NET 5 in your home directory without modifying the system.
At the time of this writing, Amazon Linux 2 for ARM64 almost works already, but there is a problem with the ICU library. I will show this problem and how to fix it.
-
Start Amazon Linux 2 and sign in. (I recommend an m6g.medium instance for this, although smaller ones may work. Bigger ARM instances will definitely work, but cost more per unit time.)
-
Get the .NET 5 tarball. (Unfortunately the URL is kinda long!)
wget https://download.visualstudio.microsoft.com/download/pr/27840e8b-d61c-472d-8e11-c16784d40091/ae9780ccda4499405cf6f0924f6f036a/dotnet-sdk-5.0.100-linux-arm64.tar.gz
- Uncompress it into its own directory.
mkdir dotnet5
cd dotnet5
tar -xzf ../dotnet-sdk-5.0.100-linux-arm64.tar.gz
- You can run
./dotnet --version
at this time, but you will get this error:
Cannot get symbol ucol_setMaxVariable_50 from libicui18n
Error: /lib64/libicui18n.so.50: undefined symbol: ucol_setMaxVariable_50
Aborted
- To fix this, you have to download the latest ICU library:
cd
wget https://github.com/unicode-org/icu/releases/download/release-68-1/icu4c-68_1-src.tgz
mkdir icubuild
cd icubuild
tar -xzf ../icu4c-68_1-src.tgz
cd icu/source
- You need the C++ compiler in order to build the ICU library.
sudo yum install gcc-c++
- Now you can configure, make, and make install. If you chose an instance
type with multiple CPUs, you can speed this part up by passing the
-j
option to make.
mkdir ~/libicu
./configure --prefix=/home/ec2-user/libicu
make
make install
cd
- Edit your
.bash_profile
and add the following (you may want to alter this a little depending on your particular setup):
PATH=$PATH:$HOME/dotnet5
export PATH
DOTNET_ROOT=$HOME/dotnet5
export DOTNET_ROOT
LD_LIBRARY_PATH=$HOME/libicu/lib
export LD_LIBRARY_PATH
- Here are some optional cleanup steps:
rm dotnet-sdk-5.0.100-linux-arm64.tar.gz
rm icu4c-68_1-src.tgz
rm -rf icubuild
- Log out and log in again. You should be able to run
dotnet --version
and it should work. You should also be able to play with the F# interpreter, if you want, withdotnet --fsi
. (Useexit 0 ;;
to exit F#.)
It worked, thank you.