上述两种解决方案都不适合我.做了什么工作将必要的包裹固定在旧的马厩上
将以下内容添加到/etc/apt/sources.lst
deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free
创建
/etc/apt/preferences.d/preferences
并添加您需要降级的软件包,例如在我的情况下
Package: php5*
Pin: release a=oldstable
Pin-Priority: 700
Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700
Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700
Package: php-pear
Pin: release a=oldstable
Pin-Priority: 700
Package: *
Pin: release a=stable
Pin-Priority: 600
然后运行命令
aptitude update
aptitude reinstall
/etc/init.d/apache2 restart
如果您想知道需要升级的软件包,请运行:
dpkg -l|grep php|grep 5.4|awk '{print $2}'