# How to Install .NET 9 on Ubuntu (Including Preview Releases)

### **Introduction**

.NET 9 is the latest iteration of Microsoft’s open-source development platform, packed with performance improvements, new C# features, and enhanced tools for cloud-native development. While it’s currently in preview, developers eager to experiment with its capabilities can install it on Ubuntu today. In this guide, we’ll walk through two straightforward methods to get .NET 9 up and running on your Ubuntu machine.

### **Why .NET 9?**

Before diving into installation, here’s why you might want to explore .NET 9:

*   **Performance boosts**: Optimized runtime and reduced memory usage.
    
*   **Cloud-native enhancements**: Better integration with Kubernetes and containerized apps.
    
*   **C# 13 features**: New language improvements for cleaner, more expressive code.
    

*Note*: .NET 9 is a **preview release**, so avoid using it in production environments.

### **Prerequisites**

1.  **Ubuntu 20.04, 22.04, or later** (check with `lsb_release -a`).
    
2.  **Terminal access** and `sudo` privileges.
    
3.  **Basic familiarity** with Linux package management.
    

## Method 1: Install .NET 9 via APT Repository

### STEP-1: Add Microsoft’s Package Feed

First, register Microsoft’s repository to access .NET packages:

```bash
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb  
sudo dpkg -i packages-microsoft-prod.deb  
rm packages-microsoft-prod.deb  
```

If you encounter issues, replace $(lsb\_release—rs) with your Ubuntu version (e.g., 22.04).

### STEP-2: Update Package Lists

Refresh your system’s package cache:

```bash
sudo apt-get update
```

### STEP-3: Install the .NET 9 SDK

Install the SDK with `apt` (preview packages may have a specific naming convention):

```bash
sudo apt-get install dotnet-sdk-9.0
```

### Verify the Installation

Confirm .NET 9 is installed correctly:

```bash
dotnet --info

# OR
# Version Check
dotnet --version
```

### **Troubleshooting Common Issues**

1.  **“Package not found” error**:
    
    *   Ensure you’ve added the correct Microsoft repository.
        
    *   Check for typos in the package name (e.g., `dotnet-sdk-9.0-preview`).
        
2.  **PATH issues**:
    
    *   Restart your terminal or run `source ~/.bashrc` after updating the PATH.
        
3.  **Preview instability**:
    
    *   Report bugs to the [.NET GitHub repo](https://github.com/dotnet/core/issues).
        

### Conclusion

You’re now ready to explore .NET 9 on Ubuntu! Whether you’re building microservices, web APIs, or experimenting with C# 13, the preview SDK gives you early access to cutting-edge features. Remember to check the [official .NET 9 documentation](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9) for updates as the release progresses.

**Happy coding!** 🚀

### **CONTACT:**

I’m Kumar Bishojit Paul, the Founder and CEO of [**BIKIRAN**](https://www.bikiran.com/). [If you](https://www.bikiran.com/) need further assistance, please leave a comment. I’m interested in helping you.


---

## 🏢 About Bikiran

**[Bikiran](https://bikiran.com/)** is a software development and cloud infrastructure company founded in 2012, headquartered in Khulna, Bangladesh. With 15,000+ clients and over a decade of experience, Bikiran builds and operates a suite of products spanning domain services, cloud hosting, app deployment, workflow automation, and developer tools.

| SL  | Topic        | Product                                                              | Description                                             |
| --- | ------------ | -------------------------------------------------------------------- | ------------------------------------------------------- |
| 1   | Website      | [Bikiran](https://bikiran.com/)                                      | Main platform — Domain, hosting & cloud services        |
| 2   | Website      | [Edusoft](https://www.edusoft.com.bd/)                               | Education management software for institutions          |
| 3   | Website      | [n8n Clouds](https://n8nclouds.com/)                                 | Managed n8n workflow automation hosting                 |
| 4   | Website      | [Timestamp Zone](https://www.timestamp.zone/)                        | Unix timestamp converter & timezone tool                |
| 5   | Website      | [PDFpi](https://pdfpi.bikiran.com/)                                  | Online PDF processing & manipulation tool               |
| 6   | Website      | [Blog](https://blog.bikiran.com/)                                    | Technical articles, guides & tutorials                  |
| 7   | Website      | [Support](https://support.bikiran.com/)                              | 24/7 customer support portal                            |
| 8   | Website      | [Probackup](https://probackup.bikiran.com/)                          | Automated database backup for SQL, PostgreSQL & MongoDB |
| 9   | Service      | [Domain](https://www.bikiran.com/domain)                             | Domain registration, transfer & DNS management          |
| 10  | Service      | [Hosting](https://www.bikiran.com/services/hosting/web)              | Web, app & email hosting on NVMe SSD                    |
| 11  | Service      | Email & SMS                                                          | Bulk email & SMS notification service                   |
| 12  | npm          | [Chronopick](https://www.npmjs.com/package/@bikiran/chronopick)      | Date & time picker React component                      |
| 13  | npm          | [Rich Editor](https://www.npmjs.com/package/@bikiran/editor)         | WYSIWYG rich text editor for React                      |
| 14  | npm          | [Button](https://www.npmjs.com/package/@bikiran/button)              | Reusable React button component library                 |
| 15  | npm          | [Electron Boilerplate](https://www.npmjs.com/package/create-edx-app) | CLI to scaffold Electron.js project templates           |
| 16  | NuGet        | [Bkash](https://www.nuget.org/packages/Bikiran.Payment.Bkash)        | bKash payment gateway integration for .NET              |
| 17  | NuGet        | [Bikiran Engine](https://www.nuget.org/packages/Bikiran.Engine)      | Core .NET engine library for Bikiran services           |
| 18  | Open Source  | [PDFpi](https://github.com/bikirandev/pdfpi)                         | PDF processing tool — open source                       |
| 19  | Open Source  | [Bikiran Engine](https://github.com/bikirandev/Bikiran.Engine)       | Core .NET engine — open source                          |
| 20  | Open Source  | [Drive CLI](https://github.com/bikirandev/DriveCLI)                  | CLI tool to manage Google Drive from terminal           |
| 21  | Docker       | [Pgsql](https://github.com/bikirandev/docker-pgsql)                  | Docker setup for PostgreSQL                             |
| 22  | Docker       | [n8n](https://github.com/bikirandev/docker-n8n)                      | Docker setup for n8n automation                         |
| 23  | Docker       | [Pgadmin](https://github.com/bikirandev/docker-pgadmin)              | Docker setup for pgAdmin                                |
| 24  | Social Media | [LinkedIn](https://www.linkedin.com/company/bikiran12)               | Bikiran on LinkedIn                                     |
| 25  | Social Media | [Facebook](https://www.facebook.com/bikiran12)                       | Bikiran on Facebook                                     |
| 26  | Social Media | [YouTube](https://www.youtube.com/@bikiranofficial)                  | Bikiran on YouTube                                      |
| 27  | Social Media | [FB n8nClouds](https://www.facebook.com/n8nclouds)                   | n8n Clouds on Facebook                                  |
