Debian-Lenny

我可以在不破壞 LAMP 的情況下進行 dist 升級嗎?

  • February 22, 2011

我有一個 Debian 5 VPS,它執行一個 LAMP 堆棧和 Redmine (Ruby) 和 DokuWiki,供我自己和一些客戶用於組織目的。

一個apt-get upgrade請求說很多包將被保留,但一個apt-get dist-upgrade請求似乎會導致一個看起來很嚇人的(對我來說)將被刪除的包列表。我需要它們來安裝 LAMP 嗎?

這是命令行中的故事:

user@machine:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages have been kept back:
 bind9 bind9-host bind9utils dnsutils libapache2-mod-php5 libbind9-50 libdns55 libisccc50
 libisccfg50 liblwres50 mysql-client-5.1 mysql-server-5.1 mysql-server-core-5.1 php5 php5-apc
 php5-cli php5-common php5-curl php5-gd php5-imagick php5-imap php5-mcrypt php5-mysql
 php5-suhosin php5-tidy
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.
user@machine:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED
 libapache2-mod-php5 libdns55 libisc52 mysql-server mysql-server-5.1 php5 php5-cli php5-curl
 php5-gd php5-imagick php5-imap php5-mcrypt php5-mysql php5-tidy
The following NEW packages will be installed
 libdb4.8 libdns58 libisc50 liblqr-1-0 libltdl7 libonig2 libqdbm14
The following packages have been kept back:
 mysql-client-5.1
The following packages will be upgraded:
 bind9 bind9-host bind9utils dnsutils libbind9-50 libisccc50 libisccfg50 liblwres50
 mysql-server-core-5.1 php5-apc php5-common php5-suhosin
12 upgraded, 7 newly installed, 14 to remove and 1 not upgraded.
Need to get 7698kB of archives.
After this operation, 25.9MB disk space will be freed.
Do you want to continue [Y/n]? n
Abort.

繼續進行 dist 升級是否安全?

使用來自以下的輸出進行更新apt-get dist-upgrade -V

The following packages will be REMOVED
  libapache2-mod-php5 (5.3.5-0.dotdeb.1)
  libdns55 (9.6.ESV.R2+dfsg-0+lenny1)
  libisc52 (9.6.ESV.R1+dfsg-0+lenny2)
  mysql-server (5.1.54-0.dotdeb.1)
  mysql-server-5.1 (5.1.54-0.dotdeb.1)
  php5 (5.3.5-0.dotdeb.1)
  php5-cli (5.3.5-0.dotdeb.1)
  php5-curl (5.3.5-0.dotdeb.1)
  php5-gd (5.3.5-0.dotdeb.1)
  php5-imagick (5.3.5-0.dotdeb.1)
  php5-imap (5.3.5-0.dotdeb.1)
  php5-mcrypt (5.3.5-0.dotdeb.1)
  php5-mysql (5.3.5-0.dotdeb.1)
  php5-tidy (5.3.5-0.dotdeb.1)
The following NEW packages will be installed
  libdb4.8 (4.8.24-1~bpo50+1)
  libdns58 (9.6.ESV.R3+dfsg-0+lenny1)
  libisc50 (9.6.ESV.R3+dfsg-0+lenny1)
  liblqr-1-0 (0.1.0-1)
  libltdl7 (2.2.6b-2~bpo50+1)
  libonig2 (5.9.1-1)
  libqdbm14 (1.8.74-1.4)
The following packages have been kept back:
  mysql-client-5.1 (5.1.54-0.dotdeb.0 => 5.1.54-0.dotdeb.1)
The following packages will be upgraded:
  bind9 (9.6.ESV.R1+dfsg-0+lenny2 => 9.6.ESV.R3+dfsg-0+lenny1)
  bind9-host (9.6.ESV.R1+dfsg-0+lenny2 => 9.6.ESV.R3+dfsg-0+lenny1)
  bind9utils (9.6.ESV.R1+dfsg-0+lenny2 => 9.6.ESV.R3+dfsg-0+lenny1)
  dnsutils (9.6.ESV.R1+dfsg-0+lenny2 => 9.6.ESV.R3+dfsg-0+lenny1)
  libbind9-50 (9.6.ESV.R1+dfsg-0+lenny2 => 9.6.ESV.R3+dfsg-0+lenny1)
  libisccc50 (9.6.ESV.R1+dfsg-0+lenny2 => 9.6.ESV.R3+dfsg-0+lenny1)
  libisccfg50 (9.6.ESV.R1+dfsg-0+lenny2 => 9.6.ESV.R3+dfsg-0+lenny1)
  liblwres50 (9.6.ESV.R1+dfsg-0+lenny2 => 9.6.ESV.R3+dfsg-0+lenny1)
  mysql-server-core-5.1 (5.1.54-0.dotdeb.0 => 5.1.54-0.dotdeb.1)
  php5-apc (5.2.17-0.dotdeb.0 => 5.3.5-0.dotdeb.1)
  php5-common (5.2.17-0.dotdeb.0 => 5.3.5-0.dotdeb.1)
  php5-suhosin (5.2.17-0.dotdeb.0 => 5.3.5-0.dotdeb.1)
12 upgraded, 7 newly installed, 14 to remove and 1 not upgraded.
Need to get 7698kB of archives.
After this operation, 25.9MB disk space will be freed.
Do you want to continue [Y/n]? 

不,看起來你的很多 php 和 mysql 東西正在被刪除而不是被替換。我認為在這種情況下,最好通過 aptitude 或 dselect 或其他一些前端進行升級,您​​可以在其中找出為什麼會發生這種情況並修復它,或者至少指示它重新添加包到要安裝的軟體包列表,以便在一次操作中完成所有操作。

這些都是從 lenny 安裝的,還是您使用了其他儲存庫?mysql-client-5.1 仍然保留在 dist-upgrade 上的事實表明,要麼某些東西已固定到需要取消固定的特定版本,要麼 mysql-client-5.1 來自不提供的地方一條明確的升級路徑可以擠壓。

編輯基於 -V 的輸出

這些軟體包是從 dotdeb 儲存庫安裝的,其目的是打包最新最好的 PHP 和 MySQL 軟體包,因為 Debian 通常落後幾個版本。

有幾件事:檢查是否/etc/apt/preferences存在,如果存在,請通讀它,看看除了 php 和 mysql 之外是否還有其他東西被固定到特定版本。如果存在並且都是 php 和 mysql,則將其重命名為.bak. 其次,確保dotdeb 的擠壓儲存庫配置/etc/apt/sources.list

deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all

基於您擁有 PHP 5.3 的事實,這可能意味著您需要刪除引用的舊行http://php53.dotdeb.org

完成此操作後,執行apt-get update它以獲取目前包列表,然後apt-get dist-ugprade. 如果這仍然無法解決,請使用新的 dist-upgrade -V 更新問題

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