Skip to content

Latest commit

 

History

History
111 lines (73 loc) · 3.16 KB

install-go.md

File metadata and controls

111 lines (73 loc) · 3.16 KB
author ms.author ms.date ms.service ms.topic ms.collection ms.custom
rwestMSFT
randolphwest
06/28/2024
sql
include
data-tools
linux-related-content

sqlcmd (Go) can be installed cross-platform, on Microsoft Windows, macOS, and Linux. Versions newer than 1.6 might not be available in all package managers. There's no estimated date yet for their availability.

winget (Windows Package Manager CLI)

  1. Install the Windows Package Manager Client if you don't already have it.

  2. Run the following command to install sqlcmd (Go).

    winget install sqlcmd

Chocolatey

  1. Install Chocolatey if you don't already have it.

  2. Run the following command to install sqlcmd (Go).

    choco install sqlcmd

Direct download

  1. Download the corresponding -windows-amd64.zip or -windows-arm.zip asset from the latest release of sqlcmd (Go) from the GitHub code repository.

  2. Extract the sqlcmd.exe file from the downloaded zip folder.

Homebrew

  1. Install Homebrew if you need to.

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install sqlcmd with Homebrew.

    brew install sqlcmd

Direct download

  1. Download the -darwin-amd64.zip asset from the latest release of sqlcmd (Go) from the GitHub code repository.

  2. Extract the sqlcmd file from the downloaded zip folder.

apt (Debian/Ubuntu)

  1. Import the public repository GPG keys.

    curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
  2. Add the Microsoft repository, where the ubuntu/20.04 segment might be debian/11, ubuntu/20.04, or ubuntu/22.04.

    add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)"
  3. Install sqlcmd (Go) with apt.

    apt-get update
    apt-get install sqlcmd

yum (Fedora)

  1. Import the Microsoft repository key.

    rpm --import https://packages.microsoft.com/keys/microsoft.asc
  2. Download the repository configuration file, where the fedora/32 segment might be opensuse/42.3, rhel/8, or sles/15. If the version of your OS doesn't directly correspond to one of those options, you might be able to use a repository configuration file from a version.

    curl -o /etc/yum.repos.d/packages-microsoft-com-prod.repo https://packages.microsoft.com/config/fedora/40/prod.repo
  3. Install sqlcmd (Go) with yum.

    yum install sqlcmd

Direct download

  1. Download the corresponding -linux-x64.tar.bz2 or -linux-arm.tar.bz2 asset from the latest release of sqlcmd (Go) from the GitHub code repository.

  2. Extract the sqlcmd file from the downloaded zip folder.