# Installing OR-Tools for .Net from Binary on Linux

## Introduction

This guide explains how to install OR-Tools for .Net on Linux.

Although these instructions might also work on other Linux variants, we
have only tested them on machines meeting the following requirements:


- Alpine Edge 64-bit (x86_64)
- Centos 7 LTS 64-bit (x86_64)
- Debian SID 64-bit (x86_64)
- Debian 11 (bullseye) 64-bit (x86_64)
- Fedora 38 64-bit (x86_64)
- Fedora 37 64-bit (x86_64)
- OpenSuse Leap 64-bit (x86_64)
- Ubuntu 24.10 64-bit (x86_64)
- Ubuntu 22.04 LTS 64-bit (x86_64)
- Ubuntu 20.04 LTS 64-bit (x86_64)

<br />

> [!NOTE]
> **Note:** OR-Tools only provides archives for the **x86_64** (also known as **amd64**) architecture.

## Prerequisites

The following sections describe the prerequisites for installing OR-Tools.

### .Net Core SDK \>= 3.1

Next, install the .Net Core SDK version 3.1 or higher. To do so,
open a terminal window and enter:

### Alpine

    apk add dotnet6-sdk
        ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-alpine

### Centos

    sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
    sudo yum install -y dotnet-sdk-6.0

ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-centos#centos-7

### Debian

Before you install .NET, run the following commands to add the Microsoft
package signing key to your list of trusted keys and add the package
repository.

    wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    dpkg -i packages-microsoft-prod.deb
    rm packages-microsoft-prod.deb

    sudo apt update
    sudo apt install -y dotnet-sdk-6.0

ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian

### Fedora

    sudo dnf install -y dotnet-sdk-6.0

ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-fedora

### Fedora

    sudo dnf install -y dotnet-sdk-6.0

ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-fedora

### OpenSUSE

Before you install .NET, run the following commands to add the Microsoft
package signing key to your list of trusted keys and add the package
repository.

    sudo zypper install libicu
    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    wget https://packages.microsoft.com/config/opensuse/15/prod.repo
    sudo mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo
    sudo chown root:root /etc/zypp/repos.d/microsoft-prod.repo

Then you can install the .Net SDK using the following command:

    sudo zypper install -y dotnet-sdk-6.0

ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-opensuse

### Ubuntu

    sudo apt install -y dotnet-sdk-6.0

ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

### Ubuntu

    sudo apt install -y dotnet-sdk-6.0

ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

### Ubuntu

    sudo apt install -y dotnet-sdk-6.0

ref: https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

## Installing OR-Tools

Take the following steps to install the OR-Tools library for .Net:

Download and extract the binary distribution for your system:


- [Almalinux 9](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_almalinux-9_dotnet_v9.12.4544.tar.gz)
- [Alpine Edge](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_alpine-edge_dotnet_v9.12.4544.tar.gz)
- [Debian Sid](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-sid_dotnet_v9.12.4544.tar.gz)
- [Debian 12](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-12_dotnet_v9.12.4544.tar.gz)
- [Debian 11](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-11_dotnet_v9.12.4544.tar.gz)
- [Fedora 41](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_fedora-41_dotnet_v9.12.4544.tar.gz)
- [Fedora 40](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_fedora-40_dotnet_v9.12.4544.tar.gz)
- [OpenSuse Leap](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_opensuse-leap_dotnet_v9.12.4544.tar.gz)
- [Rockylinux 9](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_rockylinux-9_dotnet_v9.12.4544.tar.gz)
- [Ubuntu 24.10](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-24.10_dotnet_v9.12.4544.tar.gz)
- [Ubuntu 24.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-24.04_dotnet_v9.12.4544.tar.gz)
- [Ubuntu 22.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-22.04_dotnet_v9.12.4544.tar.gz)
- [Ubuntu 20.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-20.04_dotnet_v9.12.4544.tar.gz)

<br />

## Validate your installation

To test your .Net installations, open a terminal window and navigate to
the directory where you unpacked the binary distribution. Then enter the
following command:


    make test

<br />

This runs a selection of examples for OR-Tools. If all the examples run
successfully, you are ready to
[get started with OR-Tools](https://developers.google.com/optimization/introduction/dotnet).