Installing .NET 11.0 on Ubuntu proot-distro with Termux on Android
.NET 11.0 is a new version of the modern .NET framework that brings several improvements across different areas of the software development kit, including runtime improvements, new APIs in .NET libraries (like richer JSON and union types), and many more improvements.
Normally, any .NET applications that are built for a specific platform can be run normally, such as Android applications made with MAUI. However, what if you’ve planned to run a CLI .NET application on Android? Or an application for computers? Termux can provide you with a solution.
Recent improvements to Termux involved changing how proot-distro downloads the distribution containers so that it utilizes Docker Hub to download the necessary assets and configure them to be usable. Follow the below steps to install .NET 11.0 with Ubuntu proot-distro.
- Install Termux from F-Droid.
- For Samsung devices, you might want to turn off the Auto Blocker feature so that you can install it. You can also use the Play Store version, but we haven’t tested it yet, and your mileage may vary.
- Open Termux, and let it configure itself. After that, upgrade all packages using
pkg upgrade.- If you’re prompted to choose whether to keep your own changes or to install the package-supplied version, just press ENTER on your phone’s keyboard.
- Once all necessary upgrades are complete, you can now install the proot-distro program using
pkg install proot-distro. - Afterwards, install the Ubuntu 26.10 Docker container with
proot-distro install ubuntu:26.10.- It might take a while, depending on your internet connection.
- Now, you can login to the container with
proot-distro login ubuntu. - Before installing any packages in the Ubuntu proot environment, you’ll have to check to see if there are any package updates with
apt update.- If there are any, run
apt dist-upgradeto upgrade all packages.
- If there are any, run
- Install .NET SDK 11.0 or .NET Runtime 11.0, depending on your use case.
- If you want to build .NET applications, install the SDK using
apt install dotnet-sdk-11.0. - If you want to just run .NET applications, install the runtime using
apt install dotnet-runtime-11.0.
- If you want to build .NET applications, install the SDK using
- If you’ve installed the SDK, verify that the application actually builds.
- Create a new directory, such as test (
mkdir test), and change the current directory to it (cd test) - Create a new .NET console project with
dotnet new console --use-program-main. - Verify that it actually builds using
dotnet run.
- Create a new directory, such as test (
However, as of now, you may be running into an issue where the building stage of any application may fail with error messages that are similar to this:
GC heap initialization failed with error 0x8007000E Failed to create CoreCLR, HRESULT: 0x8007000E In this case, you’ll have to add an environment variable that changes the GC heap hard limit value to an acceptable value so that you can build and run applications on Android devices. In order to do this temporarily, append the environment variable before the command, such as this:
$ DOTNET_GCHeapHardLimit=1C0000000 dotnet build If this works, you can add a line that exports this environment variable to your ~/.profile like this:
$ echo "export DOTNET_GCHeapHardLimit=1C0000000" >> ~/.profile $ . ~/.profile Once done, exit and re-enter your proot environment, and you should be able to build and run .NET applications.
Please note that .NET 11.0 is not available on Ubuntu 26.04 LTS official repositories yet.
#NET #2604 #2604LTS #Android #C #csharp #dotnet #news #oneUi #Proot #ProotDistro #Samsung #smartphone #Tech #Technology #Termux #Ubuntu #Ubuntu2604 #Ubuntu2604LTS #Ubuntu2604LTSResolute #Ubuntu2604LTSResoluteRaccoon #Ubuntu2604Resolute #Ubuntu2604ResoluteRaccoon #ubuntuProot #update