microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
325 stars 57 forks source link

install error on Ubuntu #316

Open azinsharaf opened 1 year ago

azinsharaf commented 1 year ago

i am able to install it from apt on WSL (Ubuntu 22.04) but can't run it.

~$ sqlcmd
bash: /usr/bin/sqlcmd: cannot execute binary file: Exec format error

Win OS: Win 11 Pro Arm

stuartpa commented 1 year ago

I'll look into this

felipeschneider88 commented 1 year ago

I tested it on my WSL and it worked

felipe@MSI:~$ sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)"
Repository: 'deb [arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/20.04/prod focal main'
Description:
Archive for codename: focal components: main
More info: https://packages.microsoft.com/ubuntu/20.04/prod
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Adding deb entry to /etc/apt/sources.list.d/archive_uri-https_packages_microsoft_com_ubuntu_20_04_prod-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-https_packages_microsoft_com_ubuntu_20_04_prod-jammy.list
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:5 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [3611 B]
Get:6 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages [200 kB]
Get:7 https://packages.microsoft.com/ubuntu/20.04/prod focal/main armhf Packages [14.2 kB]
Get:8 https://packages.microsoft.com/ubuntu/20.04/prod focal/main arm64 Packages [40.3 kB]
Get:9 https://packages.microsoft.com/ubuntu/20.04/prod focal/main all Packages [2521 B]
Fetched 260 kB in 2s (113 kB/s)
Reading package lists... Done
W: https://packages.microsoft.com/ubuntu/20.04/prod/dists/focal/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
felipe@MSI:~$ sudo apt-get update
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease
Reading package lists... Done
W: https://packages.microsoft.com/ubuntu/20.04/prod/dists/focal/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
felipe@MSI:~$ sudo apt-get install sqlcmd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  sqlcmd
0 upgraded, 1 newly installed, 0 to remove and 81 not upgraded.
Need to get 5290 kB of archives.
After this operation, 19.4 MB of additional disk space will be used.
Get:1 https://packages.microsoft.com/ubuntu/20.04/prod focal/main all sqlcmd all 1.0.0-1~buster [5290 kB]
Fetched 5290 kB in 3s (2079 kB/s)
Selecting previously unselected package sqlcmd.
(Reading database ... 34163 files and directories currently installed.)
Preparing to unpack .../sqlcmd_1.0.0-1~buster_all.deb ...
Unpacking sqlcmd (1.0.0-1~buster) ...
Setting up sqlcmd (1.0.0-1~buster) ...
felipe@MSI:~$ sqlcmd config view
version: ""
endpoints: []
contexts: []
currentcontext: ""
users: []
felipe@MSI:~$

If I run the command only also works

felipe@MSI:~$ sqlcmd
unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connect: connection refused
unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connect: connection refused

This is my Laptop info Nombre del dispositivo MSI Procesador Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz 2.59 GHz RAM instalada 24.0 GB (23.8 GB utilizable) Id. del dispositivo --------------------------------------- Id. del producto ------------------------------------------ Tipo de sistema Sistema operativo de 64 bits, procesador x64 Lápiz y entrada táctil La entrada táctil o manuscrita no está disponible para esta pantalla

This is my windows info Edición Windows 11 Home Versión 22H2 Se instaló el ‎10/‎28/‎2022 Compilación del SO 22621.1702 Experiencia Windows Feature Experience Pack 1000.22641.1000.0

This is my Ubuntu version felipe@MSI:/mnt/c/Users/felip$ cat /etc/os-release PRETTY_NAME="Ubuntu 22.04.1 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.1 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

azinsharaf commented 1 year ago

i am getting the same error in Debian 11. I am using a Arm based Win 11. Could it be the reason?

stuartpa commented 9 months ago

Yep, we need to add arm to the apt package

oguzhantopcu commented 4 months ago

any future plans to add?