sudo apt-get upgrade 出再出錯誤訊息 [論壇 - Ubuntu基本設定]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



sudo apt-get upgrade 出再出錯誤訊息
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24806
EXP: 86
離線
各位先進,當我下完apt-get upgrade 時,出現如下訊息

marco@server:~$ sudo apt-get upgrade
[sudo] password for marco:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 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
E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true
marco@server:~$

接下來該怎麼辦呢?

2015/11/28 17:25
應用擴展 工具箱
回覆: sudo apt-get upgrade 出再出錯誤訊息
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 905
MP : 679 / 30267
EXP: 23
離線
Marco 寫到:
各位先進,當我下完apt-get upgrade 時,出現如下訊息

marco@server:~$ sudo apt-get upgrade
[sudo] password for marco:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 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
E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true
marco@server:~$

接下來該怎麼辦呢?


關於


1 not fully installed or removed.


通常我會先執行


$ sudo apt-get install -f


關於


E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true



沒遇過這個問題,

所以用「E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there」查詢,

查到前面兩篇「1」和「2」,

裡面有提到一個方法,一篇說有效,一篇說無效。

主要要重建一個檔「/etc/apt/apt.conf.d/70debconf」。

我查看我的系統「Xubuntu 14.04 64位元」這個檔,是存在的。


$ cat /etc/apt/apt.conf.d/70debconf



顯示


// Pre-configure all packages with debconf before they are installed.
// If you don't like it, comment it out.
DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};



查看是屬於那個套件

執行


$ dpkg -S /etc/apt/apt.conf.d/70debconf



顯示


debconf: /etc/apt/apt.conf.d/70debconf



「/etc/apt/apt.conf.d/70debconf」是屬於「debconf」這個套件。


再來不知道該怎麼研究了,歹勢,你要根據你系統的狀況自行探索了,

看你的系統是否有「/etc/apt/apt.conf.d/70debconf」這個檔。

要照上面查到的文章說的,重建那個檔,

還是要reinstall套件「debconf」。

在嘗試看看會不會有問題。

在不然那個檔有註解提到


// Pre-configure all packages with debconf before they are installed.
// If you don't like it, comment it out.


不過,不曉得會不會出啥問題,沒試過,我對這段流程不清楚。

先提供以上線索,

報告完畢。


2015/11/28 20:40
應用擴展 工具箱
回覆: sudo apt-get upgrade 出再出錯誤訊息
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24806
EXP: 86
離線
十分感謝費心指教
整件事情的起因是, 我今天將 ubuntu 由 15.04 升級 15.10

升級到約 80%左右,系統停滯很久沒有反應
被迫無奈關閉電源重新開機

好在系統有開起來,除了這一點外,其它服務似乎還正常

敝人程度有限,實不敢胡亂下手
我想,若再重新執行 do-release , 再來重新升級一遍
是否可行?

2015/11/28 21:03
應用擴展 工具箱
回覆: sudo apt-get upgrade 出再出錯誤訊息
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 905
MP : 679 / 30267
EXP: 23
離線
Marco 寫到:
十分感謝費心指教
整件事情的起因是, 我今天將 ubuntu 由 15.04 升級 15.10

升級到約 80%左右,系統停滯很久沒有反應
被迫無奈關閉電源重新開機

好在系統有開起來,除了這一點外,其它服務似乎還正常

敝人程度有限,實不敢胡亂下手
我想,若再重新執行 do-release , 再來重新升級一遍
是否可行?



Marco 寫到:
我想,若再重新執行 do-release , 再來重新升級一遍
是否可行?



我沒用升級的方式過,所以這部份我就無從說起,這我們之前有討論過。


不過你可以可以先試試,下面的指令,看看會出現什麼訊息



$ sudo apt-get install -f




我猜應該還是會卡住,不過可以先嘗試看看,看會出現什麼訊息,

再來找看看有沒有線索可尋。

這個指令應該不會有很大的副作用,

有再度confirm問你yes 或 no 的時候,千萬不要按下enter。請按Ctrl+c。

執行上面的指令,只是要看訊息,找線索




另外還在看

* $ man dpkg-preconfigure

* $ man debconf

## 其他參考

* $ man apt-get


...略...

-f, --fix-broken
Fix; attempt to correct a system with broken dependencies in place.
This option, when used with install/remove, can omit any packages
to permit APT to deduce a likely solution. If packages are
specified, these have to completely correct the problem. The option
is sometimes necessary when running APT for the first time; APT
itself does not allow broken package dependencies to exist on a
system. It is possible that a system's dependency structure can be
so corrupt as to require manual intervention (which usually means
using dpkg --remove to eliminate some of the offending packages).
Use of this option together with -m may produce an error in some
situations. Configuration Item: APT::Get::Fix-Broken.

-m, --ignore-missing, --fix-missing
Ignore missing packages; if packages cannot be retrieved or fail
the integrity check after retrieval (corrupted package files), hold
back those packages and handle the result. Use of this option
together with -f may produce an error in some situations. If a
package is selected for installation (particularly if it is
mentioned on the command line) and it could not be downloaded then
it will be silently held back. Configuration Item:
APT::Get::Fix-Missing.

...略...

2015/11/28 21:25
應用擴展 工具箱
回覆: sudo apt-get upgrade 出再出錯誤訊息
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24806
EXP: 86
離線
Setting up fail2ban (0.9.3-1) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
insserv: warning: script 'gdm' missing LSB tags and overrides
insserv: script gdm: service gdm already provided!
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `gdm'
Job for fail2ban.service failed because the control process exited with error code. See "systemctl status fail2ban.service" and "journalctl -xe" for details.
invoke-rc.d: initscript fail2ban, action "start" failed.
dpkg: error processing package fail2ban (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)


好像跟 fail2ban 有關?

2015/11/28 21:37
應用擴展 工具箱
回覆: sudo apt-get upgrade 出再出錯誤訊息
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 905
MP : 679 / 30267
EXP: 23
離線
Marco 寫到:
Setting up fail2ban (0.9.3-1) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
insserv: warning: script 'gdm' missing LSB tags and overrides
insserv: script gdm: service gdm already provided!
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `gdm'
Job for fail2ban.service failed because the control process exited with error code. See "systemctl status fail2ban.service" and "journalctl -xe" for details.
invoke-rc.d: initscript fail2ban, action "start" failed.
dpkg: error processing package fail2ban (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)


好像跟 fail2ban 有關?



我目前能想到,可以嘗試的方式,

先把 fail2ban 移除,先不要讓升級卡住,

升級後,然後再裝回去吧!




2015/11/28 21:46
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.