|
| 1 | +--- |
| 2 | +title: Configure Repositories for Installing and Upgrading SQL Server 2025 on Linux |
| 3 | +description: Check and configure source repositories for SQL Server on Linux. The source repository affects the version of SQL Server that is applied during installation and upgrade. |
| 4 | +author: rwestMSFT |
| 5 | +ms.author: randolphwest |
| 6 | +ms.date: 12/04/2025 |
| 7 | +ms.service: sql |
| 8 | +ms.subservice: linux |
| 9 | +ms.topic: upgrade-and-migration-article |
| 10 | +ms.custom: |
| 11 | + - linux-related-content |
| 12 | + - build-2025 |
| 13 | +monikerRange: ">=sql-server-linux-2017 || >=sql-server-2017" |
| 14 | +--- |
| 15 | +# Configure repositories for installing and upgrading SQL Server 2025 on Linux |
| 16 | + |
| 17 | +[!INCLUDE [SQL Server - Linux](../includes/applies-to-version/sql-linux.md)] |
| 18 | + |
| 19 | +This article describes how to configure the correct repository for installing and upgrading [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] on Red Hat Enterprise Linux (RHEL) and Ubuntu. |
| 20 | + |
| 21 | +For instructions on how to configure repositories for [!INCLUDE [sssql22-md](../includes/sssql22-md.md)] and earlier versions, see [Configure Repositories for Installing and Upgrading SQL Server on Linux](sql-server-linux-change-repo.md?view=sql-server-ver16&preserve-view=true). |
| 22 | + |
| 23 | +> [!TIP] |
| 24 | +> [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] is available on RHEL 10 (in preview) and Ubuntu 24.04 (in preview). To try it, use this article to configure the `mssql-server-preview` repository. Then install using the instructions in the [installation guide](sql-server-linux-setup.md). |
| 25 | +
|
| 26 | +## Repositories |
| 27 | + |
| 28 | +When you install SQL Server on Linux, you must configure a Microsoft repository. This repository is used to acquire the database engine package, **mssql-server**, and related SQL Server packages. There are currently three main repositories: |
| 29 | + |
| 30 | +| Repository | Name | Description | |
| 31 | +| --- | --- | --- | |
| 32 | +| **2025** | `mssql-server-2025` <sup>1</sup> | [!INCLUDE [sssql25-md](../includes/sssql25-md.md)] repository. | |
| 33 | +| **2022** | `mssql-server-2022` | [!INCLUDE [sssql22-md](../includes/sssql22-md.md)] repository. | |
| 34 | +| **2019** | `mssql-server-2019` | [!INCLUDE [sssql19-md](../includes/sssql19-md.md)] Cumulative Update (CU) repository. | |
| 35 | +| **2017** | `mssql-server-2017` | [!INCLUDE [sssql17-md](../includes/sssql17-md.md)] Cumulative Update (CU) repository. | |
| 36 | + |
| 37 | +<sup>1</sup> Use `mssql-server-preview` for Red Hat 10 (in preview) and Ubuntu 24.04 (in preview). |
| 38 | + |
| 39 | +The Cumulative Update (CU) repository contains packages for the base SQL Server release, and any bug fixes or improvements since that release. Cumulative updates are specific to a release version, such as [!INCLUDE [sssql25-md](../includes/sssql25-md.md)]. They're released on a regular cadence. General distribution release (GDR) updates are released in the same CU repository. |
| 40 | + |
| 41 | +Each release contains the full SQL Server package and all previous updates for that repository. You can also [downgrade](sql-server-linux-setup.md#rollback) to any release within your major version (for example, 2025). |
| 42 | + |
| 43 | +## Configure repositories |
| 44 | + |
| 45 | +Use the steps in the following sections to configure repositories on your Linux distribution. |
| 46 | + |
| 47 | +## Check for previously configured repositories |
| 48 | + |
| 49 | +First verify whether you have already registered a SQL Server repository. |
| 50 | + |
| 51 | +### [RHEL](#tab/rhel) |
| 52 | + |
| 53 | +1. View the files in the `/etc/yum.repos.d` directory with the following command: |
| 54 | + |
| 55 | + ```bash |
| 56 | + sudo ls /etc/yum.repos.d |
| 57 | + ``` |
| 58 | + |
| 59 | +1. Look for a file that configures the SQL Server directory, such as `mssql-server.repo`. |
| 60 | + |
| 61 | +1. Display the contents of the file using `cat`. |
| 62 | + |
| 63 | + ```bash |
| 64 | + sudo cat /etc/yum.repos.d/mssql-server.repo |
| 65 | + ``` |
| 66 | + |
| 67 | +1. The **name** property is the configured repository. You can identify it with the table in the [Repositories](#repositories) section of this article. |
| 68 | + |
| 69 | +### [Ubuntu](#tab/ubuntu) |
| 70 | + |
| 71 | +1. View the contents of the `/etc/apt/sources.list` file. |
| 72 | + |
| 73 | + ```bash |
| 74 | + sudo cat /etc/apt/sources.list |
| 75 | + ``` |
| 76 | + |
| 77 | +1. Examine the package URL for mssql-server. You can identify it with the table in the [Repositories](#repositories) section of this article. |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +## Remove old repository |
| 82 | + |
| 83 | +If necessary, remove the old repository with the following command. |
| 84 | + |
| 85 | +### [RHEL](#tab/rhel) |
| 86 | + |
| 87 | +```bash |
| 88 | +sudo rm -rf /etc/yum.repos.d/mssql-server.repo |
| 89 | +``` |
| 90 | + |
| 91 | +This command assumes that the file identified in the previous section was named `mssql-server.repo`. |
| 92 | + |
| 93 | +### [Ubuntu](#tab/ubuntu) |
| 94 | + |
| 95 | +Use one of the following commands based on the type of previously configured repository. |
| 96 | + |
| 97 | +| Repository | Command to remove | |
| 98 | +| --- | --- | |
| 99 | +| **2025** | `sudo add-apt-repository -r 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/22.04/mssql-server-preview jammy main'` | |
| 100 | +| **2022** | `sudo add-apt-repository -r 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/22.04/mssql-server-2022 jammy main'` | |
| 101 | +| **2019 CU** | `sudo add-apt-repository -r 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/20.04/mssql-server-2019 focal main'` | |
| 102 | +| **2017 CU** | `sudo add-apt-repository -r 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/mssql-server-2017 bionic main'` | |
| 103 | + |
| 104 | +These commands point to the latest repository for a specific distribution. If you use an earlier distribution where that version of [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] is still supported, change the path accordingly, and use the correct [distribution code name](https://releases.ubuntu.com/). |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## Configure new repository |
| 109 | + |
| 110 | +Configure the new repository to use for SQL Server installations and upgrades. Use one of the following commands to configure the repository of your choice. |
| 111 | + |
| 112 | +### [RHEL](#tab/rhel) |
| 113 | + |
| 114 | +- Starting with [!INCLUDE [sssql25-md](../includes/sssql25-md.md)], RHEL 10 is supported (in preview). |
| 115 | +- Starting with [!INCLUDE [sssql22-md](../includes/sssql22-md.md)] CU 10, RHEL 9 is supported. |
| 116 | +- Starting with [!INCLUDE [sssql17-md](../includes/sssql17-md.md)] CU 20, RHEL 8 is supported. |
| 117 | + |
| 118 | +The following commands for [!INCLUDE [sssql19-md](../includes/sssql19-md.md)] point to the RHEL 8 repository. RHEL 8 doesn't come preinstalled with `python2`, which [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] requires. For more information, see [Installing Microsoft SQL Server on Red Hat Enterprise Linux 8 Beta](https://www.redhat.com/blog/installing-microsoft-sql-server-red-hat-enterprise-linux-8-beta). |
| 119 | + |
| 120 | +Depending on the version of RHEL you use, ensure the paths match `/rhel/8`, `/rhel/9`, or `/rhel10`. Our packages are agnostic to RHEL minor versions. This means that if you use RHEL 8.7, you need to use the path `/rhel/8` to configure your repository. |
| 121 | + |
| 122 | +| Repository | Version | Release | Command | |
| 123 | +| --- | --- | --- | |
| 124 | +| **2025** | 2025 | RHEL 10 (in preview) | `sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/10/mssql-server-preview.repo` | |
| 125 | +| **2022** | 2022 | RHEL 9 | `sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/9/mssql-server-2022.repo` | |
| 126 | +| **2019 CU** | 2019 | RHEL 8 | `sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repo` | |
| 127 | +| **2017 CU** | 2017 | RHEL 8 | `sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2017.repo` | |
| 128 | + |
| 129 | +### [Ubuntu](#tab/ubuntu) |
| 130 | + |
| 131 | +Configure the new repository to use for SQL Server installations and upgrades. |
| 132 | + |
| 133 | +- Starting with [!INCLUDE [sssql25-md](../includes/sssql22-md.md)], Ubuntu 24.04 is supported (in preview). |
| 134 | +- Starting with [!INCLUDE [sssql22-md](../includes/sssql22-md.md)] CU 10, Ubuntu 22.04 is supported. |
| 135 | +- Starting with [!INCLUDE [sssql19-md](../includes/sssql19-md.md)] CU 10, Ubuntu 20.04 is supported. |
| 136 | +- Starting with [!INCLUDE [sssql19-md](../includes/sssql19-md.md)] CU 3 and [!INCLUDE [sssql17-md](../includes/sssql17-md.md)] CU 20, Ubuntu 18.04 is supported. |
| 137 | + |
| 138 | +The following commands point to the latest repository for a specific distribution. If you use an earlier distribution where that version of [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)] is still supported, change the path accordingly, and use the correct [distribution code name](https://releases.ubuntu.com/). |
| 139 | + |
| 140 | +1. Import the public repository GPG keys. |
| 141 | + |
| 142 | + ```bash |
| 143 | + curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc |
| 144 | + ``` |
| 145 | + |
| 146 | +1. Use one of the following commands to configure the repository of your choice. |
| 147 | + |
| 148 | + | Repository | Version | Command | |
| 149 | + | --- | --- | --- | |
| 150 | + | **2025** | 2025 | `sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-preview.list)"` | |
| 151 | + | **2022** | 2022 | `sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list)"` | |
| 152 | + | **2019 CU** | 2019 | `sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"` | |
| 153 | + | **2017 CU** | 2017 | `sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2017.list)"` | |
| 154 | + |
| 155 | +1. Run `apt-get update`. |
| 156 | + |
| 157 | + ```bash |
| 158 | + sudo apt-get update |
| 159 | + ``` |
| 160 | + |
| 161 | +--- |
| 162 | + |
| 163 | +If you choose to use a quickstart article, remember that you have already configured the target repository. Don't repeat that step in the tutorial. |
| 164 | + |
| 165 | +## Related content |
| 166 | + |
| 167 | +- [Quickstart: Install SQL Server and create a database on Red Hat](quickstart-install-connect-red-hat.md) |
| 168 | +- [Quickstart: Install SQL Server and create a database on SUSE Linux Enterprise Server](quickstart-install-connect-suse.md) |
| 169 | +- [Quickstart: Install SQL Server and create a database on Ubuntu](quickstart-install-connect-ubuntu.md) |
| 170 | +- [Installation guidance for SQL Server on Linux](sql-server-linux-setup.md) |
0 commit comments