Debian 6(Squeeze)升級至Debian 7(Wheezy)

出現問題參見8,有部分問題的解決方法(每個人遇到的可能不一樣)

一、編輯/etc/apt/source.list文件

對於之前的squeeze用戶,升級還是很簡單的.國內的用戶直接去換一個源就行了

在終端依次輸入以下命令,備份老源文件,直接去163下載新源文件即可.

#cp /etc/apt/sources.list /etc/apt/squeeze_sources_list

#wget http://mirrors.163.com/.help/sources.list.wheezy -O /etc/apt/sources.list

或者直接複製下面的內容,並且把老的squeeze的註釋或者刪除掉

    deb http://mirrors.163.com/debian wheezy main non-free contrib  
    deb http://mirrors.163.com/debian wheezy-proposed-updates main contrib non-free  
    deb-src http://mirrors.163.com/debian wheezy main non-free contrib  
    deb-src http://mirrors.163.com/debian wheezy-proposed-updates main contrib non-free  
      
    deb http://mirrors.163.com/debian-security wheezy/updates main contrib non-free   
    deb-src http://mirrors.163.com/debian-security wheezy/updates main contrib non-free   
      
    deb http://http.us.debian.org/debian wheezy main contrib non-free  
    deb http://non-us.debian.org/debian-non-US wheezy/non-US main contrib non-free  
    deb http://security.debian.org wheezy/updates main contrib non-free  

二、更新軟件包列表

# apt-get update

如果更新軟件包列表時,提示:

Reading package lists... Done
W: There is no public key available for the following key IDs:
9D6D8F6BC857C906
W: There is no public key available for the following key IDs:
7638D0442B90D010
網上找了2中解決辦法:(自己當時只有第二種方法有效)
1、導入Debian 7(Wheezy)的Archive Keys。

Debian Archive Signing Keys下載頁面:http://ftp-master.debian.org/keys.html
# wget http://ftp-master.debian.org/keys/archive-key-7.0.asc
# apt-key add archive-key-7.0.asc

之後重新更新軟件包列表就不會提示該警告了。
# apt-get update

但是這種方法還是提示警告,問題未解決。

2、
apt-get install debian-keyring debian-archive-keyring
再重新更新軟件包
# apt-get update

沒有提示了,問題解決。

三、更新最小化的基本系統

# apt-get upgrade

下載需要一段時間。

中途會有一些提示,會被修改

比如sudoers, 問你是否修改,還是保持原有版本, 默認是保持原有版本. 這裏我選的Y,和包維護者的版本一樣.

我在安裝的時候出現了下面的錯誤:

正在解壓縮 dovecot-dbg (從 .../dovecot-dbg_1%3a2.1.7-7+deb7u1_amd64.deb) ...
正在設置 dovecot-core (1:2.1.7-7+deb7u1) ...
You already have ssl certs for dovecot.
However you should move them out of /etc/ssl
and into /etc/dovecot and update the configuration
in /etc/dovecot/conf.d/10-ssl.conf accordingly.
See /usr/share/doc/dovecot-core/README.Debian.gz for details.
insserv: warning: script 'K01zabbix-agent' missing LSB tags and overrides
insserv: warning: script 'K01zabbix-server' missing LSB tags and overrides
insserv: warning: script 'zabbix-agent' missing LSB tags and overrides
insserv: warning: script 'file2sock' missing LSB tags and overrides
insserv: warning: script 'zabbix-server' missing LSB tags and overrides
[....] Starting IMAP/POP3 mail server: dovecotdoveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-ssl.conf line 12: ssl_cert: Can't open file /etc/dovecot/dovecot.pem: No such file or directory
 failed!
invoke-rc.d: initscript dovecot, action "start" failed.
dpkg: error processing dovecot-core (--configure):
 子進程 已安裝 post-installation 腳本 返回了錯誤號 1
dpkg: dependency problems prevent configuration of dovecot-gssapi:
 dovecot-gssapi 依賴於 dovecot-core (= 1:2.1.7-7+deb7u1);然而:
  軟件包 dovecot-core 尚未配置。
如上所示,有大量的 xxx  依賴於 dovecot-core (= 1:2.1.7-7+deb7u1);然而: 軟件包 dovecot-core 尚未配置。

試了網上的各種方法,都不起作用,最後,執行解決了,方法:

root@zctech-zhjx:/home/zczhangjx# apt-get remove dovecot*

這時有很多如下的錯誤:

 ssl_cert: Can't open file /etc/dovecot/dovecot.pem: No such file or directory
 failed!

我沒有處理,直接繼續下面的:

root@zctech-zhjx:/home/zczhangjx# apt-get upgrade
正在讀取軟件包列表... 完成
正在分析軟件包的依賴關係樹       
正在讀取狀態信息... 完成       
下列軟件包將被【卸載】:
  dovecot-imapd dovecot-ldap dovecot-lmtpd dovecot-managesieved dovecot-pop3d dovecot-sieve
下列軟件包的版本將保持不變:
  libboost-graph-parallel-dev libgd-text-perl
升級了 0 個軟件包,新安裝了 0 個軟件包,要卸載 6 個軟件包,有 2 個軟件包未被升級。
有 6 個軟件包沒有被完全安裝或卸載。
解壓縮後將會空出 3,612 kB 的空間。
您希望繼續執行嗎?[Y/n]y
(正在讀取數據庫 ... 系統當前共安裝有 225105 個文件和目錄。)
正在卸載 dovecot-imapd ...
正在卸載 dovecot-ldap ...
正在卸載 dovecot-lmtpd ...
正在卸載 dovecot-managesieved ...
正在卸載 dovecot-pop3d ...
正在卸載 dovecot-sieve ...
root@zctech-zhjx:/home/zczhangjx# aptitude update
root@zctech-zhjx:/home/zczhangjx# apt-get upgrade
正在讀取軟件包列表... 完成
正在分析軟件包的依賴關係樹       
正在讀取狀態信息... 完成       
下列軟件包的版本將保持不變:
  libboost-graph-parallel-dev libgd-text-perl
升級了 0 個軟件包,新安裝了 0 個軟件包,要卸載 0 個軟件包,有 2 個軟件包未被升級。

四、升級內核

# apt-get dist-upgrade

五、重啓系統

# reboot

六、驗證系統

# lsb_release -a
# cat /etc/debian_version

七、檢查內核

# uname -msr


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章