如何安裝特定的 Debian/Ubuntu 發行版本?

如何安裝特定的 Debian/Ubuntu 發行版本?

我正在研究可重複的構建,並希望最終得到一個設置持續的包含我的建置環境的 VM 映像。現在,我將把時間戳和其他差異來源的問題放在一邊,所以透過「持續的「,我的意思是一個可重現的環境。我知道 Debian可重複構建努力,這就提出了要求軟體包版本以保證相同的建置。我想要類似的東西,但在系統等級。

我從 Alpine 開始,它讓我可以基於具體發布非常簡單地。

我如何對 Debian 做同樣的事情,它提供了例如拉緊發 9.0 到 9.4?

到目前為止我能想到的最好的方法如下:我查看了發布變更日誌,然後使用最接近的快照作為我的包源反引導程式

$ wget -q -O- http://ftp.debian.org/debian/dists/stretch/ChangeLog | grep "Debian.*released"
Sat, 10 Mar 2018 - Debian 9.4 released
Sat, 09 Dec 2017 - Debian 9.3 released
Sat, 07 Oct 2017 - Debian 9.2 released
Sat, 22 Jul 2017 - Debian 9.1 released
Sat, 17 Jun 2017 - Debian 9.0 released
$ # Looking at release 9.2
$ wget -q -O- "http://snapshot.debian.org/archive/debian/?year=2017&month=10" | html2text | sed -e 's/[:-]//g' -e 's/_/T/g' | awk '/20171007/ {print "http://snapshot.debian.org/archive/debian/"$1"Z/"}'
http://snapshot.debian.org/archive/debian/20171007T032909Z/
http://snapshot.debian.org/archive/debian/20171007T103908Z/
http://snapshot.debian.org/archive/debian/20171007T213914Z/
$ mkdir -p chroot_stretch_20171007T103908Z
$ sudo debootstrap --arch=amd64 --variant=minbase stretch chroot_stretch_20171007T103908Z http://snapshot.debian.org/archive/debian/20171007T103908Z/
I: Retrieving InRelease 
I: Retrieving Release 
I: Retrieving Release.gpg 
I: Checking Release signature
I: Valid Release signature (key id 067E3C456BAE240ACEE88F6FEF0F382A1A7B6500)
I: Retrieving Packages 
(...)
$ find -maxdepth 1 -name "chroot_stretch_2017100*" | sort | while read d; do echo $d; cat $d/etc/debian_version; sudo chroot $d apt-cache policy | grep stretch; echo ""; done
./chroot_stretch_20171006T213452Z
9.1
 500 http://snapshot.debian.org/archive/debian/20171006T213452Z stretch/main amd64 Packages
     release v=9.1,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64

./chroot_stretch_20171007T032909Z
9.1
 500 http://snapshot.debian.org/archive/debian/20171007T032909Z stretch/main amd64 Packages
     release v=9.1,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64

./chroot_stretch_20171007T103908Z
9.1
 900 http://snapshot.debian.org/archive/debian/20171007T103908Z stretch/main amd64 Packages
     release v=9.2,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64

./chroot_stretch_20171007T213914Z
9.1
 500 http://snapshot.debian.org/archive/debian/20171007T213914Z stretch/main amd64 Packages
     release v=9.2,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64

./chroot_stretch_20171008T032534Z
9.1
 500 http://snapshot.debian.org/archive/debian/20171008T032534Z stretch/main amd64 Packages
     release v=9.2,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64

正如我們所看到的,發布標籤來自apt 快取策略同一天的兩個快照之間的變化。然而/etc/debian_版本沒有更新,即使查看基礎文件包版本顯示有​​新版本可用。請注意,發佈時沒有拍攝明確的快照,因此這種方法是「盡力而為」的方法。因此,有多種方法可以定義 Debian 版本 9.2 的實際意義。

如果沒有一種簡單的方法來定位它們,我真的不明白點釋放的意義,所以我一定錯過了一些明顯的東西。

答案1

經過更多的網路挖掘,我在 Debian 用戶列表上發現了一個關於同一主題的線程:限制特定 Jessie 發行版谷歌複製)。這特定職位給了一個冗長的答案,也依賴 Debian 快照。

仍然缺少的是與點發布明確相關的快照,但任何都可以滿足我的目的。

要將官方版本連結到快照,可以使用 jigdo 檔案中的資訊來重建官方 ISO:

$ wget -q -O - https://cdimage.debian.org/mirror/cdimage/archive/8.10.0/amd64/jigdo-bd/debian-8.10.0-amd64-BD-1.jigdo | gunzip | awk -F= '/snapshot.debian.org/ {print $2}'
http://snapshot.debian.org/archive/debian/20171209T215122Z/

相關內容