当我尝试安装 32 位库时,apt-get install liblua5.2:i386
apt 警告将卸载许多必要的 64 位软件包。其中一些将被 32 位版本替换,但其他版本不会被替换。
32 位和 64 位软件包不是应该能够并行工作吗?该系统是 Ubuntu 14.04 64 位,并且 kde-plasma-desktop、kde-workspace、build-essential、gcc-4.8 等基本软件包预计将被删除。
这是包及其依赖项的设计错误吗?
The following packages will be REMOVED
build-essential cpp cpp-4.8 g++ g++-4.8 gcc gcc-4.8 gcc-4.8-multilib
gcc-multilib kde-plasma-desktop kde-workspace kde-workspace-bin libbonobo2-0
libbonoboui2-0 libgnome2-0 libgnome2-bin libgnome2-perl libgnomeui-0
libidl-common libidl0 liblua5.2-rrd-dev liblua5.2-rrd0 liborbit2 librrd4
libtool php5-dev shutter x11-apps x11-session-utils x11-xserver-utils
完整输出:
The following extra packages will be installed:
gcc-4.8-base gcc-4.8-base:i386 lib32asan0 lib32atomic1 lib32gcc-4.8-dev
lib32gomp1 lib32itm1 lib32quadmath0 libasan0 libatomic1 libc6-dev:i386
libdbi1:i386 libgcc-4.8-dev libgfortran3 libgomp1 libitm1 libquadmath0
libreadline-dev:i386 libreadline6-dev:i386 librrd4:i386 libstdc++-4.8-dev
libstdc++6 libstdc++6:i386 libtinfo-dev:i386 libtsan0 libx32asan0
libx32atomic1 libx32gcc-4.8-dev libx32gomp1 libx32itm1 libx32quadmath0
linux-libc-dev linux-libc-dev:i386
Suggested packages:
glibc-doc:i386 manpages-dev:i386 libstdc++-4.8-doc
Recommended packages:
gcc:i386 c-compiler:i386 ttf-dejavu:i386 ttf-bitstream-vera:i386
The following packages will be REMOVED
build-essential cpp cpp-4.8 g++ g++-4.8 gcc gcc-4.8 gcc-4.8-multilib
gcc-multilib kde-plasma-desktop kde-workspace kde-workspace-bin libbonobo2-0
libbonoboui2-0 libgnome2-0 libgnome2-bin libgnome2-perl libgnomeui-0
libidl-common libidl0 liblua5.2-rrd-dev liblua5.2-rrd0 liborbit2 librrd4
libtool php5-dev shutter x11-apps x11-session-utils x11-xserver-utils
The following NEW packages will be installed
libc6-dev:i386 libdbi1:i386 liblua5.2-0:i386 liblua5.2-0-dbg:i386
liblua5.2-dev:i386 liblua5.2-rrd-dev:i386 liblua5.2-rrd0:i386
libreadline-dev:i386 libreadline6-dev:i386 librrd4:i386 libtinfo-dev:i386
linux-libc-dev:i386
The following packages will be upgraded:
gcc-4.8-base gcc-4.8-base:i386 lib32asan0 lib32atomic1 lib32gcc-4.8-dev
lib32gomp1 lib32itm1 lib32quadmath0 libasan0 libatomic1 libgcc-4.8-dev
libgfortran3 libgomp1 libitm1 libquadmath0 libstdc++-4.8-dev libstdc++6
libstdc++6:i386 libtsan0 libx32asan0 libx32atomic1 libx32gcc-4.8-dev
libx32gomp1 libx32itm1 libx32quadmath0 linux-libc-dev
26 to upgrade, 12 to newly install, 30 to remove and 316 not to upgrade.
Need to get 12.1 MB of archives.
After this operation, 73.3 MB disk space will be freed.
Do you want to continue? [Y/n]
答案1
尝试apt-get install liblua5.2-0:i386
一下;没有liblua5.2
软件包,因此apt-get install liblua5.2:i386
正在尝试安装liblua5.2-dev:i386
,liblua5.2-0-dbg:i386
和liblua5.2-0:i386
。包-dev
是导致删除的包。
发生搜索扩展是因为给定的包名称包含.
;来自apt-get
的手册:
如果没有包与给定表达式匹配,并且该表达式包含“.”、“?”之一或 '*' 则假定它是 POSIX 正则表达式,并且它应用于数据库中的所有包名称。然后安装(或删除)所有匹配项。请注意,匹配是通过子字符串完成的,因此“lo.*”匹配“how-lo”和“lowest”。如果不希望出现这种情况,请使用“^”或“$”字符锚定正则表达式,或者创建更具体的正则表达式。
所以你可以通过运行来避免这种情况
apt-get install ^liblua5.2:i386$
(正确地失败了)。这条规则显然具有普遍适用性;根据我所看到的,apt-get
如果包名称与包名称不完全匹配,即使表达式不包含.
,?
或,也会尝试使用包名称作为正则表达式*
。