如何检查 Google Debian 存储库中的可用版本

如何检查 Google Debian 存储库中的可用版本

我想从 Google 官方存储库安装特定版本的 Chrome。我现在安装 Chrome 的方式如下:

RUN apt-get update \
    && apt-get install -y wget gnupg \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-khmeros fonts-kacst fonts-freefont-ttf libxss1 \
      --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*

据我所知,这是存储库条目:

http://dl.google.com/linux/chrome/deb/ stable main

根据格式描述在这里

deb http://site.example.com/debian distribution component1 component2 component3

因此,在这里它用作stable分发,并main作为组件。Stable应该是版本,但也许是元包指向最新版本?但我不知道如何查看此存储库中有哪些版本可用?

当我安装它时,我看到以下输出,特别是这一行:

The following packages will be upgraded:
  google-chrome-stable
1 upgraded, 0 newly installed, 0 to remove and 52 not upgraded.
Need to get 105 MB of archives.
After this operation, 3688 kB of additional disk space will be used.
Get:1 https://dl.google.com/linux/chrome/deb stable/main amd64 google-chrome-stable amd64 120.0.6099.71-1 [105 MB]

所以它以某种方式知道最新的是120.0.6099.71-1并且存储库链接变成这样:

https://dl.google.com/linux/chrome/deb stable/main amd64 google-chrome-stable amd64 120.0.6099.71-1

答案1

从本质上来说,这似乎不是一个元包...比较输出(Depends:尤其是) 的:

$ apt show -a google-chrome-stable
Package: google-chrome-stable
Version: 120.0.6099.71-1
Priority: optional
Section: web
Maintainer: Chrome Linux Team <[email protected]>
Installed-Size: 338 MB
Provides: www-browser
Pre-Depends: dpkg (>= 1.14.0)
Depends: ca-certificates, fonts-liberation, libasound2 (>= 1.0.17), libatk-bridge2.0-0 (>= 2.5.3), libatk1.0-0 (>= 2.2.0), libatspi2.0-0 (>= 2.9.90), libc6 (>= 2.17), libcairo2 (>= 1.6.0), libcups2 (>= 1.6.0), libcurl3-gnutls | libcurl3-nss | libcurl4 | libcurl3, libdbus-1-3 (>= 1.9.14), libdrm2 (>= 2.4.75), libexpat1 (>= 2.1~beta3), libgbm1 (>= 17.1.0~rc2), libglib2.0-0 (>= 2.39.4), libgtk-3-0 (>= 3.9.10) | libgtk-4-1, libnspr4 (>= 2:4.9-2~), libnss3 (>= 2:3.35), libpango-1.0-0 (>= 1.14.0), libu2f-udev, libvulkan1, libx11-6 (>= 2:1.4.99.1), libxcb1 (>= 1.9.2), libxcomposite1 (>= 1:0.4.4-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxkbcommon0 (>= 0.5.0), libxrandr2, wget, xdg-utils (>= 1.0.2)
Download-Size: 105 MB
APT-Manual-Installed: yes
APT-Sources: https://dl.google.com/linux/chrome/deb stable/main amd64 Packages
Description: The web browser from Google
 Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier.

到实际元包的输出,如:

$ apt show -a linux-image-generic
Package: linux-image-generic
Version: 6.5.0.14.16
Priority: optional
Section: kernel
Source: linux-meta
Origin: Ubuntu
Maintainer: Ubuntu Kernel Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 15.4 kB
Provides: spl-modules (= 2.2.0-0ubuntu1~23.10), v4l2loopback-modules (= 0.12.7-2ubuntu4), virtualbox-guest-modules (= 6.5.0-14), wireguard-modules (= 1.0.0), zfs-modules (= 2.2.0-0ubuntu1~23.10)
Depends: linux-image-6.5.0-14-generic, linux-modules-extra-6.5.0-14-generic, linux-firmware, intel-microcode, amd64-microcode
Recommends: thermald
Download-Size: 9,026 B
APT-Manual-Installed: yes
APT-Sources: http://archive.ubuntu.com/ubuntu mantic-updates/main amd64 Packages
Description: Generic Linux kernel image
 This package will always depend on the latest generic kernel image
 available.

Package: linux-image-generic
Version: 6.5.0.9.11
Priority: optional
Section: kernel
Source: linux-meta
Origin: Ubuntu
Maintainer: Ubuntu Kernel Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 15.4 kB
Provides: spl-modules (= 2.2.0~rc3-0ubuntu4), v4l2loopback-modules (= 0.12.7-2ubuntu4), virtualbox-guest-modules (= 6.5.0-9), wireguard-modules (= 1.0.0), zfs-modules (= 2.2.0~rc3-0ubuntu4)
Depends: linux-image-6.5.0-9-generic, linux-modules-extra-6.5.0-9-generic, linux-firmware, intel-microcode, amd64-microcode
Recommends: thermald
Download-Size: 8,892 B
APT-Sources: http://archive.ubuntu.com/ubuntu mantic/main amd64 Packages
Description: Generic Linux kernel image
 This package will always depend on the latest generic kernel image
 available.

...如您所见,前者显示了对其他不同包的实际依赖性不是其中,一个google-chrome*包根据此定义不是一个元包,而后者列出了对自身某个版本的依赖,因此根据此定义它是一个元包(通俗地说,就是

也就是说,你可以从添加的存储库中搜索可用的软件包,如下所示:

$ apt search '^google-chrome.*'
Sorting... Done
Full Text Search... Done
google-chrome-beta/stable 121.0.6167.8-1 amd64
  The web browser from Google

google-chrome-stable/stable,now 120.0.6099.71-1 amd64 [installed]
  The web browser from Google

google-chrome-unstable/stable 121.0.6156.3-1 amd64
  The web browser from Google

或者像这样:

$ apt list 'google-chrome*'
Listing... Done
google-chrome-beta/stable 121.0.6167.8-1 amd64
google-chrome-stable/stable,now 120.0.6099.71-1 amd64 [installed]
google-chrome-unstable/stable 121.0.6156.3-1 amd64

/var/lib/apt/lists/或者在(下的软件包文件的相关存储库缓存列表中搜索文本得到更新sudo apt update) 例如:

$ awk '/^Package: |^Version: |^Architecture: / {
        print
}

/^Filename: / {
        printf "%s\n\n", $0
}
' /var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages 
Package: google-chrome-beta
Version: 121.0.6167.8-1
Architecture: amd64
Filename: pool/main/g/google-chrome-beta/google-chrome-beta_121.0.6167.8-1_amd64.deb

Package: google-chrome-stable
Version: 120.0.6099.71-1
Architecture: amd64
Filename: pool/main/g/google-chrome-stable/google-chrome-stable_120.0.6099.71-1_amd64.deb

Package: google-chrome-unstable
Version: 121.0.6156.3-1
Architecture: amd64
Filename: pool/main/g/google-chrome-unstable/google-chrome-unstable_121.0.6156.3-1_amd64.deb

...Filename:该存储库下的实际文件路径在哪里,例如稳定的 Google Chrome 软件包文件位于:

https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_120.0.6099.71-1_amd64.deb

相关内容