I have Ubuntu 14.04. I recently downloaded Viber. The Viber .deb file has 64-bit architecture. I want to install it on my computer, but my computer only supports 32-bit.
The output of running lscpu
is as follows:
Architecture: i686
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 2
Socket(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 23
Stepping: 10
CPU MHz: 2800.000
BogoMIPS: 5586.12
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 2048K
Provided that your hardware support 64-bits, which does:
and the package was prepared to use multiarch, which is also true:
you could just install the necessary 64-bit libraries and binaries which are dependency of the package (which is none, more about that later) that you need to run the application, with virtual zero performance impact. In my case, I just installed the package just fine:
And then started running into problems...
The package managers decided that they should not list any dependency for their package,
which they actually need:
so you must find and install the libraries missing manually! This is easy if you know the correct tools.
apt-file
comes handy here, also http://packages.ubuntu.com functionality "Search the contents of packages" comes fine also. But I went ahead and searched for them:These files are already installed in my system, you only need to copy the package name, the one before the colon that ends with
amd64
. You should copy the package names as they are:These I didn't had them installed, which I obtained using
ldd /opt/viber/Viber | grep 'not found' | awk '{printf "%s$\n", $1}' | apt-file search -x -a amd64 -f - | sed 's/\:/:amd64:/'
:apt-file
was a tease to give me the 64-bit packages so I had to dosudo apt-file -a amd64 update
to force it to have the 64-bit file list.Now, let me explain what is all the above:
ldd /path/to/binary
: reads a binary and tells you what are the required libraries, symbols, etc.dpkg -S
: search which packages provide a specific installed file.awk
,sed
andgrep
: are modifying the text stream to process only the interesting parts or show the desired output.|
,$(...)
: the first allows me to pipe the output of a command to another, and the later allows me to execute/evaluate a command before the main ones gets executed.TL;dr just install these packages:
You also need to install the 64-bit kernel.
It is not possible to install a software which support only 64 bit arch on a 32 bit OS whereas the reverse is true. In order to install a 64 bit software you will need a hardware which support 64 bit and a 64 bit OS running on the top of it.
Also I would like to mention that it is not possible to install 64 Bit OS as a Virtual machine on a hardware which support only 32 bit architecture. Your hardware should support 64 Bit architecture along with virtualization support in order to create 64 Bit virtual machines.
You can install 64 bit software on a machine built with 32 bit hardware in the same way you can run say ARM software on an x86 target, using dynamic translation.
Basically, a piece of software such as qemu sits in-between the programs and your computer, performing a translation from the AMD64 instruction set to the x86 (probably i686) one (with a very severe performance hit admittedly, which in your case could be totally avoidable).
Given you are using ubuntu you have an excellent piece of documentation on how to set this up. Basically you have one of two choices, you can either run the program in a complete 64 bit VM environment with its own kernel or, what I think you want here is user-space visualization, this uses thunking (I do not think it is commonly called thunking these days but forget the new word) to translate system calls from 64 bit to 32 bit so that you can use your own kernel.
Now the guide explains this better than me, but in short you need to install qemu and the qemu-kvm-extras-static packages then use the qemu-debootstrap to setup an environment and libraries for your 64 bit program. Then you need to use binfmt_misc and the static qemu interpreter (qemu-arch-static, in your case probably x86_64, x64 or AMF64) to run your program inside it's environment.
Note that however, your CPU seems to support 64 bit instructions so it may be possible for you to install 64 bit ubuntu, you can without any emulation run x86 code on an AMD64 machine and if you are able to do this it may be easier, if on the other hand you want to discover qemu and the world of architecture emulation (may come in hand later if you get a program built for say... ARM such as something built for a phone) I recommend you go on ahead but beware, things sometimes take a little fiddling or debugging before they will work nicely.
I have to say you are not true about
According to the output of running
lscpu
your Ubuntu version that installed is 32 bit while Your system can support 64 bit application if you want to install 64 bit application you have to install 64 bit of Ubuntu OS. see this lines below:Download and install 64 bit Ubuntu 14.04.1 and then install Viber as well.
Read about 32 bit (x86) and 64 bit applications:
http://www.techsupportalert.com/content/32-bit-and-64-bit-explained.htm
Sometimes it is possible that an application or single package [one .deb file] act as both after installation.
ie,
x86 app on x86 OS
andx64 app on x64 OS
If you are running 32bit system use
sudo dpkg --force-architecture -i viber.deb
link: How to Install Viber on Ubuntu 13.10, 32bit