we can install packages for plural architectures on a debian system .

$ apt-config dump | grep Arch
APT::Architecture "mipsel";
APT::Architectures "";
APT::Architectures:: "mipsel";
APT::Architectures:: "amd64";

( in this situation , my native architecture is mipsel , and i also install packages for amd64 . i run them through qemu binfmt_misc . )

today i want to make the apt dependency resolution algorithm to pull packages for the native architecture whenever possible , and if there is no native choice , foreign .

the apt "Pin" mechanism is the obvious way to go . but pinning by architecure is not implemented yet .

so i want to have a workaround solution for pinning by architecture .

even we have pinning by architecture , we still have to pay attention not to replace critical packages by packages for foreign architectures , which include the init , the shell , and the qemu .

  • "we still have to pay attention not to replace critical packages by packages for foreign architectures". Is that even possible. I think the architecture of multiarch makes it impossible. Would you care to outline a possible scenario? Feb 5, 2015 at 12:46
  • the qemu binfmt is configured by a init script run during boot . anything before that should be native . one minute ago i checked out that aptitude refuses to replace dash , but says okay if i want to install an amd64 version of mount ( native being mipsel ) . @FaheemMitha Feb 5, 2015 at 14:36
  • Interesting. Does that produce a functioning system? If not, it might be considered a bug. Feb 5, 2015 at 15:20

1 Answer 1

  1. we can use different mirrors for different architecture .

    # /etc/apt/sources.list
    deb [ arch=mipsel ] http://1.mirror.debian.org stable main
    deb [ arch=amd64  ] http://2.mirror.debian.org stable main

    then configure pinning by origin .

    # /etc/apt/preferences
    Package: *
    Pin: origin "2.mirror.debian.org"
    Pin-Priority: /* some small number */
  2. we can set up an alternative dns record pointing to the mirror . like amd64.mirror.my.own.domain cname 1.mirror.debian.org . sometimes the http server is sensitive for the host header . but it is possible that the server only checks for the suffix of the request domian name as if a.b.c is a legal host name , we may try access it by any.prefix.a.b.c .

  3. we can set up a reverse proxy to the mirror .

  • i'm not sure what is the right priority to set . 100 seems to work in my situation . Feb 5, 2015 at 11:23
  • anything 100<= P <500 should do, see man apt_preferences.
    – Ben
    Dec 21, 2017 at 17:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .