aptitude/apt-get/dpkg + multiarch

Asked by Sergey Romanov

I'm trying to understand how package management tools work in a multiarch environment. My sources are
http://wiki.debian.org/Multiarch and https://wiki.ubuntu.com/MultiarchSpec

My current understanding is that when specifying a package w/o architecture qualifier, apt-get/aptitude will always affect only packages for the native architecture and packages with Architecture: all, and in order to install/remove/purge a package for foreign architecture, its architecture should be explicitly specified (apt-get install package:i386, aptitude remove package:i386, dpkg -P package:i386

Am I right?

I see that apt-get/apt-mark/aptitude accept :any not only in Depends:/BuildDepends: as the mulitarch specification requires, but also in package specification on command line (and in the case of aptitude also as a search term).

Questions:

Will 'apt-get remove package:any' remove all sibling packages for different architectures
or is it equivalent to 'apt-get remove package' and :any simply gets discarded?

Will 'apt-mark hold package:any' set on hold both package:amd64 and package:i386 or it is the same as
'apt-mark hold package' and will only lock package for the native architecture?

Is aptitude purge '~npackage~rany' equivalent to
aptitude purge '~npackage(~rnative|~rforeign)' or to
aptitude purge '~npackage' or neither?

I was trying to be helpful on ubuntuforums and wrote two lengthy posts about holding up / purging packages from 3rd party repositories:
http://ubuntuforums.org/showthread.php?t=2130529&p=12583941
http://ubuntuforums.org/showthread.php?t=2128138&p=12568872

But now, I'm not sure all my suggestions there would work as intended. They work on my system (Debian wheezy amd64), but I use no packages for i386, so it's difficult to spot the difference.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
Sergey Romanov
Solved:
Last query:
Last reply:
Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#1

Hi Sergey Romanov ,
multiarch support is useful only when the package you want to install is not available for the specific architecture.

Multiarch now is implemented by default in Ubuntu 12.04 and newer and is not necessary to install the package(multiarch) separately.

There is no significant difference between the commands you wrote , but there is a difference when the package is not available in the specific arch.

So if you (for example) hold a package with

echo "package name" hold | sudo dpkg --set-selections

then it will hold both architectures. (because multiarch is already enabled).

This is my understanding. Of course you can always test the commands and see the results.

Regards
 NikTh

Revision history for this message
Sergey Romanov (sml-uni) said :
#2

Probably I wasn't clear enough. I know that multiarch is already impemented. In fact, this is why I'm asking. Please, have a look at the last two links I provided.

/So if you (for example) hold a package with

echo "package name" hold | sudo dpkg --set-selections

then it will hold both architectures. (because multiarch is already enabled)./

This is *not* how I understand the multiarch specification. My understanding is that this would put on hold only packages for the native architecture. Otherwise, It would break compatibility with multiarch-unaware applications.

/Of course you can always test the commands and see the results./
Unfortunately, I cannot test it as I don't have any foreign architecture packages installed.

Revision history for this message
Sergey Romanov (sml-uni) said :
#3

Okey, I've done the test. The results are mixed.
$ dpkg --get-selections|grep ^libavutil51
libavutil51:amd64 install
libavutil51:i386 install
$ echo libavutil51 hold|sudo dpkg --set-selections
dpkg: error: illegal package name at line 1: ambiguous package name 'libavutil51' with more than one installed instance
$ dpkg --get-selections|grep ^libavutil51
libavutil51:amd64 install
libavutil51:i386 install
$ sudo apt-mark hold libavutil51
libavutil51 set on hold.
$ dpkg --get-selections|grep ^libavutil
libavutil51:amd64 hold
libavutil51:i386 install
$ dpkg --get-selections|sed -n '/^libavutil/s/hold$/install/p'|sudo dpkg --set-selections
$ dpkg --get-selections|grep ^libavutil
libavutil51:amd64 install
libavutil51:i386 install
$ sudo apt-mark hold libavutil51:any
libavutil51 set on hold.
$ dpkg --get-selections|grep ^libavutil
libavutil51:amd64 hold
libavutil51:i386 install
$ sudo apt-mark hold libavutil51:native
libavutil51 was already set on hold.
$ sudo apt-mark unhold libavutil51:native
Canceled hold on libavutil51.
$ dpkg --get-selections|grep ^libavutil
libavutil51:amd64 install
libavutil51:i386 install
$ aptitude search libavutil51
i A libavutil51 - Libav utility library
i libavutil51:i386 - Libav utility library
$ sudo aptitude -q=2 hold libavutil51
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
$ aptitude search libavutil51
ihA libavutil51 - Libav utility library
i libavutil51:i386 - Libav utility library
$ sudo aptitude -q=2 hold ~nlibavutil51
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
$ aptitude search libavutil51
ihA libavutil51 - Libav utility library
ih libavutil51:i386 - Libav utility library
$ sudo aptitude -q=2 unhold ~nlibavutil51~rnative
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
c$ aptitude search libavutil51
i A libavutil51 - Libav utility library
ih libavutil51:i386 - Libav utility library