Solve the "glibcxx_3.4.21 not found" Error in .NET: 6 Effective Steps
The error message you're encountering suggests that the version of `libstdc++.so.6` required by `./dotnet` is not available on your system. Specifically, it's looking for the `glibcxx_3.4.21` version. Here’s how you can resolve this issue: 1. Update Your System First, ensure that your system is up-to-date. This might include updating packages and libraries. ```bash sudo apt update sudo apt upgrade ``` 2. Install the Required Libraries If the above steps don't help, you may need to install the specific version of `libstdc++`. You can do this by installing the `libstdc++6` package. ```bash sudo apt install libstdc++6 ``` 3. Verify the Installed Version After installation, verify the installed version of `libstdc++`. ```bash ldd ./dotnet | grep libstdc++ ``` This will show you which version of `libstdc++` is being used by `./dotnet`. 4. Install Development Libraries Sometimes, you might need the development libraries as well. ```bash sudo apt install libstdc++-7-dev ``` Replace `7` with the appropriate version number if necessary. 5. Symbolic Linking If the library version is still not compatible, you might need to create a symbolic link to point to the correct library version. Find the path of the correct library version: ```bash locate libstdc++.so.6 ``` Then create a symbolic link: ```bash sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ``` Replace `/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25` with the actual path of the correct version. 6. Reinstall .NET SDK As a last resort, you can try reinstalling the .NET SDK. Uninstall the current .NET SDK: ```bash sudo rm -rf /usr/share/dotnet sudo rm /usr/bin/dotnet ``` Download and install the latest .NET SDK: ```bash wget https://download.visualstudio.microsoft.com/download/pr/38979f5c-52b8-46a6-b65f-488772d59e3c/89550532b465661b595b355d3083007f/runtime-7.0.0.tar.gz tar -xzf runtime-7.0.0.tar.gz sudo mv dotnet /usr/share sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet ``` Replace the URL and tarball name with the latest release from the .NET website. By following these steps, you should be able to resolve the `glibcxx_3.4.21` not found error. ######[AI写代码神器 | 670点数解答 | 2024-08-30 10:24:47]
- Free Pascal瑞士轮AC代码:适配fpc 3.0.4的qsort与循环变量修复方案(阿里通义 | 1396点数解答 | 2026-03-20 12:31:01)9
- Free Pascal 3.0.4 下瑞士轮排序的终极 AC 解决方案:qsort 显式声明与循环变量隔离(阿里通义 | 1216点数解答 | 2026-03-20 12:32:11)9
- C语言实现:在N个整数中查找指定整数X的位置(字节豆包 | 205点数解答 | 2025-11-28 00:04:50)37
- C++类实现一元二次方程多种解情况判断及求解,附特殊情况处理与精度控制(字节豆包 | 481点数解答 | 2025-03-07 12:49:26)200
- 解决 make tini-static 时链接器 ld 找不到 -lc 错误的方法(阿里通义 | 264点数解答 | 2025-05-24 02:02:15)222
- 解决“/usr/bin/ld: cannot find -lc”错误,成功构建tini-static的七大方案(讯飞星火 | 571点数解答 | 2025-05-24 02:03:08)221
- 解决 “./dotnet: /lib64/libstdc++.so.6: version `glibcxx_3.4.21' not found” 错误的三种有效方法(字节豆包 | 208点数解答 | 2024-08-30 10:24:18)192
- Solve the "glibcxx_3.4.21 not found" Error in .NET: 6 Effective Steps(阿里通义 | 670点数解答 | 2024-08-30 10:24:47)245
- 解决 “./dotnet: /lib64/libstdc++.so.6: version `glibcxx_3.4.21' not found” 错误的四种方法(阿里通义 | 485点数解答 | 2024-08-30 10:24:50)368
- 解决 /usr/share/dotnet/dotnet 提示缺少 libstdc++.so.6 库问题的方法(讯飞星火 | 307点数解答 | 2024-08-30 10:35:07)226
- Free Pascal qsort 正确声明指南:解决 “Type identifier expected” 编译错误(阿里通义 | 1227点数解答 | 2026-03-20 12:33:58)7
- C语言实现:从N个整数中查找指定整数X的位置及代码解析(字节豆包 | 204点数解答 | 2025-11-28 00:13:01)50