
強文本我已經運行 18.04.02 Desktop 的穩定安裝大約 30 個月了。該伺服器大約兩週沒有開機,因此今天早上開機時,它進行了自動安全更新。他們完成後,我運行更新管理器並收到這些錯誤訊息
顯然這些包不一致。我透過執行「sudo nano /etc/apt /sources.list」來檢查我沒有任何第三方儲存庫。至少我是這麼認為的。
無論如何我可以恢復到一組一致的軟體包嗎?不,我沒有最近的備份。我當然遵循了錯誤訊息中的建議
已編輯以回應評論。 apt-get install -f 的輸出
Your Hardware Enablement Stack (HWE) is supported until April 2023.
Last login: Mon Sep 27 15:38:50 2021 from 192.168.1.96
stephen@leia:~$
stephen@leia:~$ sudo apt-get install -f
[sudo] password for stephen:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
linux-hwe-5.4-headers-5.4.0-77
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libwebkit2gtk-4.0-37
Suggested packages:
libwebkit2gtk-4.0-37-gtk2
The following packages will be upgraded:
libwebkit2gtk-4.0-37
1 to upgrade, 0 to newly install, 0 to remove and 24 not to upgrade.
1 not fully installed or removed.
Need to get 0 B/13.4 MB of archives.
After this operation, 81.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 264170 files and directories currently installed.)
Preparing to unpack .../libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libwebkit2gtk-4.0-37:amd64 (2.32.4-0ubuntu0.18.04.1) over (2.32.3-0ubuntu0.18.04.1) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb (--unpack):
cannot copy extracted data for './usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5' to '/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
/var/cache/apt/archives/libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
stephen@leia:~$
機器看起來很穩定,但現在無法更新。這是一個無望的原因嗎?
謝謝你的幫助
答案1
您的輸出包含解決問題所需的資訊:
cannot copy extracted data for './usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5' to '/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5.dpkg-new':unexpected end of file or stream
讓我們抽像一下以便更容易理解...
cannot copy extracted data for X to Y:unexpected end of file or stream
X = './usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5'
Y = '/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5.dpkg-new'
這是什麼意思?
」文件或串流意外結束」 的意思正如其所言 - 軟體包不完整或損壞。您必須將其從本地快取中刪除,然後讓 apt 下載該軟體包的新的、全新的、完整的副本。
哪個包?
讓我們使用 X 提供的路徑來問這個問題:
- 包名在第二行:
libwebkit2gtk-4.0-37
$ dpkg -S /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37
libwebkit2gtk-4.0-37:amd64: /usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37
如何刪除損壞的本機軟體包並下載全新的副本?
$ sudo apt clean libwebkit2gtk-4.0-37 // Delete local
$ sudo apt update
$ sudo apt install --reinstall libwebkit2gtk-4.0-37 // Download fresh
答案2
對我有用的解決方案是執行 sudo apt full-upgrade ,其效果是下載損壞的軟體包的新副本,然後執行 sudo apt update