关于 .NET Core SDK 3.1在鲲鹏上的安装部署
.NET Core SDK为.NET Core提供最基础的开发支持。
1.替换/usr/lib64目录下的libstdc++.so.6,默认的libstdc++.so.6包含的GLIBC版本无法满足.NET Core SDK 3.1的运行:
strings /usr/lib64/libstdc++.so.6 | grep GLIBC #通过命令验证GLIBC的版本
cd /usr/lib64
cp libstdc++.so.6 libstdc++.so.6.old
rm -f libstdc++.so.6
wget https://obs-mirror-ftp4.obs.cn-north-4.myhuaweicloud.com/libstdc%2B%2B.so.6
2.下载.NET Core SDK 3.1包并解压
wget https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.201-linux-arm64-binaries
mkdir -p /opt/dotnet
tar -zxvf dotnet-sdk-3.1.201-linux-arm64.tar.gz -C /opt/dotnet
#配置环境变量
vim /etc/profile
#在文件的最后加上如下内容
export DOTNET_ROOT=/opt/dotnet
export PATH=$PATH:/opt/dotnet
#wq退出保存
source /etc/profile
#运行dotnet --info命令会报错,提示缺少ICU
dotnet --info
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
at System.Environment.FailFast(System.String)
at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
at System.Globalization.GlobalizationMode..cctor()
at System.Globalization.CultureData.CreateCultureWithInvariantData()
at System.Globalization.CultureData.get_Invariant()
at System.Globalization.CultureInfo..cctor()
at System.String.ToLowerInvariant()
at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetArch()
at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment..cctor()
at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier()
at Microsoft.DotNet.Cli.MulticoreJitProfilePathCalculator.CalculateProfileRootPath()
at Microsoft.DotNet.Cli.MulticoreJitActivator.StartCliProfileOptimization()
at Microsoft.DotNet.Cli.MulticoreJitActivator.TryActivateMulticoreJit()
at Microsoft.DotNet.Cli.Program.Main(System.String[])
Aborted (core dumped)
3.安装配置ICU
wget https://github.com/unicode-org/icu/releases/download/release-59-2/icu4c-59_2-src.tgz
tar -xzvf icu4c-59_2-src.tgz
cd icu/source
./configure --prefix=/usr/local/icu
make -j4
make install
#配置环境变量
vim /etc/profile
#在文件的最后加上如下内容
export PATH=$PATH:/usr/local/icu/bin
#创建软链接
ln -s /usr/local/icu/lib/libicutu.so.59 /lib64/
ln -s /usr/local/icu/lib/libicui18n.so.59 /lib64/
ln -s /usr/local/icu/lib/libicuuc.so.59 /lib64/
ln -s /usr/local/icu/lib/libicudata.so.59 /lib64/
icu-config --version #查看ICU版本
icuinfo #验证是否安装成功
dotnet --info #显示如下信息代表安装成功
.NET Core SDK (reflecting any global.json):
Version: 3.1.201
Commit: b1768b4ae7
Runtime Environment:
OS Name: centos
OS Version: 7
OS Platform: Linux
RID: linux-arm64
Base Path: /opt/dotnet/sdk/3.1.201/
Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8
.NET Core SDKs installed:
3.1.201 [/opt/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.3 [/opt/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.3 [/opt/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
- 点赞
- 收藏
- 关注作者
评论(0)