Debian
deb包升級時如何調試dpkg錯誤碼(1)?
Operating System: Debian GNU/Linux 8.8 (jessie) Kernel: Linux 3.16.0-4-amd64 Architecture: x86-64
我有幾個 Debian 伺服器。
每個都包含在預設儲存庫
nginx
版本 1.6 中。從原始
nginx
儲存庫更新後,在所有伺服器上收到相同的錯誤:Preparing to unpack .../nginx_1.12.0-1~jessie_amd64.deb ... Unpacking nginx (1.12.0-1~jessie) over (1.6.2-5+deb8u4) ... dpkg: error processing archive /var/cache/apt/archives/nginx_1.12.0-1~jessie_amd64.deb (--unpack): trying to overwrite '/etc/default/nginx', which is also in package nginx-common 1.6.2-5+deb8u4 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/nginx_1.12.0-1~jessie_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
我試圖
deb
從原始碼建構包,但仍然得到同樣的錯誤。如果不將 Debian 重新安裝到更新版本,我找不到任何升級它的方法。
/var/log/dpkg.log
:2017-06-26 19:56:31 startup archives install 2017-06-26 19:56:31 upgrade nginx:all 1.6.2-5+deb8u4 1.12.0-1~jessie 2017-06-26 19:56:31 status half-configured nginx:all 1.6.2-5+deb8u4 2017-06-26 19:56:31 status unpacked nginx:all 1.6.2-5+deb8u4 2017-06-26 19:56:31 status half-installed nginx:all 1.6.2-5+deb8u4 2017-06-26 19:56:32 status unpacked nginx:all 1.6.2-5+deb8u4 2017-06-26 19:56:32 status installed nginx:all 1.6.2-5+deb8u4
我已嘗試完全解除安裝/清除預設設置
nginx
並安裝更新版本,但仍然出現錯誤。The following packages have been kept back: libpcre3 libpcre3-dev nginx nginx-common nginx-full 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
成為根:
sudo -i
或者:
su
2017-06-26 19:56:31 status half-configured nginx:all 1.6.2-5+deb8u4
配置包:
dpkg --configure -a
修復損壞的包:
apt-get install --fix-broken
繼續升級:
apt-get dist-upgrade
清除+重新安裝時很難說出您嘗試了什麼,但試試這個:
sudo dpkg --purge --force-all nginx nginx-common nginx-full sudo apt-get install nginx