Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Installing 32-bit Packages on Ubuntu 14.04

DZone's Guide to

Installing 32-bit Packages on Ubuntu 14.04

Need to install 32-bit packages on Ubuntu 14.04? These quick code snippets will get you up and running.

· Integration Zone
Free Resource

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

This had me stumped for a bit, so I've written it down. If you have a 64 bit version of Ubuntu and want to install a 32-bit package, you simply add :i386 to the end of the package name like this:

$ sudo apt-get install libstdc++6:i386

However, this didn't initially work for me as apt-get couldn't find the package:

$ sudo apt-get install libstdc++6:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libstdc++6
E: Couldn't find any package by regex 'libstdc++6'

It turned out that my installation only had the 64 bit architecture configured which you can tell by running:

$ sudo dpkg --print-architecture
amd64
$ sudo dpkg --print-foreign-architectures

Note that there are no foreign architectures, which is the problem.

The solution is to add the i386 architecture first:

$ sudo dpkg --add-architecture i386
$ sudo dpkg --print-foreign-architectures
i386

That's better! Now we need to run an update:

$ sudo apt-get update

Don't forget this update! I did and wondered why I still had the problem…

Now the installation of the 32-bit package works:

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

Topics:
32-bit ,ubuntu

Published at DZone with permission of Rob Allen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}