0

I am trying to install php driver for Microsoft SQL Server in ubuntu(22.04).

I used the command

sudo apt-get install -y unixodbc-dev

specified in the microsoft documentation. [https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16&tabs=ubuntu18-install%2Calpine17-install%2Cdebian8-install%2Credhat7-13-install%2Crhel7-offline][1]

I tried running the command. the following error was coming

The following additional packages will be installed:
libodbc2 libodbccr2
Suggested packages:
  odbc-postgresql
The following NEW packages will be installed:
  libodbc2 libodbccr2 unixodbc-dev
0 upgraded, 3 newly installed, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
Need to get 0 B/423 kB of archives.
After this operation, 2,366 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 282670 files and directories currently installed.)
Preparing to unpack .../libodbc2_2.3.9-5ubuntu0.1_amd64.deb ...
Unpacking libodbc2:amd64 (2.3.9-5ubuntu0.1) ...
dpkg: error processing archive /var/cache/apt/archives/libodbc2_2.3.9-5ubuntu0.1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0', which is also in package libodbc1:amd64 2.3.11-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../libodbccr2_2.3.9-5ubuntu0.1_amd64.deb ...
Unpacking libodbccr2:amd64 (2.3.9-5ubuntu0.1) ...
dpkg: error processing archive /var/cache/apt/archives/libodbccr2_2.3.9-5ubuntu0.1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbccr.so.2.0.0', which is also in package libodbc1:amd64 2.3.11-1
Selecting previously unselected package unixodbc-dev:amd64.
Preparing to unpack .../unixodbc-dev_2.3.9-5ubuntu0.1_amd64.deb ...
Unpacking unixodbc-dev:amd64 (2.3.9-5ubuntu0.1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libodbc2_2.3.9-5ubuntu0.1_amd64.deb
 /var/cache/apt/archives/libodbccr2_2.3.9-5ubuntu0.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
karel
  • 122,292
  • 133
  • 301
  • 332

1 Answers1

0

I got it work.

there is work around specified in this link. https://bugs.launchpad.net/ubuntu/+source/unixodbc/+bug/2007288