2

Starting yesterday, I cannot upgrade my Ubuntu installation. When running sudo apt-get upgrade I got an error:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 unixodbc : Depends: odbcinst1debian2 (>= 2.3.11) but it is not installed
            Depends: libodbc1 (>= 2.3.11) but it is not installed
 unixodbc-dev : Depends: odbcinst1debian2 (= 2.3.11) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Running sudo apt --fix-broken install gave me an error.

Installing those packages manually with sudo apt-get install -y libodbc1 was not helpful.

According to this it could be related to Microsoft SQL server, that I was investigating for testing purposes but quite a time ago. Using solutions from here was not helpful (same error).

The output of sudo apt update:

Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://fr.archive.ubuntu.com/ubuntu jammy InRelease                                                                                                                     
Hit:3 http://fr.archive.ubuntu.com/ubuntu jammy-updates InRelease                                                                                                                   
Hit:4 http://packages.microsoft.com/repos/code stable InRelease                                                                                                                     
Hit:5 http://fr.archive.ubuntu.com/ubuntu jammy-backports InRelease                                                                     
Get:6 https://packages.microsoft.com/ubuntu/20.04/mssql-server-preview focal InRelease [7 383 B]                                        
Hit:7 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease                                                  
Get:8 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]        
Hit:9 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease                   
Hit:10 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu jammy InRelease
Hit:11 https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu jammy InRelease
Fetched 118 kB in 1s (94,7 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
19 packages can be upgraded. Run 'apt list --upgradable' to see them.

I have Ubuntu 22.04.2 LTS.

1 Answers1

1

I had the same issue, microsoft odbc repos were causing it.

  • I removed/commented from sources list all references to microsoft repos ( a bit overkill but one can add again one repo at a time when the sytem is updated and upgraded. The culprit for me was the mssql-server repo )
  • sudo apt update
  • then I removed all packages using ms odbc : sudo apt-get remove unixodbc msodbcsql17 msodbcsql18 unixodbc-dev mssql-tools mssql-tools18
  • sudo apt update & sudo apt upgrade

Obviously this solution is ok for those like me who don't use ms odbc anymore ( didn't manage to make it work though ). If you have to keep ms odbc clean and updated, good luck.