Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 2.31 KB

File metadata and controls

73 lines (52 loc) · 2.31 KB
author rwestMSFT
ms.author randolphwest
ms.date 06/16/2025
ms.service sql
ms.topic include
ms.custom
linux-related-content

Use the following steps to install the mssql-tools18 on Red Hat Enterprise Linux.

  1. Download the Microsoft Red Hat repository configuration file.

    • For Red Hat 10 (in preview), use the following command to download the Microsoft Red Hat repository configuration file from the RHEL 9 repo. The same versions of tools also work for RHEL 10.

      curl https://packages.microsoft.com/config/rhel/9/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
    • For Red Hat 9, use the following command:

      curl https://packages.microsoft.com/config/rhel/9/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
    • For Red Hat 8, use the following command:

      curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
    • For Red Hat 7, use the following command:

      curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
  2. If you had a previous version of mssql-tools installed, remove any older unixODBC packages.

    sudo yum remove mssql-tools unixODBC-utf16 unixODBC-utf16-devel
  3. Run the following commands to install mssql-tools18 with the unixODBC developer package.

    sudo yum install -y mssql-tools18 unixODBC-devel

    To update to the latest version of mssql-tools, run the following commands:

    sudo yum check-update
    sudo yum update mssql-tools18
  4. Optional: Add /opt/mssql-tools18/bin/ to your PATH environment variable in a bash shell.

    To make sqlcmd and bcp accessible from the bash shell for login sessions, modify your PATH in the ~/.bash_profile file with the following command:

    echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile
    source ~/.bash_profile

    To make sqlcmd and bcp accessible from the bash shell for interactive/non-login sessions, modify the PATH in the ~/.bashrc file with the following command:

    echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
    source ~/.bashrc