Ubuntu – Ubuntu 20.04: install both 32 bit and 64 bit libraries

32-bit64-bitdependenciesmultiarch

(Ubuntu 20.04)

My (newbie) server is configured for both 32 and 64 bit architecture:

dpkg --print-architecture

amd64

dpkg --print-foreign-architectures

i386

However, I can't seem to have both 32 bit and 64 bit of the same library which apps depend on.

apt-get install libodbc1:i386

apt-get install libodbc1

When I install one, the other is removed. When I install the 32 bit version, apps (Plesk, VS Code) that need the 64 bit version break, and when I install the 64 bit version, apps (WineHQ) that need the 32 bit version break. How do I install both to make all apps work?

UPDATE

When I run the following, I get the following:

sudo apt install libodbc1 libodbc1:i386

The following packages have unmet dependencies:
 libodbc1 : Breaks: libodbc1:i386 (!= 2.3.7) but 2.3.6-0.1build1 is to be installed
 libodbc1:i386 : Breaks: libodbc1 (!= 2.3.6-0.1build1) but 2.3.7 is to be installed
E: Unable to correct problems, you have held broken packages.

And, when I run the following, I get the following:

apt policy libodbc1

libodbc1:
  Installed: 2.3.7
  Candidate: 2.3.7
  Version table:
 *** 2.3.7 500
        500 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages
        100 /var/lib/dpkg/status
     2.3.6-0.1build1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

Best Answer

I was using a newer version of libodbc1 by Microsoft which was not compatible with libodbc1:i386. I disabled Microsoft packages URL, and downgraded libodbc1 to version 2.3.6-0.1build1, and libodbc1:i386 installed just fine. Everything seems to be working now. I just hope Microsoft products don't break in the future.

Related Question