当前位置: 代码迷 >> 综合 >> Debian Stable(squeeze6.0.7) 升级到最新的stable(Wheezy7.0),tzdata broken,重新安装N显卡驱动
  详细解决方案

Debian Stable(squeeze6.0.7) 升级到最新的stable(Wheezy7.0),tzdata broken,重新安装N显卡驱动

热度:9   发布时间:2023-12-08 03:15:53.0

昨天2013年May.5th debian 官方宣布wheezy正式发布,成为新的stable发行版

更新了很多软件,修复了一些bug

Apache 2.2.22
Asterisk 1.8.13.1
GIMP 2.8.2
an updated version of the GNOME desktop environment 3.4
GNU Compiler Collection 4.7.2
Icedove 10 (an unbranded version of Mozilla Thunderbird)
Iceweasel 10 (an unbranded version of Mozilla Firefox)
KDE Plasma Workspaces and KDE Applications 4.8.4
kFreeBSD kernel 8.3 and 9.0
LibreOffice 3.5.4
Linux 3.2
MySQL 5.5.30
Nagios 3.4.1
OpenJDK 6b27 and 7u3
Perl 5.14.2
PHP 5.4.4
PostgreSQL 9.1
Python 2.7.3 and 3.2.3
Samba 3.6.6
Tomcat 6.0.35 and 7.0.28
Xen Hypervisor 4.1.4
the Xfce 4.8 desktop environment
X.Org 7.7
more than 36,000 other ready-to-use software packages, built from nearly 17,500 source packages.

对于之前的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-freedeb 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

#apt-get -y upgrade

(这里漫长的等待,看网速了...)

报错了

Setting up tzdata (2013b-2) ...Current default time zone: 'Asia/Shanghai'
date: invalid date `\033[01;32mMon May  \033[01;36m6\033[01;32m \033[01;36m03\033[01;32m\033[01;34m:\033[01;32m\033[01;36m34\033[01;32m\033[01;34m:\033[01;32m\033[01;36m45\033[01;32m UTC \033[01;36m2013\033[0m'
dpkg: error processing tzdata (--configure):subprocess installed post-installation script returned error exit status 1
configured to not write apport reportsErrors were encountered while processing:tzdata
E: Sub-process /usr/bin/dpkg returned an error code (1)


重新安装和配置tzdata

#apt-get install --reinstall tzdata
#dpkg-reconfigure tzdata
提示

/usr/sbin/dpkg-reconfigure: tzdata is broken or not fully installed


这里我们查看一下当前的tzdata-java

#apt-cache showpkg tzdata-java

Package: tzdata-java
Versions: 
2013b-2 (/var/lib/apt/lists/mirrors.163.com_debian_dists_wheezy_main_binary-amd64_Packages) (/var/lib/apt/lists/http.us.debian.org_debian_dists_wheezy_main_binary-amd64_Packages) (/var/lib/dpkg/status)Description Language: enFile: /var/lib/apt/lists/mirrors.163.com_debian_dists_wheezy_main_i18n_Translation-enMD5: 811cf395ae4cc676283711d9bc20443fDescription Language: File: /var/lib/apt/lists/mirrors.163.com_debian_dists_wheezy_main_binary-amd64_PackagesMD5: 811cf395ae4cc676283711d9bc20443fReverse Depends: openjdk-6-jre-headless,tzdata-javaopenjdk-7-jre-headless,tzdata-javaopenjdk-6-jre-headless,tzdata-java
Dependencies: 
2013b-2 - tzdata (5 2013b-2) 
Provides: 
2013b-2 - 
Reverse Provides: 
这个依赖的是tzdata 2013b-2这个版本的tzdata

于是再查看下tzdata的

#apt-cache showpkg tzdata

Package: tzdata
Versions: 
2013b-2 (/var/lib/apt/lists/mirrors.163.com_debian_dists_wheezy_main_binary-amd64_Packages) (/var/lib/apt/lists/http.us.debian.org_debian_dists_wheezy_main_binary-amd64_Packages) (/var/lib/dpkg/status)Description Language: enFile: /var/lib/apt/lists/mirrors.163.com_debian_dists_wheezy_main_i18n_Translation-enMD5: a77a3cc9a67658dd7cfdc6547391b8f8Description Language: File: /var/lib/apt/lists/mirrors.163.com_debian_dists_wheezy_main_binary-amd64_PackagesMD5: a77a3cc9a67658dd7cfdc6547391b8f8Reverse Depends: util-linux,tzdata 2006c-2libc6,tzdata 2007k-1libapache2-mod-php5,tzdataphp5-cli,tzdataphp5-cgi,tzdatalibical0,tzdatapostgresql-9.1,tzdatautil-linux,tzdata 2006c-2tzdata-java,tzdata 2013b-2sugar-tools-0.96,tzdatasugar-session-0.96,tzdatasucrose-0.96,tzdatapython3-dateutil,tzdatapython3-tz,tzdatapython-tz,tzdatapython-dateutil,tzdatapostgresql-9.1,tzdataphp5-fpm,tzdataphp5-cli,tzdataphp5-cgi,tzdatalibphp5-embed,tzdatalibapache2-mod-php5filter,tzdatalibapache2-mod-php5,tzdatalibical0,tzdatalibc6,tzdata 2007k-1
Dependencies: 
2013b-2 - debconf (18 0.5) debconf-2.0 (0 (null)) libc0.1 (0 (null)) libc0.3 (0 (null)) libc6 (0 (null)) libc6.1 (0 (null)) 
Provides: 
2013b-2 - tzdata-wheezy 
Reverse Provides: 

强制安装这个版本

#apt-get install tzdata=2013b-2

Reading package lists... Done
Building dependency tree       
Reading state information... Done
tzdata is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1213 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up tzdata (2013b-2) ...Current default time zone: 'Asia/Shanghai'
Local time is now:      Mon May  6 12:52:41 CST 2013.
Universal Time is now:  Mon May  6 04:52:41 UTC 2013.
Run 'dpkg-reconfigure tzdata' if you wish to change it.Setting up tzdata-java (2013b-2) ...


再重设下时区

#dpkg-reconfigure tzdata
Current default time zone: 'Asia/Shanghai'
Local time is now:      Mon May  6 12:53:04 CST 2013.
Universal Time is now:  Mon May  6 04:53:04 UTC 2013.

如果这里tzdata还是不行.打开
/var/lib/dpkg/info/tzdata.postinst
找到

    TZBase=$(LC_ALL=C TZ=UTC0 date)UTdate=$(LC_ALL=C TZ=UTC0 date -d "$TZBase")TZdate=$(unset TZ ; LANG=C date -d "$TZBase")
可以在shell里面测试这个直到能正常运行. 需要关注到你的时区timezone,UTC这些的设定.
比如改成
TZBase=$(LC_ALL=C TZ=UTC0 date -R)
UTdate=$TZBase
TZdate=$(unset TZ ; LANG=C date -d "$TZBase")

然后重复执行升级就可以了

#apt-get update
#apt-get upgrade

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

比如/etc/mime.types 问你是否修改,还是保持原有版本, 默认是保持原有版本. 这里我选的Y,和包维护者的版本一样.

svn啊.还有sudoers 等等很多的配置,看你后续的设置了. 我都是Y. 然后后面下来修改

漫长的安装替换升级后,

再升级内核

#apt-get dist-upgrade

这个包就相当多了.大概1~2G,建议晚上通宵升级, 早上完了后重启.

下载完后,又出错了.

E: Could not perform immediate configuration on 'libgstreamer0.10-0'. Please see man 5 apt.conf under APT::Immediate-Configure for details

对于这个问题,我做了以下几个操作来fix

#cd /var/lib/apt/lists  

找到下面的文件

non-us.debian.org_debian-non-US_dists_wheezy_non-US_non-free_binary-amd64_Packages

然后去/etc/apt/sources.list 注释掉了以下一行

#deb http://non-us.debian.org/debian-non-US wheezy/non-US main contrib non-free 

最后重新安装上面的libgstreamer

#apt-get install --reinstall libgstreamer0.10-0


然后重新执行

#apt-get dist-upgrade

中途会弹出一个软件更新的差异的内容,这个直接q退出就行了,(你有耐心也可以看完的..)

中途会弹出一些配置的选项窗口, 简单读完了看你需要是否需要重启这些服务, 需要就YES.

Configuring libc6 ├───────────────────────────────┐│                                                                                  │ │ Failure restarting some services for GNU libc upgrade                            │ │                                                                                  │ │ The following services could not be restarted for the GNU libc library upgrade:  │ │                                                                                  │ │ apache2                                                                          │ │                                                                                  │ │ You will need to start these manually by running '/etc/init.d/<service> start'.  │ │                                                                                  

比如这些.可以下来自己单独配置的.

后记: 升级后,从gnome2 升到了gnome3, 还有了xfce . 很多之前安装的gnome2的小工具都没了. N卡的驱动装不上了.

来安装N卡驱动. 首先去查看下为什么

N卡的安装失败日志在

/var/lib/dkms/nvidia/310.44/build/make.log  数字那里是你安装的N卡驱动版本号

*** Unable to determine the target kernel version. ***make: *** [select_makefile] Error 1

提示没找到内核版本.

#/usr/lib/dkms/dkms-autoinstaller start 3.2.0-4-amd64

#sh ./Nvidia.xxxx.run --kernal-source-path=/lib/modules/3.2.0-4-amd64/build/

提示安装dkms,否. 接下来和之前安装N卡一样. 然后安装完了后重启就有了显卡驱动了.


重启后进入了gnome3.... 我没装xfce.是从gnome2升级上来的..还是有些不习惯. 很多地方不能自定义.



有网友要我的源文件. 我的加了2个


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-freedeb 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-freedeb http://ppa.launchpad.net/ubuntu-wine/ubuntu lucid main
deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main






官方的安全升级中文帮助文档,从squeeze(old stable) 6.0 升级到wheezy (new stable) 7.0的帮助文档

http://www.debian.org/releases/stable/amd64/release-notes.zh-cn.pdf

  相关解决方案