我最近从 18.04 LTS 升级到了 20.04 LTS。升级过程并不顺利,我必须先从命令行完成升级,然后 Gnome 才能启动。现在,当我输入 sudo apt upgrade 时,出现以下错误消息:
sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
rsync
1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/322 kB of archives.
After this operation, 696 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 299035 files and directories currently installed.)
Preparing to unpack .../rsync_3.1.3-8_amd64.deb ...
Unpacking rsync (3.1.3-8) over (3.1.3-8) ...
dpkg: error processing archive /var/cache/apt/archives/rsync_3.1.3-8_amd64.deb (
--unpack):
unable to install (supposed) new info file '/var/lib/dpkg/tmp.ci/md5sums': Is a
directory
Errors were encountered while processing:
/var/cache/apt/archives/rsync_3.1.3-8_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经执行了 fsck,结果显示一切正常。有什么想法吗?
史蒂夫
答案1
这里可能出现两个问题——rsync 存档损坏和/或/var/lib/dpkg/tmp.ci/md5sums
结构损坏。
要修复该问题,请使用以下命令:
sudo apt-get clean
sudo rm -rf /var/lib/dpkg/tmp.ci/md5sums
sudo apt-get upgrade
答案2
我想我设法解决了这个问题,所以我想发布一些信息,以防对其他人有用。/var/lib/dpkg/info 中的 rsync.md5sums“文件”似乎是一个目录,不属于 root。我不知道这是怎么发生的。
steve@steve-EP43-DS3L:/var/lib/dpkg/info$ ls -la | grep md5sums
…..
-rw-r--r-- 1 root root 1095 Jan 25 2020 rhythmbox.md5sums
-rw-r--r-- 1 root root 2912 Aug 27 04:36 rhythmbox-plugin-alternative-toolbar.md5sums
-rw-r--r-- 1 root root 10836 Jan 25 2020 rhythmbox-plugins.md5sums
d--x--S--x 2 26957 31353 4096 Oct 17 2029 rsync.md5sums
-rw-r--r-- 1 root root 3905 Aug 5 01:49 rsyslog.md5sums
-rw-r--r-- 1 root root 923 Mar 24 2019 rtkit.md5sums
-rw-r--r-- 1 root root 4561 Mar 12 2020 rygel.md5sums
…..
因此我将文件移至我的主目录并重新运行升级,似乎已成功。
steve@steve-EP43-DS3L:/var/lib/dpkg/info$ sudo mv rsync.md5sums/ ~/
steve@steve-EP43-DS3L:/var/lib/dpkg/info$ sudo apt upgrade