background

A certain project needs to realize the localization of all the basic software, in which the operating system is designated As Yinhe Kirin, which is a Linux release, and the database uses Tameng V8. Many concepts of this database are similar to Oracle, and the RANGE of CPU platform is Longson, Feiteng, Kunpeng, etc.

Loongson team supports netcore3.1, feiteng and other ARM architectures, which have been officially supported. .Netcore 3.1 supports package manager installation only on X64 architectures; for other architectures, such as ARM,.net must be installed in some other way.

Using the ARM architecture as an example, the installation process for other CPU platforms is the same, with different packages to download.

The environment

  • Host OS: Windows 10
  • Virtualization tool: QEMU
  • Vm CPU: Cortex-A53 (ARMv8 architecture, Arm64 support)
  • The VM OS is Galaxy Kirin V4

download

The official download address for.net Core 3.1 is dotnet.microsoft.com/en-us/downl…

Download the Arm64 version of Linux because the ARMv8 architecture CPU is chosen here. If it is an X64 architecture, choose X64.

If the godson CPU, please go to the godson’s official website to download: www.loongnix.cn/index.php/D…

How do I upload to the server?

If the file is downloaded to a local PC, you can upload it to the server using SFTP. If you want to download it on the server, you can use the wget command to download it directly.

The installation

X64, Arm processor

Go to the installation directory, I have downloaded to the current user’s root directory, so:

cd ~
Copy the code

Run the following command to decompress the installation package to the dotnet folder in the current user root directory (the directory can be changed) :

mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-3.1.416-linux-arm64.tar.gz -C $HOME/dotnet
Copy the code

Note: the name of the installation package is different for different platforms. Change it to the one you downloaded, for example, dotnet-SDK-3.1.416-linux-x64.tar.gz for x64.

You also need to export dotnet to the environment variable PATH, edit the file /etc/profile, and add the following two lines at the end:

export PATH=$PATH:$HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
Copy the code

Then run the source /etc/profile command for the configuration to take effect.

To check whether dotnet is successfully installed, run the dotnet -info command. Normally, the following information is displayed:

MIPS, Loongson processor

Since there is no Loongson processor, this is only a matter of discussion, because galaxy Qylin is a Debian system, so download the deb package, direct command to install it.

Sudo apt the/dotnet - SDK - 3.1.11 - rc1_loongarch64. DebCopy the code

Once the installation is complete, see the result via dotnet-info as well.

Other dependencies

If you rely on system.drawing.mon, you need libgdiPlus 6.0.1 or higher, which is provided by Mono. If your CPU platform is ARM64 or X64, you can download this package from the link below and upload it to your server to install it:

Link: pan.baidu.com/s/1WYIbxqh8…

The X64 platform is installed like this:

Sudo apt install./libgif7_5.1.4-0.3~16.04.1_amd64.deb sudo apt install . / libgdiplus_6. 0.5-0 xamarin1 + ubuntu1604b1_amd64. DebCopy the code

Arm64 platform:

Sudo apt install./libgif7_5.1.4-0.3~16.04.1_arm64.deb sudo apt install . / libgdiplus_6. 0.5-0 xamarin1 + ubuntu1604b1_arm64. DebCopy the code

If you’re on another CPU platform, check out this article from the Mono Project:

www.mono-project.com/download/st…

In response to this problem, the authorities in. The system.drawing.mon cross-platform property has been dropped in NET6, and it may be better to use another Graphics library instead, such as SkiaSharp, Microsoft.maui.Graphics, ImageSharp.

test

Execute the following commands in sequence: create a directory, dotnetsample, then create a Web project, and finally run the project.

cd ~
mkdir dotnetsample
cd ./dotnetsample
dotnet new web
dotnet run --urls=http:/ / * : 5000
Copy the code

The following information is displayed:

If you get to this point, congratulations, the installation is successful!

For more architecture knowledge, please pay attention to the wechat public account Firefly architecture. Original content, reproduced please indicate the source.