了解 Debian dpkg 軟體包版本號

了解 Debian dpkg 軟體包版本號

當我輸入 時dpkg -l | grep xserver-xorg,我會得到已安裝的軟體包及其版本的清單:

ii  xserver-xorg               1:7.7+3~deb7u1
ii  xserver-xorg-core          2:1.12.4-6
ii  xserver-xorg-input-evdev   1:2.7.0-1+b1
ii  xserver-xorg-input-kbd     1:1.6.1-1+b1
ii  xserver-xorg-input-mouse   1:1.7.2-3
ii  xserver-xorg-video-radeon  1:6.14.4-8

我想知道冒號前面的數字是什麼意思,即2中的數字2:1.12.4-6

答案1

Debian 中的版本號具有以下形式

[epoch:]upstream_version[-debian_revision] 

在哪裡

  • epoch是一個(通常很小)無符號整數,包含它是為了允許舊版本包的版本號中出現錯誤。如果省略,則epoch假定為零。

  • upstream_version 通常是產生 .deb 檔案的原始原始碼包的版本號。它通常與上游來源使用的格式保持相同。

  • debian_revision根據上游版本指定 Debian 軟體包的版本。它是可選的,並且在專門為 Debian 軟體包編寫軟體的情況下被省略。

答案2

2時代

更全面的是,從man deb-version:

[epoch:]upstream-version[-debian-revision]

epoch

This is a single (generally small) unsigned integer.  It may be omitted,  in  which
case  zero  is assumed.  If it is omitted then the upstream-version may not contain
any colons.

It is provided to allow mistakes in the version numbers  of  older  versions  of  a
package,  and  also  a  package's  previous  version  numbering schemes, to be left
behind.

upstream-version

This is the main part of the version number.  It is usually the version  number  of
the  original  ("upstream") package from which the .deb file has been made, if this
is applicable.  Usually this will be in the same format as that  specified  by  the
upstream  author(s); however, it may need to be reformatted to fit into the package
management system's format and comparison scheme.

The comparison behavior of the  package  management  system  with  respect  to  the
upstream-version  is  described  below. The upstream-version portion of the version
number is mandatory.

The  upstream-version  may  contain  only  alphanumerics  ("A-Za-z0-9")   and   the
characters  . + - : ~ (full stop, plus, hyphen, colon, tilde) and should start with
a digit.  If there is no debian-revision then hyphens are not allowed; if there  is
no epoch then colons are not allowed.

debian-revision

This  part  of the version number specifies the version of the Debian package based
on the upstream version.  It may contain only alphanumerics and the characters +  .
~  (plus, full stop, tilde) and is compared in the same way as the upstream-version
is.

It is optional; if it isn't present then the upstream-version  may  not  contain  a
hyphen.   This  format  represents  the  case where a piece of software was written
specifically to be turned  into  a  Debian  package,  and  so  there  is  only  one
"debianisation" of it and therefore no revision indication is required.

It  is  conventional  to  restart  the  debian-revision  at  '1' each time time the
upstream-version is increased.

Dpkg will break the version number apart at the last hyphen in the string (if there
is  one)  to  determine  the upstream-version and debian-revision. The absence of a
debian-revision compares earlier than the  presence  of  one  (but  note  that  the
debian-revision is the least significant part of the version number).

相關內容