Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

$
0
0

By:Manvendra Singh || Related Tips:More >SQL Server on linux

Problem

When we install SQL Server or SQL Server tools on a Linux server, it first checks the dependencies of the package to be installed. When installing the SQL Server tools on one of the Linux servers, I got the following error.

Error: Package: unixODBC-utf16-2.3.1-1.x86_64 (apt-mo.trafficmanager.net_yumrepos_mssql-rhel7-release_)
Requires: libltdl.so.7()(64bit)

Follow this tip to fix this type of error.

Solution

As you may know, SQL Server vNext does not install sqlcmd and the BCP utility along with the SQL Server installation on a Linux server. We need the sqlcmd utility to make a database connection to a Linux server, so we should install it on the target server where SQL Server is installed. I have explained the step by step method to install SQL Server tools on Red Hat Linux in my last tip .

In this tip, I will show how to fix any dependency error you face during installation. I will try to install the SQL Server tools on a Red Hat Linux server where I have already installed the SQL Server vNext version. Once I encounter a dependency error I will proceed with the fix in this tip.

Error during MSSQL Tools Installation on Redhat Linux 7.2

Step 1: First connect to the target Linux server on which you have installed SQL Server. You can directly connect to the server by logging in to do this exercise or you can use PuTTY a third party tool to make a Linux server connection. I used PuTTY to login to this server. I launched PuTTY and entered the IP address of the Linux server and then clicked the Open button as shown below.


Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

Once you click on the Open button, a black screen with appear asking you to enter the login name followed the password. I entered the login name and password and then pressed enter to connect as shown in the below screenshot.


Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

Step 2: You can see that I made a successful connection to the Linux server linux4mssql where I installed SQL Server. Now let's check and verify the SQL Server installation on this machine. Run the below command to check the mssql-server service.

#check the status of mssql-server service.
systemctl status mssql-server
Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

We can see the service status shows enabled and active (running) which is highlighted in green. This means SQL Server is installed and running fine on this Linux server. To make a database connection directly on this server, we need to install the sqlcmd utility on this machine to access SQL Server.

Step 3: We will use superuser mode su for the next step. Superuser mode in Linux is similar to the system administrator account permission in windows. So connect using superuser mode by running the below command.

#Connect with superuser permission
sudo su

You can see that I connected with the superuser account in the below screenshot.


Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

Step 4: Now we will run a curl command to download the installation packages from the Microsoft website to this Linux server. The downloaded file will be saved in location /etc/yum.repos.d/ as mentioned in the command line.

#Download installation configuration file.
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo

We can see the progress, time and details of the downloaded configuration file in the below picture.


Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

Now we can check the location /etc/yum.repos.d/ to verify whether the above file is saved in this location. Run the ls -lrt command to display all the files present in that folder.

#list all files/folders inside the yum.repos.d folder.
ls -lrt /etc/yum.repos.d/
Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

You can see our target file msprod.repo is in this location in the above picture. You can exit the superuser mode by typing exit followed by pressing enter.

Step 5: Now our next step is to install the SQL Server tools on this box with the help of this package. We will use the yum package to install it as we do for other applications on Linux. Run the below command to install SQL Server tools on this machine.

#Install SQL Server vNext tools
sudo yum install mssql-tools

Once you press enter to execute the above command, the execution process will start with checking some dependencies followed by downloading the required packages. Once the dependencies are resolved, all required packages will be displayed on this screen.


Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

We can see the download is not started because the command execution threw some error as shown in the above screenshot. This error is due to some dependency for the unixODBC-utf16-2.3.1-1.x86_64 package which requires another package known as libltdl.so.7()(64bit) for installation. We can see there are a sequence of dependencies inside the mssql tools package. Package mssql-tools.x86_64 requires msodbcsql, package msodbcsql requires unixODBC-utf16 and unixODBC-utf16 will require libltdl.so.7()(64bit). The package libltdl.so.7()(64bit) is missing which means it will not allow you to install the unixODBC-utf16 package and so on.

The Dependency Fix

Step 6: I did some research to fix this issue, but was unable to find anything so I decided to first install the missing package libltdl.so.7()(64bit) on the Linux server. I did a Google search for this package and got a link to download the package libltdl.so.7()(64bit) . If you open this link you will get the same package name libltdl.so.7()(64bit) mentioned under the "Provides" section of this page. Download this package to proceed with the next step.

Step 7: I downloaded this package on my local windows machine. My next challenge was to move this file onto the Linux server to install it. I used winscp, a third party tool to copy this downloaded package from my machine to Linux server. You can download winscp here . Now launch the winscp tool after installing it on your desktop, there are two panes for this tool. Files in left pane are on your Windows machine and files in the right pane are on your Linux server. We just need to drag and drop the target file from left pane to right pane to copy it to the Linux server. You can see I copied this downloaded package from C:\Users\Administrator\Downloads\ on my Windows machine to /home/Manvendra/ folder on the Linux server. Later we will check and verify this file on the Linux server.


Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...

Now go to your Linux server with PuTTY and check the location /home/manvendra to verify the file exists. You can see the file has been copied to this location in the below picture.


Fixing dependency issues during installation of SQL Server Tools on Red Hat Linu ...
Now we need to move this package to /etc/yum.repos.d/ folder to kick off the installation of this package. Run the below comm

Viewing all articles
Browse latest Browse all 3160

Trending Articles