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


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