[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: amd64 as default architecture



Guillem Jover <guillem@debian.org> writes:

> On Sun, 2012-05-20 at 14:03:35 +0200, David Kalnischkies wrote:
>> On Sun, May 20, 2012 at 1:10 PM, Sven Joachim <svenjoac@gmx.de> wrote:
>> > On 2012-05-20 11:27 +0200, Goswin von Brederlow wrote:
>> > > Slightly OT but I wanted to mention it for its similarity:
>> > >
>> > > One thing that should be tested and then documented prominently as yay
>> > > or nay in the wheezy upgrade notes is wether one can cross-grade from
>> > > i386 to amd64 using multiarch. Wether one can install apt/dpkg:amd64 and
>> > > then migrate to a 64bit userspace.
>> >
>> > Won't work in wheezy, apt does not support crossgrades�.

Why? What breaks? Any bugs filed yet?

I'm sure you are right that it currently doesn't work out of the box. I
don't agree with killing this for wheezy without having some idea of how
much breakage is involed though. I've seen reports from other people
that have done crossgrades in the past with some handholding so it isn't
impossible.

Testing (see below) shows that there is one big issue, namely that
crossgrading wants to remove the package before installing the new
one. Everything else seems to be minor and package specific issues (like
dash trying to overwrite its diversion). But testing on a minimal chroot
is hardly conclusive so if you know other issues then feel free to speak
up.

>> There is no real reason to require apt to do the heavy lifting here.
>> It would be nice, but it is a one-time action, so a specialized tool wouldn't
>> hurt muscle memory too much. Install essentials and apt and you should
>> be good to go to proceed as usual, just with a different architectureâ?¦
>
> I disagree that this is a one-time action, people might want to
> cross-grade specific packages back and forth, not just the entire
> installation. Also unsafe cross-grade does not only affect the
> Essential set, it also affects anything involved in the boot process,
> if for whatever reason the system crashes and apt would have removed
> such package the system would be rendered unbootable.

Crossgrading a single package should already work. That is just normal
multiarch stuff. As long as the dependencies are resolved, which
multiarch does, there should be no problem. All assuming the package
doesn't have architecture specific data that will break (like git-svn).

Except with the essential set you don't always have dependencies. But
I'm not concerned there. You always have depends on libraries through
the shlibs/symbols files and everything else is (or should be)
Multi-Arch: foreign and work in any arch.

>> Even most essentials are easy to crossgrade, the only really difficult one
>> is dpkg and it's dependencies as you have to take care of not breaking it
>> while it crossgrades itself.
>
> I guess I don't see the additional complexity in the dpkg specific
> case, it just needs the shared libraries to be installed which should
> be co-installable anyway, and the rest being M-A:foreign.

The complexity in dpkg (and apt) is the metadata. When crossgrading
apt/dpkg the notion of native and foreign architecture switches and that
impacts /var/lib/dpkg/info/ and the handling of Arch:all packages.

So lets test this:

cdebootstrap -v sid sid http://ftp.debian.org/
# dpkg --add-architecture i386
# apt-get update
# apt-get install apt:i386 dpkg:i386
Reading package lists... Done
Building dependency tree... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 apt:i386 : Depends: debian-archive-keyring:i386 but it is not installable
E: Unable to correct problems, you have held broken packages.

Doh, debian-archive-keyring isn't Multi-Arch: foreign (yet). Lets fix
that and try again:

# apt-get install apt:i386 dpkg:i386
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  gcc-4.7-base:i386 libapt-pkg4.12:i386 libbz2-1.0:i386 libc6:i386
  libc6-i686:i386 libgcc1:i386 libselinux1:i386 libstdc++6:i386 zlib1g:i386
Suggested packages:
  aptitude:i386 synaptic:i386 wajig:i386 dpkg-dev:i386 apt-doc:i386
  python-apt:i386 glibc-doc:i386 locales:i386
The following packages will be REMOVED:
  apt dpkg
The following NEW packages will be installed:
  apt:i386 dpkg:i386 gcc-4.7-base:i386 libapt-pkg4.12:i386 libbz2-1.0:i386
  libc6:i386 libc6-i686:i386 libgcc1:i386 libselinux1:i386 libstdc++6:i386
  zlib1g:i386
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  apt dpkg
0 upgraded, 11 newly installed, 2 to remove and 0 not upgraded.
Need to get 10.3 MB of archives.
After this operation, 16.1 MB of additional disk space will be used.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?] 
Get:1 http://ftp.debian.org/debian/ sid/main gcc-4.7-base i386 4.7.0-11 [140 kB]
Get:2 http://ftp.debian.org/debian/ sid/main libgcc1 i386 1:4.7.0-11 [53.3 kB]
Get:3 http://ftp.debian.org/debian/ sid/main libc6 i386 2.13-32 [3920 kB]
Get:4 http://ftp.debian.org/debian/ sid/main libbz2-1.0 i386 1.0.6-1 [45.8 kB]
Get:5 http://ftp.debian.org/debian/ sid/main libselinux1 i386 2.1.9-4 [90.4 kB]
Get:6 http://ftp.debian.org/debian/ sid/main zlib1g i386 1:1.2.7.dfsg-11 [90.9 kB]
Get:7 http://ftp.debian.org/debian/ sid/main dpkg i386 1.16.3 [2340 kB]
Get:8 http://ftp.debian.org/debian/ sid/main libstdc++6 i386 4.7.0-11 [347 kB]
Get:9 http://ftp.debian.org/debian/ sid/main libapt-pkg4.12 i386 0.9.5.1 [882 kB]
Get:10 http://ftp.debian.org/debian/ sid/main libc6-i686 i386 2.13-32 [1242 kB]
Get:11 http://ftp.debian.org/debian/ sid/main apt i386 0.9.5.1 [1119 kB]
Fetched 10.3 MB in 6s (1553 kB/s)                                              
debconf: delaying package configuration, since apt-utils is not installed
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 6615 files and directories currently installed.)
Removing apt ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Selecting previously unselected package gcc-4.7-base:i386.
(Reading database ... 6464 files and directories currently installed.)
Unpacking gcc-4.7-base:i386 (from .../gcc-4.7-base_4.7.0-11_i386.deb) ...
Selecting previously unselected package libgcc1:i386.
Unpacking libgcc1:i386 (from .../libgcc1_1%3a4.7.0-11_i386.deb) ...
Selecting previously unselected package libc6:i386.
Unpacking libc6:i386 (from .../libc6_2.13-32_i386.deb) ...
Selecting previously unselected package libbz2-1.0:i386.
Unpacking libbz2-1.0:i386 (from .../libbz2-1.0_1.0.6-1_i386.deb) ...
Selecting previously unselected package libselinux1:i386.
Unpacking libselinux1:i386 (from .../libselinux1_2.1.9-4_i386.deb) ...
Selecting previously unselected package zlib1g:i386.
Unpacking zlib1g:i386 (from .../zlib1g_1%3a1.2.7.dfsg-11_i386.deb) ...
Can not write log, openpty() failed (/dev/pts not mounted?)
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: warning: overriding problem because --force enabled:
 This is an essential package - it should not be removed.
dpkg: dpkg: dependency problems, but removing anyway as you requested:
 readline-common depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 util-linux depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 gzip depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 findutils depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 grep depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 gnupg depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 sed depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 diffutils depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 perl-base depends on dpkg (>= 1.14.20).
 coreutils depends on dpkg (>= 1.15.4) | install-info; however:
  Package dpkg is to be removed.
  Package install-info is not installed.
 dash depends on dpkg (>= 1.15.0).
(Reading database ... 6773 files and directories currently installed.)
Removing dpkg ...
Can not write log, openpty() failed (/dev/pts not mounted?)
Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)



Yeah, removing dpkg, even temporary, is not a good idea. A crossgrade of
essential packages has to work without removing them.


# Unpack the new dpkg by hand.
# dpkg --configure -a
# dpkg -i /var/cache/apt/archives/dpkg_1.16.3_i386.deb
# dpkg -i /var/cache/apt/archives/libapt-pkg4.12_0.9.5.1_i386.deb /var/cache/apt/archives/libstdc++6_4.7.0-11_i386.deb /var/cache/apt/archives/apt_0.9.5.1_i386.deb 
# apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Correcting dependencies... Done
The following extra packages will be installed:
  insserv libdb5.1 liblocale-gettext-perl libpam-modules libpam0g
  libtext-charwidth-perl libtext-iconv-perl perl-base sysvinit-utils
Suggested packages:
  bootchart2 libpam-doc perl sash
The following packages will be REMOVED:
  e2fsprogs:amd64 initscripts:amd64 insserv:amd64 liblocale-gettext-perl:amd64
  libtext-charwidth-perl:amd64 libtext-iconv-perl:amd64 perl-base:amd64
  sysvinit:amd64 sysvinit-utils:amd64 util-linux:amd64
The following NEW packages will be installed:
  insserv libdb5.1 liblocale-gettext-perl libpam-modules libpam0g
  libtext-charwidth-perl libtext-iconv-perl perl-base sysvinit-utils
0 upgraded, 9 newly installed, 10 to remove and 0 not upgraded.
Need to get 2926 kB of archives.
After this operation, 1794 kB disk space will be freed.
Do you want to continue [Y/n]?
# apt-get install e2fsprogs initscripts insserv liblocale-gettext-perl libtext-charwidth-perl libtext-iconv-perl perl-base sysvinit sysvinit-utils util-linux
...


# apt-get install bash
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  base-files bash-completion dash
Suggested packages:
  bash-doc
The following packages will be REMOVED:
  dash:amd64
The following NEW packages will be installed:
  base-files bash bash-completion dash
0 upgraded, 4 newly installed, 1 to remove and 0 not upgraded.


Interestingly enough apt has no problem with removing an essential
package from a foreign architecture. In this case though it breaks
because the diversion handling in bash/dash is broken for crossgrades:

Removing dash ...
Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
dpkg-divert: error: rename involves overwriting `/bin/sh' with
  different file `/bin/sh.distrib', not allowed
dpkg: error processing dash (--remove):
 subprocess installed pre-removal script returned error exit status 2



Overall the one MAJOR showstopped seems to be that apt/dpkg can't
crossgrade a package without removing it. At least for packages with
Multi-Arch: foreign (only dpkg has that) a crossgrade should work
without removing the other package.

So the problem lies somewhere other than expected.

MfG
        Goswin


Reply to: