add architecture i386 debian

Multiarch позволяет вам устанавливать пакеты, предназначенные для различных архитектур на одну и ту же машину. Это полезно для различных задач, но наиболее общая задача — установка 64 и 32-битных программ на одной машине с автоматическим разрешением зависимостей. В общем, вы можете иметь библиотеки более чем одной архитектуры установленные вместе и приложения для той или иной архитектуры, установленные как альтернативы. Заметьте что при этом не обязательно версии приложений под различные архитектуры должны быть установлены вместе.

Чтобы узнать текущую архитектуру, набираем dpkg —print-architecture. (Обратите внимание, что архитектура на самом деле относится к «ABI» (Application Binary Interface), а не набор инструкций (ISA). Так, например, armel и armhf различные архитектуры потому, что они имеют различные вызовы библиотек ABIs, хотя используют одинаковый набор инструкций.

Пакеты можно указывать как ‘package:architecture’, например libc:i386 и libc:amd64, обратите внимание что симантика в dpkg и apt немного отличается, поэтому вы можете получить различные результаты, но они всегда будут безопасны и не двусмысленны. Имя пакета ‘package’, всегда будет соответствовать текущей архитектуре apt.

Доступные архитектуры можно посмотреть dpkg —print-foreign-architectures.dpkg будет управлять пакетами для этих архитектур, а также архитектуры машины.

Заголовок ‘Multi-Arch’ в пакете соответствует всем multiarch-aware пакетам.

Existing packages work fine in a multiarch environment, just as before, but to gain the benefits of co-installation or cross-architecture dependencies, many packages need to be made ‘multiarch-aware’.

  • For an unchanged package you can choose which arch version of a package to install (e.g. ‘amd64’ or ‘i386’).
  • If a package is marked ‘Multi-Arch: foreign’, then it can satisfy dependencies of a package of a different architecture (e.g ‘make:amd64’ will satisfy a dependency on make for any-architecture package).
  • To enable more than one architecture version of a package to be installed at the same time (generally libraries and dev- packages) files need to be moved so they don’t clash. These packages are marked ‘Multi-Arch: same’.

Packages marked ‘Multi-Arch : allowed also exist which can be treated as either :same or :foreign depending on how they are depended-on.

Packagers are currently working through the distro, starting with the most useful packages for making multi-arch aware. See the multiarch spec and implementation howto for details of how it all actually works, and how to update packages to take advantage of the functionality.

Содержание

  1. Availability
  2. Конфигурация архитектур
  3. Setting up apt sources
  4. Установка/удаление пакетов
  5. Installing cross-dependencies
  6. 4 Answers 4
  7. Not the answer you’re looking for? Browse other questions tagged debian 32-vs-64-bit or ask your own question.
  8. Related
  9. Hot Network Questions

Availability

You need a multiarch-aware dpkg and apt.

In Debian dpkg this is present since 1.16.2. In Ubuntu this is present since natty (v1.15.8.10ubuntu1). Check by seeing if dpkg —print-foreign-architectures is understood.

Apt is multiarch-aware if it supports -o APT::Architectures. This is available from version 0.8.13 onwards. However there are many multiarch-related improvements and bug-fixes in later apt versions (some required by Debian dpkg 1.16.2 to properly enable multiarch), such as apt-get build-dep -a cross-dependency support, so the later the better in general up to at least 0.9.4.

Prior to apt 0.9 in Debian, dpkg can get stuck (but only if multiarch is enabled) during upgrades when it is not told which arch package it should be configuring by apt. (dpkg: error: —configure needs a val >

Конфигурация архитектур

Чтобы добавить дополнитульную архитектуру (в Debian для dpkg 1.16.2 и выше):

Обратите внимание: ничего не изменится, пока не обновите список пакетов.

Для удаления архитектуры

dpkg архитектуры хранятся в /var/lib/dpkg/arch.

Setting up apt sources

Apt defaults to using the set of architectures reported by dpkg, and any unqualified architecture deb lines in /etc/apt/sources.list, which is usually what you wanted. This can be overr >

apt-sources can be architecture qualified with this syntax. This is very useful on Ubuntu’s split archive. It is not normally necessary on Debian unless your normal archive does not mirror the extra architectures you are interested in.

Arch-qualifying deb-src lines doesn’t make any sense.

Note: There is a bug in apt versions >=0.9.7 and

after adding new architectures.

Установка/удаление пакетов

Для установки пакета из архитектуры не по-умолчанию, нужно ввести в командной строке:

Зависимости пакета будут установлены автоматически, для корректной архитектуры пример:

Installing cross-dependencies

To install build-dependencies of a package before cross-building:

This only works when all the ‘tools’ packages depended-on are marked Multi-Arch: foreign, any depended-on libraries which are also needed on the BUILD machine, and -dev packages which are needed for both HOST and BUILD architectures are made co-installable (‘Multi-Arch: same’ with arch-qualified paths), and any exceptions to the default rules are marked package:any or package:native in the package source. This process is ongoing.

When it doesn’t work you can often get the dependencies installed with a manual apt-get line: e.g instead of

Details of how this resolves are on MultiarchCross.

Как здорово, что в Дебиан есть поддержка мультиархитектур. Допустим, какое-то приложение работает только на 32-двух разрядных системах, а на сервере установлена 64-х разрядная. Просто устанавливаем необходимые библиотеки для архитектуры i386 и дальше работаем с приложением.

Делается это так:

И далее, если понадобится пакет другой архитектуры, то нужно при установке указать требуемую архитектуру: aptitude install nginx:i386.

I added foreign architecture i386 to my Debian amd64 installtion. How do I remove it? When I try this command: dpkg —remove-architecture i386 , I am told to first remove all i386 packages.

4 Answers 4

I am answering my own question after gathering important information from other blog posts.

  1. Show what foreign architectures are installed: dpkg —print-foreign-architectures
    • Might show: i386
  2. Remove all i386 packages: apt-get purge «.*:i386»
    • Note: The purge keyword (instead of remove ) removes all configuration files associated with the packages you’re uninstalling. (Thanks PCGuyIV!)
  3. Now you can remove the i386 architecture: dpkg —remove-architecture i386

I would use «purge» instead of «remove».

The «purge» keyword removes all configuration files associated with the packages you’re uninstalling.

Not the answer you’re looking for? Browse other questions tagged debian 32-vs-64-bit or ask your own question.

Hot Network Questions

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 4.0 with attribution required. rev 2019.11.15.35459

Источник: computermaker.info

Понравилась статья? Поделиться с друзьями:
Ок! Компьютер
Добавить комментарий