Skip to content

Instantly share code, notes, and snippets.

@Sunlighter
Last active November 12, 2022 11:21
Show Gist options
  • Save Sunlighter/fe602d2a090e64a01c3369fe7d7d7325 to your computer and use it in GitHub Desktop.
Save Sunlighter/fe602d2a090e64a01c3369fe7d7d7325 to your computer and use it in GitHub Desktop.
Installing .NET 5 in Amazon Linux 2 for ARM

Installing .NET 5 in Amazon Linux 2 for ARM64

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.

  1. 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.)

  2. 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
  1. Uncompress it into its own directory.
mkdir dotnet5
cd dotnet5
tar -xzf ../dotnet-sdk-5.0.100-linux-arm64.tar.gz
  1. 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
  1. 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
  1. You need the C++ compiler in order to build the ICU library.
sudo yum install gcc-c++
  1. 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
  1. 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
  1. 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
  1. 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, with dotnet --fsi. (Use exit 0 ;; to exit F#.)
@abarberenaCPDS
Copy link

Never mind, I believe my scenario is different than yours, I am using Centos 7 ARM64

http://isoredirect.centos.org/altarch/7/isos/aarch64/

Linux centospi 5.4.72-v8.1.el7 #1 SMP PREEMPT Wed Oct 21 17:35:36 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

@jamilbk
Copy link

jamilbk commented Jan 28, 2022

Thanks for this!

@twbraam
Copy link

twbraam commented Aug 1, 2022

Thank you very much for sharing the detailed steps I have installed libicu60 package to solve the "Error: /lib64/libicui18n.so.50: undefined symbol: ucol_setMaxVariable_50"

sudo yum install libicu60
dotnet --version
5.0.400

This worked for me as well. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment