我有 Ubuntu 14.04。我最近下载了Viber。Viber .deb 文件具有 64 位架构。我想在我的计算机上安装它,但我的计算机仅支持 32 位。
运行输出lscpu
如下:
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
答案1
假设您的硬件支持 64 位,则可以:
CPU 操作模式:32 位,64 位
并且该软件包已准备好使用多架构,这也是事实:
dpkg -I viber.deb
new debian package, version 2.0. <--- here
size 57046082 bytes: control archive=8024 bytes.
0 bytes, 0 lines 0
1210 bytes, 29 lines control
9475 bytes, 33 lines * copyright
7404 bytes, 85 lines md5sums
39 bytes, 2 lines * postinst #!/bin/bash
800 bytes, 35 lines * preinst #!/bin/bash
500 bytes, 24 lines * prerm #!/bin/bash
Package: viber
Version: 4.2.2.6
Section: non-free/net
Priority: extra
Architecture: amd64 <---- and here
您可以只安装必要的 64 位库和二进制文件,这些库和二进制文件是软件包的依赖项(没有依赖项,稍后会详细介绍),而这些依赖项和二进制文件是您运行应用程序所需的,对性能几乎没有影响。就我而言,我刚刚安装了软件包,效果很好:
$ sudo dpkg --add-architecture amd64
## adding 64-bits architecture package, in my system I didn't need to
## but it's likely you have
$ sudo apt-get update # this downloads the package list for amd64 arch
$ sudo dpkg -i viber.deb
Selecting previously unselected package viber.
(Reading database ... 268703 files and directories currently installed.)
Preparing to unpack viber.deb ...
Unpacking viber (4.2.2.6) ...
Setting up viber (4.2.2.6) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for gnome-menus (3.13.3-1) ...
Processing triggers for mime-support (3.56) ...
Processing triggers for desktop-file-utils (0.22-1) ...
然后开始遇到问题......
软件包管理器决定不列出其软件包的任何依赖项,
Installed-Size: 141336
Conflicts: Viber (<< 4.2.2.6)
Replaces: Viber (<< 4.2.2.6)
Maintainer: Viber Media Inc <[email protected]>
他们真正需要的是:
ldd /opt/viber/Viber | grep 'not found'
libXcomposite.so.1 => not found
libxslt.so.1 => not found
libxml2.so.2 => not found
libgstreamer-0.10.so.0 => not found
libgstapp-0.10.so.0 => not found
libgstbase-0.10.so.0 => not found
libgstinterfaces-0.10.so.0 => not found
libgstpbutils-0.10.so.0 => not found
libgstvideo-0.10.so.0 => not found
libsqlite3.so.0 => not found
所以你必须找到并安装缺少的库手动!如果你知道正确的工具,这很容易。apt-file
在这里也很方便http://packages.ubuntu.com“搜索包内容”功能也很好。但我还是继续搜索它们:
这些文件已经安装在我的系统中,你只需要复制包名称,即以 结尾的冒号前面的包名称amd64
。你应该按原样复制包名称:
dpkg -S $(ldd /opt/viber/Viber | awk '{print $3}' | grep -vP 'not|viber')
libc6:amd64: /lib/x86_64-linux-gnu/libpthread.so.0
libc6:amd64: /lib/x86_64-linux-gnu/libdl.so.2
libc6:amd64: /lib/x86_64-linux-gnu/librt.so.1
libstdc++6:amd64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
libc6:amd64: /lib/x86_64-linux-gnu/libm.so.6
libgcc1:amd64: /lib/x86_64-linux-gnu/libgcc_s.so.1
libc6:amd64: /lib/x86_64-linux-gnu/libc.so.6
libx11-6:amd64: /usr/lib/x86_64-linux-gnu/libX11.so.6
libxext6:amd64: /usr/lib/x86_64-linux-gnu/libXext.so.6
zlib1g:amd64: /lib/x86_64-linux-gnu/libz.so.1
libgl1-mesa-glx:amd64: /usr/lib/x86_64-linux-gnu/libGL.so.1
libxrender1:amd64: /usr/lib/x86_64-linux-gnu/libXrender.so.1
libglib2.0-0:amd64: /lib/x86_64-linux-gnu/libglib-2.0.so.0
libglib2.0-0:amd64: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
libxcb1:amd64: /usr/lib/x86_64-linux-gnu/libxcb.so.1
libglapi-mesa:amd64: /usr/lib/x86_64-linux-gnu/libglapi.so.0
libxdamage1:amd64: /usr/lib/x86_64-linux-gnu/libXdamage.so.1
libxfixes3:amd64: /usr/lib/x86_64-linux-gnu/libXfixes.so.3
libx11-xcb1:amd64: /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
libxcb-glx0:amd64: /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0
libxcb-dri2-0:amd64: /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0
libxcb-dri3-0:amd64: /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0
libxcb-present0:amd64: /usr/lib/x86_64-linux-gnu/libxcb-present.so.0
libxcb-sync1:amd64: /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1
libxshmfence1:amd64: /usr/lib/x86_64-linux-gnu/libxshmfence.so.1
libxxf86vm1:amd64: /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1
libdrm2:amd64: /usr/lib/x86_64-linux-gnu/libdrm.so.2
libpcre3:amd64: /lib/x86_64-linux-gnu/libpcre.so.3
libffi6:amd64: /usr/lib/x86_64-linux-gnu/libffi.so.6
libxau6:amd64: /usr/lib/x86_64-linux-gnu/libXau.so.6
libxdmcp6:amd64: /usr/lib/x86_64-linux-gnu/libXdmcp.so.6
我没有安装这些,而是使用以下方法获得的ldd /opt/viber/Viber | grep 'not found' | awk '{printf "%s$\n", $1}' | apt-file search -x -a amd64 -f - | sed 's/\:/:amd64:/'
:
$ ldd /opt/viber/Viber | grep 'not found' | awk '{printf "%s$\n", $1}' | apt-file search -x -a amd64 -f - | sed 's/\:/:amd64:/'
libgstreamer-plugins-base0.10-0:amd64: /usr/lib/x86_64-linux-gnu/libgstapp-0.10.so.0
libgstreamer-plugins-base0.10-0:amd64: /usr/lib/x86_64-linux-gnu/libgstinterfaces-0.10.so.0
libgstreamer-plugins-base0.10-0:amd64: /usr/lib/x86_64-linux-gnu/libgstpbutils-0.10.so.0
libgstreamer-plugins-base0.10-0:amd64: /usr/lib/x86_64-linux-gnu/libgstvideo-0.10.so.0
libgstreamer0.10-0:amd64: /usr/lib/x86_64-linux-gnu/libgstbase-0.10.so.0
libgstreamer0.10-0:amd64: /usr/lib/x86_64-linux-gnu/libgstreamer-0.10.so.0
libsqlite3-0:amd64: /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
libxcomposite1:amd64: /usr/lib/x86_64-linux-gnu/libXcomposite.so.1
libxml2:amd64: /usr/lib/x86_64-linux-gnu/libxml2.so.2
libxslt1.1:amd64: /usr/lib/x86_64-linux-gnu/libxslt.so.1
apt-file
是为了给我 64 位软件包而设的,所以我不得不sudo apt-file -a amd64 update
强制它有 64 位文件列表。
现在,让我解释一下以上内容:
ldd /path/to/binary
:读取二进制文件并告诉您所需的库、符号等。dpkg -S
:搜索哪些软件包提供了特定的安装文件。awk
、sed
和grep
:正在修改文本流以仅处理感兴趣的部分或显示所需的输出。|
,$(...)
:第一个允许我将一个命令的输出传送到另一个命令,后者允许我在执行主命令之前执行/评估一个命令。
TL;dr 只需安装这些包:
sudo dpkg --add-architecture amd64 ## adding 64-bits architecture package
sudo apt-get update
sudo apt-get install libgstreamer-plugins-base0.10-0:amd64 libgstreamer-plugins-base0.10-0:amd64 libgstreamer-plugins-base0.10-0:amd64 libgstreamer-plugins-base0.10-0:amd64 libgstreamer0.10-0:amd64 libgstreamer0.10-0:amd64 libsqlite3-0:amd64 libxcomposite1:amd64 libxml2:amd64 libxslt1.1:amd64 libc6:amd64 libdrm2:amd64 libffi6:amd64 libgcc1:amd64 libgl1-mesa-glx:amd64 libglapi-mesa:amd64 libglib2.0-0:amd64 libpcre3:amd64 libstdc++6:amd64 libx11-6:amd64 libx11-xcb1:amd64 libxau6:amd64 libxcb1:amd64 libxcb-dri2-0:amd64 libxcb-dri3-0:amd64 libxcb-glx0:amd64 libxcb-present0:amd64 libxcb-sync1:amd64 libxdamage1:amd64 libxdmcp6:amd64 libxext6:amd64 libxfixes3:amd64 libxrender1:amd64 libxshmfence1:amd64 libxxf86vm1:amd64 zlib1g:amd64
您还需要安装 64 位内核。
答案2
无法在 32 位操作系统上安装仅支持 64 位架构的软件,反之亦然。要安装 64 位软件,您需要支持 64 位的硬件和在其上运行的 64 位操作系统。
另外我想说的是,在仅支持 32 位架构的硬件上无法安装 64 位操作系统作为虚拟机。您的硬件应该支持 64 位架构以及虚拟化支持,以便创建 64 位虚拟机。
答案3
我不得不说你说得不对
我的电脑仅有的支持 32 位
根据运行的输出,lscpu
您安装的 Ubuntu 版本是 32 位,而您的系统可以支持 64 位应用程序,如果您想安装 64 位应用程序,您必须安装 64 位 Ubuntu 操作系统。请参阅下面几行:
Architecture: i686 # <-- your kernel is 32 bit (32 bit Ubuntu)
CPU op-mode(s): 32-bit, 64-bit # <-- your cpu can handle 32 or 64 bit instructions
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
答案4
阅读有关 32 位 (x86) 和 64 位应用程序的信息:
http://www.techsupportalert.com/content/32-bit-and-64-bit-explained.htm
有时,一个应用程序或单个软件包(一个 .deb 文件)在安装后可能会同时充当两种角色。
即x86 app on x86 OS
x64 app on x64 OS