Unable to locate package mssql-server - sql-server

I'm trying to install MSSQL # Ubuntu 16.04 (as recommended # https://learn.microsoft.com/en-US/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-linux-2017)
But that's the error I'm currently facing E: Unable to locate package mssql-server
test#test-VirtualBox:~$ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
OK
test#test-VirtualBox:~$ sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"
test#test-VirtualBox:~$ sudo apt-get update
Hit:1 http://pl.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://pl.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://pl.archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit:5 https://packages.microsoft.com/ubuntu/16.04/mssql-server-2017 xenial InRelease
Reading package lists... Done
test#test-VirtualBox:~$ sudo apt-get install -y mssql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mssql-server
What I'm doing wrong?
I've been trying many various Google queries like unable to locate package *mssql-server* site:github.com but nothing really solves my problem.
Thanks in advance

You may need to check whether the Ubuntu installed in your virtual machine is 32-bit or 64-bit. The packages for mssql-server are 64-bit only, and will be ignored on a 32-bit install.

check whether the Ubuntu installed in your virtual machine is 32-bit or 64-bit or ARM The packages for mssql-server are 64-bit only and it wont works with any ARM or 32 bit

Related

How to install libapt-pkg.so.5.0 on Ubuntu 20.04

I have a dynamic library that I want to use. However, one of its dependencies is not available on my system:
$ ldd redacted_name.so | grep 'not found'
libapt-pkg.so.5.0 => not found
I tried installing libapt-pkg, and it seemed to work. Here is the output for installing:
$ sudo apt install -y libapt-pkg5.0
Reading package lists... Done
Building dependency tree
apt apt-utils libapt-pkg6.0
3 upgraded, 0 newly installed, 0 to remove and 307 not upgraded.
Need to get 2346 kB of archives.
After this operation, 42.0 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libapt-pkg6.0 amd64 2.0.9 [839 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt amd64 2.0.9 [1294 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 apt-utils amd64 2.0.9 [213 kB]
Fetched 2346 kB in 2s (1474 kB/s)
(Reading database ... 54241 files and directories currently installed.)
Preparing to unpack .../libapt-pkg6.0_2.0.9_amd64.deb ...
Unpacking libapt-pkg6.0:amd64 (2.0.9) over (2.0.2) ...
Setting up libapt-pkg6.0:amd64 (2.0.9) ...
(Reading database ... 54241 files and directories currently installed.)
Preparing to unpack .../archives/apt_2.0.9_amd64.deb ...
Unpacking apt (2.0.9) over (2.0.2) ...
Setting up apt (2.0.9) ...
Removing obsolete conffile /etc/kernel/postinst.d/apt-auto-removal ...
(Reading database ... 54240 files and directories currently installed.)
Preparing to unpack .../apt-utils_2.0.9_amd64.deb ...
Unpacking apt-utils (2.0.9) over (2.0.2) ...
Setting up apt-utils (2.0.9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Note that it says no packages were newly installed, and also note that it lists libapt-pkg6.0 in the output.
However, then I still see that the dependency is not found:
$ ldd redacted_name.so | grep 'not found'
libapt-pkg.so.5.0 => not found
Also, when I grep for my installed packages, libapt-pkg5.0 does not appear, but for some reason libapt-pkg6.0 does appear:
$ apt list --installed | grep libapt
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libapt-pkg6.0/focal-updates,now 2.0.9 amd64 [installed]
If I try to install libapt-pkg5.0 again, it fails, mentioning that it is referred to by another package:
$ sudo apt install -y libapt-pkg5.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libapt-pkg5.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapt-pkg5.0' has no installation candidate
How can I correctly install libapt-pkg5.0 on my Ubuntu 20.04 system?

RHEL 8 Container MSSQL ODBC Driver e2fsprogs

I'm trying to build a custom docker container using the RHEL 8 UBI. As part of this I want to install the MSSQL 17 ODBC driver.
I've followed the steps outlined in Microsofts Documentation here:
https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#redhat17
And added the Microsoft repo to my yum.repos.d directory however when I try to build the container I get the following error: nothing provides e2fsprogs needed by msodbcsql17-17.6.1.1-1.x86_64
When I dug a bit further into this it looks as though it looks as though for RHEL-7 Microsoft suggest installing e2fsprogs manually you can see that here: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#offline-installation
This unfortunately isn't possible in RHEL-8 as e2fsprogs-static has been removed: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages
The full output from the build is:
$ docker build -f ./test.dockerfile -t daark:1 .
Sending build context to Docker daemon 25.77MB
Step 1/7 : FROM registry.redhat.io/ubi8/ubi
---> a1f8c9699786
Step 2/7 : RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
---> Using cache
---> 90b3e1514239
Step 3/7 : RUN yum search odbc
---> Using cache
---> b26f78d0da28
Step 4/7 : RUN yum search msodbcsql17
---> Using cache
---> c6f7751b97dc
Step 5/7 : ENV ACCEPT_EULA=Y
---> Using cache
---> 2b0003944673
Step 6/7 : RUN yum install -y unixODBC unixODBC-devel
---> Using cache
---> 1d0b8c594905
Step 7/7 : RUN yum install -y msodbcsql17
---> Running in 67c30e75fb42
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:08:11 ago on Wed Aug 5 09:36:32 2020.
Error:
Problem: cannot install the best candidate for the job
- nothing provides e2fsprogs needed by msodbcsql17-17.6.1.1-1.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
The command '/bin/sh -c yum install -y msodbcsql17' returned a non-zero code: 1
This error is pretty reproducible here is the test dockerfile i'm using to debug
FROM registry.redhat.io/ubi8/ubi
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum search odbc
RUN yum search msodbcsql17
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum install -y msodbcsql17
Has anyone managed to get this ODBC driver installed on an RHEL 8 UBI based container?
I found a work around that I hope will help the next person to hit this.
Rather than running yum install -y msodbcsql17 I instead used yum to download the RPM
yum download -y msodbcsql17
then used rpm -Uvh --nodeps msodbcsql17*rpm to install it.
You can use this docker file:
FROM registry.redhat.io/ubi8/ubi
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum search odbc
RUN yum search msodbcsql17
ENV ACCEPT_EULA=Y
RUN yum install -y unixODBC unixODBC-devel
RUN yum download -y msodbcsql17
RUN rpm -Uvh --nodeps msodbcsql17*rpm
#daark thank you for posting your solution. Your solution got me over the problem I was facing. I ended modifying your solution to the following (in case it helps anyone else):
FROM registry.access.redhat.com/ubi8/python-38
USER root
RUN yum update --assumeyes && \
yum install --assumeyes \
unixODBC-devel \
&& yum clean all
RUN curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
RUN yum download -y msodbcsql17
RUN ACCEPT_EULA=y rpm -Uvh --nodeps msodbcsql17*rpm
I tried to add this to the #daark's solution as a comment, but it was too difficult to display the code properly.
Good luck to anyone else facing this issue 🍀
Latest msodbcsql17 release fixes this issue. The documentation steps work smooth once again. See docs issue
I can confirm that installation on redhat/ubi8 works with msodbcsql17-17.8.1.2-1.x86_64.rpm.
FROM redhat/ubi8
COPY msodbcsql17-17.8.1.2-1.x86_64.rpm /tmp
RUN MSSQL_PID=Developer ACCEPT_EULA=Y yum -y localinstall /tmp/msodbcsql17-17.8.1.2-1.x86_64.rpm; rm /tmp/msodbcsql17-17.8.1.2-1.x86_64.rpm

Unable install SQLserver tool in ubuntu 20

I installed SQLserver in my ubuntu. But when I install sqlserver-tool something happened.
type
sudo apt-get install unixodbc-dev
return
eading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
unixodbc-dev : Depends: unixodbc (= 2.3.7)
Depends: odbcinst1debian2 (= 2.3.7) but 2.3.6-0.1build1 is to be installed
E: Unable to correct problems, you have held broken packages.
so that I tried below
sudo apt-get install unixodbc
returns
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
unixodbc : Depends: odbcinst1debian2 (>= 2.3.7) but 2.3.6-0.1build1 is to be installed
Depends: libodbc1 (>= 2.3.7) but 2.3.6-0.1build1 is to be installed
E: Unable to correct problems, you have held broken packages.
and lastly
sudo apt-get install odbcinst1debian2
return
eading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
odbcinst1debian2 : PreDepends: multiarch-support but it is not installable
E: Unable to correct problems, you have held broken packages.
I completely stacked and have no idea at all.
Dose anybody can help for me. Thanks.
User rim96 has right, the reason is that Microsoft's source list includes unixodbc in higer version (2.3.7) that depends on multi-arch (unlike Ubuntu's version 2.3.6)
I think that unixodbc 2.3.6 is good enough. In my case the follow steps helped me.
Remove Microsoft's source list.
mv /etc/apt/sources.list.d/mssql-tools.list ~/
Update sources
sudo apt-get update
Install unixodbc 2.3.6 from Ubuntu repository
sudo apt-get install unixodbc
Move Microsoft's source list back
mv ~/mssql-tools.list /etc/apt/sources.list.d/
Update sources again
sudo apt-get update
Install mssq-tools (or whatever you want) from Microsoft's repository
sudo apt-get install mssql-tools
User Jiří Chmiel's answer helped a lot, though I changed two lines to:
sudo mv /etc/apt/sources.list.d/msprod.list ~/
and:
sudo mv ~/msprod.list /etc/apt/sources.list.d/
was what worked for me
(Ubuntu 20.04 in Dec '20)
This problems looks like you forgot to run sudo apt-get update before installing odbcinst1debian2. On focal this package does not depend on multiarch-support.
From https://askubuntu.com/questions/1232332/installing-odbcins1debian2-broken-dependency-on-ubuntu-20-04-lts
If you follow Microsoft install guide for SQL Server Tools, for Ubuntu it says
If you are using Ubuntu 18.04 or Ubuntu 20.04, change the repository path in step 2 below from /ubuntu/16.04 to /ubuntu/18.04 or /ubuntu/20.04
So in step 2, you should do
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
instead of
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

How to install ROS on Ubuntu 18.04?

Im running Ubuntu 18.04 and trying to install ROS for the first time on my machine. I have tried to follow the instructions at: http://wiki.ros.org/melodic/Installation/Ubuntu
I get stuck at this part.
sudo apt-get install ros-melodic-desktop-full
My attempts:
sudo apt -f install
sudo apt update --fix-missing
sudo dpkg --configure -a
sudo dpkg --remove --force-remove--reinstreq
sudo apt clean
sudo apt update
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
Nothing has worked so far.
Terminal commands:
$sudo apt-get install ros-melodic-desktop-full
Reading package lists… Finished
Builds dependency trees
Reading state information ... Finished
Some packages could not be installed. It may mean that you have requested
an impossible situation or, if you use the unstable distribution
that some necessary packages have not yet been created or moved
from "Incoming".
The following information may help to resolve the situation:
The following packages have dependencies that cannot be satisfied:
rose-melodic-desktop-full: Dependent on: rose-melodic-desktop but it will not be installed
Depending on: rose-melodic-perception but it will not be installed
Depending on: rose-melodic-simulators but it will not be installed
Depending on: ros-melodic-urdf-sim-tutorial but it will not be installed
E: Could not correct the problems, you have withheld broken packages.
Please help me install ROS
1 - After following ROS melodic Installation first steps (see link below), Try to install it with the link "click here" below the "sudo apt install ros-melodic-desktop-full" line
ROS melodic Installation page
If it's doesn't work
2 - check, "Software & Update" parameters
(if you cannot find it: launch "Ubuntu Software Center" and in the menu bar, on top, select "Software & Update")
In "Other Sofware" tab, the link
"http://pacckage.ros.org/ros/ubuntu bionic main"
is printed, and in "Autentication" tab a key from Open Robotics is printed
3 - Try to do 1- again, if it doesn't work, follow 4-
4 - In "Updates" tab, check "recommanded Updates", launch "Update Manager" and install updates (I don't do it properly on my PC)
5 - And finally you need to install manually rosdep with:
"sudo apt-get install python-rosdep"
Ubuntu (apt) does NOT allow packages with the same name but different versions to be installed.
Remove other versions first. For example: apt remove ros-desktop*
first of all install program on ubuntu.
sudo apt-get update
sudo apt-get upgrade
after update packet try follow the instructions at: enter link description here again
I got it working like so:
Install deps:
sudo apt install gazebo9-common libgazebo9-dev gazebo9 ros-melodic-gazebo-ros-pkgs ros-melodic-gazebo-dev ros-melodic-gazebo-ros-control ros-melodic-gazebo-ros ros-melodic-urdf-sim-tutorial ros-melodic-simulators
Install ros melodic
sudo apt-get install ros-melodic-desktop-full

"gpg: keyserver receive failed: connection refused" with ROS packages

I am trying to install ROS2 on Ubuntu 18.04.
The following command gives an error for not having the public key.
sudo apt update && sudo apt install curl gnupg2 lsb-release
Error:
Hit:1 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease
Get:4 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:6 http://packages.ros.org/ros2/ubuntu bionic InRelease [2,565 B]
Err:6 http://packages.ros.org/ros2/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116
Reading package lists... Done
W: GPG error: http://packages.ros.org/ros2/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5523BAEEB01FA116
E: The repository 'http://packages.ros.org/ros2/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I tried following ways to get the key:
sudo apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 5523BAEEB01FA116
and
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5523BAEEB01FA116
and y-ppa-manager ("Try to import all missing GPG keys")
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get install y-ppa-manager
y-ppa-manager
all the above methods give the following error
gpg: keyserver receive failed: No keyserver available
I am running Ubuntu 18.04 using a VM on a Windows 7 host.
How to avail the keyserver?
You can get a copy of the currently working key from the Dockerfile used for the nightly build of the osrf/ros2 Docker image: https://hub.docker.com/r/osrf/ros2/dockerfile
# setup ros2 keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
It's not a future-proof solution though, because I was initially using a different key for ROS2 Crystal, and then that key suddenly stopped working (we also have our own regular builds) and I got the same error as you. It turns out I had to update our build with the new keys.
I think a better solution moving forward is to just use that pre-built ROS2 environment available as a Docker image. That way, the keys get updated when they update it.
docker pull osrf/ros2:nightly

Resources