Как определить ветку Debian пакета, показанную в выводе `apt -cache show `?

In a cabinet, the name of the server is node0, node1, node2... From top to bottom. When all the nodes start up through PXE for the first time (all nodes start at one time, regardless of the order), use DHCP to get the IP address of ethernet.

На самом деле PXE использует DHCP. Итак, что происходит, так это то, что каждый узел уже имеет MAC-адрес (, однако этот MAC-адрес был назначен ). Затем узел использует этот MAC-адрес для передачи DHCP-запроса. DHCP-сервер может распознать MAC-адрес и отправить обратно адрес TFTP-сервера, чтобы позволить узлу получить образ PXE, а также IP-адрес узла.

These nodes then automatically collect MAC addresses and send them to the server. Previously, the server did not know the MAC address information of these nodes.

Я не уверен, о каком сервере вы говорите. Может быть, у вас есть дополнительный сервер, который собирает MAC-адреса, и у них есть специальный шаг в процессе загрузки, который отправляет эти MAC-адреса на этот сервер?

В любом случае, DHCP-сервер получает MAC-адрес из широковещательного запроса DHCP. Это происходит до получения образа PXE. Если DHCP-сервер хочет сделать что-то особенное с MAC-адресом, например выбрать правильный образ PXE, этот MAC-адрес должен быть упомянут в файлах конфигурации DHCP .

Если возникает вопрос «как найти MAC-адрес для данного физического узла?»,нужно либо смотреть конфигурацию ноды (иногда MAC адрес является параметром для Uboot и т.д. ), либо нужно отключать ноду от локалки, подключать к какому-то другому компу, загружать его, и запишите MAC-адрес в широковещательном запросе DHCP.

0
24.05.2021, 19:49
2 ответа

apt-cache showне скажет вам, какую «ветвь» он описывает, но apt showрасскажет:

$ apt show -a tmux
Package: tmux
Version: 3.1c-1
Priority: optional
Section: admin
Maintainer: Romain Francoise <rfrancoise@debian.org>
Installed-Size: 850 kB
Depends: libc6 (>= 2.27), libevent-2.1-7 (>= 2.1.8-stable), libtinfo6 (>= 6), libutempter0 (>= 1.1.5)
Homepage: https://tmux.github.io/
Tag: hardware::input:keyboard, implemented-in::c, interface::text-mode,
 role::program, scope::application, works-with::software:running
Download-Size: 362 kB
APT-Sources: http://deb.debian.org/debian testing/main amd64 Packages
Description: terminal multiplexer
 tmux enables a number of terminals (or windows) to be accessed and
 controlled from a single terminal like screen. tmux runs as a
 server-client system. A server is created automatically when necessary
 and holds a number of sessions, each of which may have a number of
 windows linked to it. Any number of clients may connect to a session,
 or the server may be controlled by issuing commands with tmux.
 Communication takes place through a socket, by default placed in /tmp.
 Moreover tmux provides a consistent and well-documented command
 interface, with the same syntax whether used interactively, as a key
 binding, or from the shell. It offers a choice of vim or Emacs key
 layouts.

Package: tmux
Version: 2.8-3
Priority: optional
Section: admin
Maintainer: Romain Francoise <rfrancoise@debian.org>
Installed-Size: 697 kB
Depends: libc6 (>= 2.27), libevent-2.1-6 (>= 2.1.8-stable), libtinfo6 (>= 6), libutempter0 (>= 1.1.5)
Homepage: https://tmux.github.io/
Tag: hardware::input:keyboard, implemented-in::c, interface::text-mode,
 role::program, scope::application, works-with::software:running
Download-Size: 302 kB
APT-Manual-Installed: yes
APT-Sources: http://deb.debian.org/debian buster/main amd64 Packages
Description: terminal multiplexer
 tmux enables a number of terminals (or windows) to be accessed and
 controlled from a single terminal like screen. tmux runs as a
 server-client system. A server is created automatically when necessary
 and holds a number of sessions, each of which may have a number of
 windows linked to it. Any number of clients may connect to a session,
 or the server may be controlled by issuing commands with tmux.
 Communication takes place through a socket, by default placed in /tmp.
 Moreover tmux provides a consistent and well-documented command
 interface, with the same syntax whether used interactively, as a key
 binding, or from the shell. It offers a choice of vim or Emacs key
 layouts.

Найдите строки APT-Sources:они указывают, какому репозиторию соответствует информация.

1
28.07.2021, 11:30

У тебя почти получилось с apt-cache policy. Вам просто нужно было добавить имя пакета в эту командную строку.

Вы можете использовать apt-cache policy [package...], чтобы показать, какая версия установлена, версия-кандидат на установку по умолчанию и все версии, доступные для установки (в соответствии с вашим sources.listфайлом (s )и конфигурацией закрепления или APT::Default-Releaseустановка ).

Например, в одной из моих систем, которая настроена на использование sidака unstableпо умолчанию (из-за строки APT::Default-Release "unstable";в моем /etc/apt/apt.conf), а также разрешить выбор пакетов Cherry -изexperimental:

$ apt-cache policy tmux
tmux:
  Installed: 3.1c-1
  Candidate: 3.1c-1
  Version table:
     3.2~rc4-1 1
          1 http://ftp.au.debian.org/debian experimental/main amd64 Packages
 *** 3.1c-1 990
        990 http://ftp.au.debian.org/debian unstable/main amd64 Packages
        100 /var/lib/dpkg/status

«Установлена» — это версия, установленная в данный момент. «Кандидат» — это версия, которую можно установить в соответствии с вашей подходящей конфигурацией (. В этом случае версия-кандидат уже установлена ​​). «Таблица версий» показывает все доступные версии.

Можно установить любые другие версии, указав либо точный номер версии, либо целевой выпуск, определенный в одном из ваших sources.listфайлов (с ). например. стабильный, тестовый, sid, экспериментальный или название конкретной версии Debian, например «stretch» ​​или «buster».

Например, один из следующих:

apt install tmux=3.2~rc4-1

apt -t experimental install tmux

apt install tmux/experimental

Кстати, вы также можете переопределить версию установки-кандидата, отображаемую apt-cache policy, с помощью параметра -t target_release. Это, вероятно, более полезно в сценарии, чем то, что вы запускаете из командной строки, упрощает извлечение версии-кандидата с помощью grep -oP '^ +Candidate: \K.*'или awk -F': ' '/^ +Candidate:/ {print $2}'.

1
28.07.2021, 11:30

Теги

Похожие вопросы