我這裡有一個 powerpc 設備,上面安裝了相當古老的 Debian。
它可以被識別為 Lenny 導數:/etc/issue
提及Debian GNU/Linux 5.0
。有一些特定於供應商的軟體包。
我可以使用系統的哪些角落來提取建造分發日期?我對安裝日期不感興趣。
答案1
每個使用 Debian 策略編譯的軟體包都包含一個.如果軟體包是從本機 Debian 來源建構的,則可以呼叫該檔案。更改日誌中的最新條目應該是包最終確定的時間,即在對包源進行最後一次更改之後且在構建包之前。/usr/share/doc/PACKAGE-NAME/changelog.Debian
changelog.gz
這編譯輸出的時間戳(本機可執行檔、庫、字節碼等)將是它們的建置時間。只要係統的建置日期存在,就是這樣。當然,每個軟體包都是不同的——Debian 系統不是一次性構建的。 (嗯,理論上是可以的,但是需要很長時間。)
如果某些.deb
檔案存在於 中/var/cache/apt/archives
,則它們的修改時間將給出其建置時間的上限。
目錄的修改時間和 inode 更改時間 ( ls -lc
) 給出了所涉及文件的壽命的下限。日誌可能在/var/log/dpkg.log*
和中可用/var/log/apt
。 (如果發行版太古老的話,也許不會,我不記得這些是否已經存在於 lenny 中。)但這都是安裝時或安裝後的。
您在評論中提到了法律調查。所有這些時間戳都很容易偽造,因此只有在系統管理員不被懷疑篡改它們的情況下它們才有用。
答案2
檢查已安裝軟體的建置日期,例如 aptitude。如果軟體進行了安全升級,則這將不起作用,但否則,一堆確實報告其編譯時間的軟體包的早期編譯時間會給您一些想法。我的系統是 Debian 7.6(喘息)。以下是我的機器上的一些範例。
資質
faheem@orwell:~$ aptitude --version
aptitude 0.6.8.2 compiled at Nov 7 2012 07:08:03
Compiler: g++ 4.7.2
Compiled against:
apt version 4.12.0
NCurses version 5.9
libsigc++ version: 2.2.10
Ept support enabled.
Gtk+ support disabled.
Qt support disabled.
Current library versions:
NCurses version: ncurses 5.9.20110404
cwidget version: 0.5.16
Apt version: 4.12.0
apt-get
faheem@orwell:~$ apt-get --version
apt 0.9.7.9 for amd64 compiled on Oct 8 2014 10:25:29
Supported modules:
*Ver: Standard .deb
*Pkg: Debian dpkg interface (Priority 30)
Pkg: Debian APT solver interface (Priority -1000)
S.L: 'deb' Standard Debian binary tree
S.L: 'deb-src' Standard Debian source tree
Idx: Debian Source Index
Idx: Debian Package Index
Idx: Debian Translation Index
Idx: Debian dpkg status file
Idx: EDSP scenario file
斯爾恩
faheem@orwell:~$ slrn --version
slrn 1.0.1
S-Lang Library Version: 2.2.4
Compiled on: Feb 10 2014 20:58:07
Operating System: Linux
COMPILE TIME OPTIONS:
Backends: +nntp +slrnpull +spool
External programs / libs: +canlock +inews +ssl +uudeview +iconv
Features: +decoding +emphasized_text +end_of_thread +fake_refs +gen_msgid
-grouplens -msgid_cache +piping +rnlock +spoilers -strict_from
Using 64 bit integers for article numbers.
DEFAULTS:
Default server object: nntp
Default posting mechanism: nntp
SSH
faheem@orwell:~$ ssh -v
OpenSSH_6.0p1 Debian-4+deb7u2, OpenSSL 1.0.1e 11 Feb 2013
維姆
faheem@orwell:~$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 10 2013 02:28:47)
開放式SSL
faheem@orwell:~$ openssl version
OpenSSL 1.0.1e 11 Feb 2013
奈
faheem@orwell:~$ nano --version
GNU nano version 2.2.6 (compiled 21:40:01, Jun 22 2012)
答案3
從https://lists.debian.org/debian-user/2013/05/msg01045.html
~# uname -a Linux wheezy 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64 GNU/Linux
~# ls -l /boot/vm* -rw-r--r-- 1 root root 2833376 5 月 15 日 23:58 /boot/vmlinuz-3.2.0-4-amd64 ~#
uname 輸出中不再有日期,我可以將其與核心映像檔的時間戳進行比較。
現在您應該將 uname 報告的 Debian 軟體包版本(上例中的 3.2.41-2)與目前安裝的版本(例如使用 dpkg -l)進行比較。不過, /proc/version 仍然為我報告建置時間。
對我來說聽起來沒有說服力。作為管理員,我不在乎使用什麼來源來建立安裝的核心包。
由於用於構建內核的源碼包唯一標識了內核,因此您應該只關心源碼包版本嗎?
===
在我看來,如果 centos/rhel 取消 uname 中的建置日期,那會很糟糕...