Sunday, November 18. 2012
Debian Multiarch is a new feature for the next version of this popular Linux distribution, in short, it lets a debian box to have binaries of more than one architecture (the most common situation is having amd64 and i386 in the same OS in order to run x64 and x32 applications). As you now I use amd64 testing in my laptop and desktop box and today I have decided to start installing some i386 packages.
Debian announced Multiarch enhancement for the next release (wheeze) in July. I was reluctant to use it at first time cos normally all packages are compiled for both architectures and I do not want them to be duplicated in my box. Nevertheless some months ago I realized that wine had been removed from native amd64 and it had been integrated using i386 and the multiarch feature (since then the amd64 wine package depends on several i386 packages). I suppose that wine has some 32bit tricks which make easier to integrate its i386 implementation. At that moment I just uninstalled it from my system. But some days ago I found that the new version of skype is only distributed in i386 using again the Wheezy multiarch infrastructure. Finally I surrendered and changed my mind under the weight of reality.
The steps to add i386 architecture, skype (4.1 package) and wine in my amd64 laptop were the following:
Add the new architecture i386 to the system.
# dpkg --add-architecture i386 # dpkg --print-architecture amd64 # dpkg --print-foreign-architectures i386
Now amd64 is the native architecture in my system but i386 is also defined as a foreign one. You can remove any foreign architecture using the remove-architecture option for dpkg.
Remove the current (amd64) skype package.
# apt-get remove skype Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: skype 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 35.5 MB disk space will be freed. Do you want to continue [Y/n]? y (Reading database ... 177126 files and directories currently installed.) Removing skype ... Processing triggers for gnome-menus ... Processing triggers for desktop-file-utils ...
Remove any 32 bit package inside the amd64 architecture. Before the multiarch feature, debian provided several amd64 packages with some important libraries compiled in 32 bits, now they are not needed cos real i386 packages are going to be installed. For that I decided to remove the base, libc6-i386 package, and by consequence all the rest will be auto-removed.
# apt-get remove libc6-i386 Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: ia32-libs ia32-libs-dev ia32-libs-gtk lib32asound2 lib32bz2-1.0 lib32gcc1 lib32ncurses5 lib32nss-mdns lib32stdc++6 lib32tinfo5 lib32v4l-0 lib32z1 libc6-i386 0 upgraded, 0 newly installed, 13 to remove and 0 not upgraded. After this operation, 167 MB disk space will be freed. Do you want to continue [Y/n]? y (Reading database ... 176985 files and directories currently installed.) Removing ia32-libs-gtk ... Removing ia32-libs-dev ... Removing ia32-libs ... Removing lib32asound2 ... Removing lib32bz2-1.0 ... Removing lib32stdc++6 ... Removing lib32gcc1 ... Removing lib32ncurses5 ... Removing lib32nss-mdns ... Removing lib32tinfo5 ... Removing lib32v4l-0 ... Removing lib32z1 ... Removing libc6-i386 ...
Check what packages the skype deb file requires.
# dpkg -I skype-debian_22.214.171.124-1_i386.deb new debian package, version 2.0. size 30688192 bytes: control archive=4629 bytes. 32 bytes, 1 lines conffiles 1079 bytes, 20 lines control 9835 bytes, 137 lines md5sums Package: skype Version: 126.96.36.199-1 Section: non-free/net Priority: extra Architecture: i386 Depends: libasound2 (>= 1.0.16), libc6 (>= 2.3.6-6~), libc6 (>= 2.7), libgcc1 (>= 1:4.1.1), libqt4-dbus (>= 4:4.5.3), libqt4-network (>= 4:4.8.0), libqt4-xml (>= 4:4.5.3), libqtcore4 (>= 4:4.7.0~beta1), libqtgui4 (>= 4:4.8.0), libqtwebkit4 (>= 2.1.0~2011week13), libstdc++6 (>= 4.6), libx11-6, libxext6, libxss1, libxv1, libssl1.0.0 Conflicts: skype-mid, skype-common, skype-bin Replaces: skype-mid, skype-common, skype-bin Installed-Size: 35952 Maintainer: Skype Technologies
Description: Wherever you are, wherever they are Skype keeps you together. Call, see, message and share with others. · It's free to download and join. · Call, instant message and send photos and documents to anyone else on Skype. · And with a webcam you can catch up face-to-face with a video call. · Call mobiles and landlines worldwide at low rates. · Easily text message anywhere in the world. · Get your friends together on a conference call. And that's just the start...
Install them using apt-get (the multiarch feature adds to apt-get command the possibility of marking the architecture at install time, if no one is specified the default one is used).
# apt-get install libasound2:i386 libc6:i386 libgcc1:i386 libqt4-dbus:i386 libqt4-network:i386 libqt4-xml:i386 libqtcore4:i386 libqtgui4:i386 libqtwebkit4:i386 libstdc++6:i386 libx11-6:i386 libxss1:i386 libxv1:i386 libssl1.0.0:i386
It seems that the libqtwebkit4 dependency package has a conflicting bug when installing both packages (amd64 and i386) and the installation needs to be forced.
# apt-get install -f -o Dpkg::Options::="--force-overwrite" libqtwebkit4:i386
Install the skype debian multiarch package (now no dependency problem should be found).
# dpkg -i skype-debian_188.8.131.52-1_i386.deb Selecting previously unselected package skype. (Reading database ... 175638 files and directories currently installed.) Unpacking skype (from skype-debian_184.108.40.206-1_i386.deb) ... Setting up skype (220.127.116.11-1) ... Processing triggers for gnome-menus ... Processing triggers for desktop-file-utils ...
Finally I also added wine (as it is distributed by debian, installation adds all the i386 needed packages by its own).
# apt-get install wine
And that's all. I tend to be quite stubborn but, you know, sometimes going with the flow is much easier (nevertheless I will try to be very restrictive with i386 packages).
That error means the apt-get doesn't find the libasound2:i386 package. Are you using Debian wheezy? This entry was done in my wheezy laptop and the package is still found here:
$ apt-cache showpkg libasound2:i386
1.0.25-4 (/var/lib/apt/lists/ftp.debian.org_debian_dists_testing_main_binary-i386_Packages) (/var/lib/dpkg/status)
r@prime:~$ sudo apt-get install libasound2:i386
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
НОВЫЕ пакеты, которые будут установлены:
обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
Необходимо скачать 0 B/463 kB архивов.
После данной операции, объём занятого дискового пространства возрастёт на 1.322 kB.
(Чтение базы данных … на данный момент установлено 135267 файлов и каталогов.)
Распаковывается пакет libasound2:i386 (из файла …/libasound2_1.0.25-4_i386.deb) …
dpkg: ошибка при обработке параметра /var/cache/apt/archives/libasound2_1.0.25-4_i386.deb (--unpack):
попытка перезаписать общий «/usr/share/alsa/alsa.conf», который отличается от других экземпляров пакета libasound2:i386
При обработке следующих пакетов произошли ошибки:
E: Sub-process /usr/bin/dpkg returned an error code (1)
Usually this is a bug in the distribution packages, I suppose you're using ubuntu or any other derivatives and not debian (that's why it didn't happen to me). Try using the --force-overwrite option like I did with libqtwebkit4.
Its so hard to read the text!