Apt 安装损坏

Apt 安装损坏

在过去几天里,我已经从 debian 8、9 升级到 10。在此过程中的某个时刻,apt 停止运行,因为它无法升级 gnuplot 包(我确信我一开始就不会使用它)。我快要抓狂了,因为我已经搜索解决方案一段时间了。

○ → apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 gnuplot-nox : Depends: gnuplot-data (= 5.2.6+dfsg1-1+deb10u1) but 4.6.6-2+deb8u1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
○ → apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  gnuplot-data
The following packages will be upgraded:
  gnuplot-data
1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
4 not fully installed or removed.
Need to get 0 B/180 kB of archives.
After this operation, 37.9 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 138120 files and directories currently installed.)
Preparing to unpack .../gnuplot-data_5.2.6+dfsg1-1+deb10u1_all.deb ...
Unpacking gnuplot-data (5.2.6+dfsg1-1+deb10u1) over (4.6.6-2+deb8u1) ...
dpkg: error processing archive /var/cache/apt/archives/gnuplot-data_5.2.6+dfsg1-1+deb10u1_all.deb (--unpack):
 trying to overwrite '/usr/share/texmf/tex/latex/gnuplot/gnuplot-lua-tikz-common.tex', which is also in package gnuplot-tex 4.6.6-2+deb8u1
Errors were encountered while processing:
 /var/cache/apt/archives/gnuplot-data_5.2.6+dfsg1-1+deb10u1_all.deb

此外,我认为这与此无关,但可能值得一提,我的内核无法升级(可能是因为 apt 损坏)。我会在以后寻找解决方案,以免偏离原先的问题。

Linux ****.com 3.10.0-1127.10.1.vz7.162.5 #1 SMP Thu Jun 18 20:32:03 MSK 2020 x86_64 GNU/Linux

cat /etc/apt/sources.list
deb http://deb.debian.org/debian buster main
deb-src http://deb.debian.org/debian buster main

deb http://deb.debian.org/debian-security/ buster/updates main
deb-src http://deb.debian.org/debian-security/ buster/updates main

deb http://deb.debian.org/debian buster-updates main
deb-src http://deb.debian.org/debian buster-updates main

我的 apt 缓存中显示 linux 标头 5.6 和 5.7。我认为损坏的 gnuplot 不允许我升级?有什么提示吗?我在升级之间重启了好几次。我真的很想把整个包都删除,然后让 apt 再次工作

答案1

查看此 Debian Bug 以找到解决方案 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826701

简而言之:

dpkg -i --force-overwrite “文件”

apt-get 安装 -f

相关内容