Debian

Debian 擠壓 - 無法升級 bash

  • August 17, 2017

我正在嘗試升級 bash,使其不易受到攻擊。

我嘗試了 Debian 的 Sources List Generator。但是libtinfo5阻止我升級bash。我找不到舊版本(由於源列表問題)libtinfo5來查看是否可以安裝它。

來源.list

deb http://deb.debian.org/debian/ stable main contrib non-free

deb http://deb.debian.org/debian/ stable-updates main contrib non-free

deb http://deb.debian.org/debian-security stable/updates main



root@server:~# apt-get install --only-upgrade bash                                                                                                                        Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
 libdpkg-perl bzip2 libmpfr4 fakeroot libalgorithm-merge-perl
 linux-kbuild-2.6.32 linux-headers-2.6.32-5-common libcloog-isl4
 libalgorithm-diff-xs-perl libgomp1 libtimedate-perl cpp libgmp3c2 dpkg-dev
 wwwconfig-common gcc-4.3-base cpp-4.3 cpp-4.4 libalgorithm-diff-perl
 binutils javascript-common make libmpc3 libisl10 libjs-mootools
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
 libtinfo5
Suggested packages:
 bash-doc
The following NEW packages will be installed:
 libtinfo5
The following packages will be upgraded:
 bash
1 upgraded, 1 newly installed, 0 to remove and 316 not upgraded.
Need to get 1,725 kB of archives.
After this operation, 2,806 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
 libtinfo5 bash
Install these packages without verification [y/N]? y
Get:1 http://deb.debian.org/debian/ stable/main libtinfo5 amd64 6.0+20161126-1 [                                                                                                  299 kB]
Get:2 http://deb.debian.org/debian/ stable/main bash amd64 4.4-5 [1,427 kB]
Fetched 1,725 kB in 0s (3,319 kB/s)
Reading changelogs... Done
(Reading database ... 36165 files and directories currently installed.)
Unpacking libtinfo5 (from .../libtinfo5_6.0+20161126-1_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libtinfo5_6.0+20161126-1_amd64.de                                                                                                  b (--unpack):
triggers ci file contains unknown directive `activate-noawait'
configured to not write apport reports
                                     Errors were encountered while processing:
/var/cache/apt/archives/libtinfo5_6.0+20161126-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

apt-cache 策略輸出

root@server:~# apt-cache policy bash
bash:
 Installed: 4.1-3
 Candidate: 4.1-3
 Version table:
*** 4.1-3 0
       100 /var/lib/dpkg/status

評論太長了:

  • wget http://snapshot.debian.org/archive/debian-archive/20160313T130328Z/debian/pool/main/b/bash/bash_4.1-3%2Bdeb6u2_amd64.deb(假設amd64是你的架構)
  • 下載文件後,執行dpkg -i bash_4.1-3+deb6u2_amd64.deb(以 root / via sudo

**認真:**升級這個系統,或者如果離線。

引用自:https://serverfault.com/questions/869145