I've downloaded this debian package:
curl https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/msodbcsql/msodbcsql_13.1.4.0-1_amd64.deb -o msodbcsql_13.1.4.0-1_amd64.deb
Then I have run the following command:
sudo ACCEPT_EULA=Y dpkg -i msodbcsql_13.1.4.0-1_amd64.deb
And I got back the following messages:
Selecting previously unselected package msodbcsql.
(Reading database ... 255078 files and directories currently installed.)
Preparing to unpack msodbcsql_13.1.4.0-1_amd64.deb ...
Unpacking msodbcsql (13.1.4.0-1) ...
dpkg: dependency problems prevent configuration of msodbcsql:
msodbcsql depends on unixodbc (>= 2.3.1); however:
Package unixodbc is not installed.
dpkg: error processing package msodbcsql (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
msodbcsql
So I realised I had to install unixodbc, so I've done sudo apt-get install unixodbc getting the following output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
unixodbc : Depends: libodbc1 (>= 2.3.1) but it is not going to be installed
Depends: odbcinst1debian2 (>= 2.3.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
At this point I started trying to remove the "half installed" package and I tried a few different approaches:
This sudo dpkg -r msodbcsql gives:
(Reading database ... 255091 files and directories currently installed.)
Removing msodbcsql (13.1.4.0-1) ...
dpkg: error processing package msodbcsql (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
msodbcsql
This sudo apt-get autoremove gives:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
msodbcsql
0 to upgrade, 0 to newly install, 1 to remove and 10 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 255077 files and directories currently installed.)
Removing msodbcsql (13.1.4.0-1) ...
dpkg: error processing package msodbcsql (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
msodbcsql
E: Sub-process /usr/bin/dpkg returned an error code (1)
This sudo apt-get --purge remove && sudo apt-get autoclean gives:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
msodbcsql
0 to upgrade, 0 to newly install, 1 to remove and 10 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 255077 files and directories currently installed.)
Removing msodbcsql (13.1.4.0-1) ...
dpkg: error processing package msodbcsql (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
msodbcsql
E: Sub-process /usr/bin/dpkg returned an error code (1)
This sudo apt-get -f install gives:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
msodbcsql
0 to upgrade, 0 to newly install, 1 to remove and 10 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 255077 files and directories currently installed.)
Removing msodbcsql (13.1.4.0-1) ...
dpkg: error processing package msodbcsql (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
msodbcsql
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have also tried to look for some wildcards with sudo find / -name *msodbc* in the file system to hope to find a huge binary file and remove it manually, but nothing interesting came out.
I am a bit concerned about this removal as all the previous attempts seem to give back the same error message/code and I don't find a way to either remove that "half installed" package or troubleshoot the issue.
Is there any log file I could have a look or anything else I could do to remove that package?
My Ubuntu details:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
$ uname -a
Linux oe-laptop 4.10.0-37-generic #41~16.04.1-Ubuntu SMP Fri Oct 6 22:42:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux