修复未满足的依赖关系失败

修复未满足的依赖关系失败

我正在尝试在我的 pi 上设置 samba,但由于未满足的依赖关系而失败输出这个

pi@octopi:~ $ sudo apt-get install samba samba-common-bin
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:
 libpython2.7 : Depends: libpython2.7-stdlib (= 2.7.16-2) but 2.7.16-2+deb10u1 is to be installed
 libpython2.7-dev : Depends: libpython2.7 (= 2.7.16-2+deb10u1) but 2.7.16-2 is to be installed
 python2.7-dev : Depends: libpython2.7 (= 2.7.16-2+deb10u1) but 2.7.16-2 is to be installed
 samba : Depends: python-dnspython but it is not going to be installed
         Depends: python-samba but it is not going to be installed
         Depends: samba-common (= 2:4.9.5+dfsg-5+deb10u1+rpi1) but it is not going to be installed
         Depends: tdb-tools but it is not going to be installed
         Depends: libldb1 (>= 2:1.5.1+really1.4.6) but it is not going to be installed
         Depends: libtdb1 (>= 1.2.7+git20101214) but it is not going to be installed
         Depends: libtevent0 (>= 0.9.16) but it is not going to be installed
         Depends: samba-libs (= 2:4.9.5+dfsg-5+deb10u1+rpi1) but it is not going to be installed
         Recommends: attr but it is not going to be installed
         Recommends: samba-dsdb-modules but it is not going to be installed
         Recommends: samba-vfs-modules but it is not going to be installed
 samba-common-bin : Depends: python-samba but it is not going to be installed
                    Depends: samba-common (= 2:4.9.5+dfsg-5+deb10u1+rpi1) but it is not going to be installed
                    Depends: samba-libs (= 2:4.9.5+dfsg-5+deb10u1+rpi1) but it is not going to be installed
                    Depends: libtdb1 (>= 1.2.7+git20101214) but it is not going to be installed
                    Depends: libtevent0 (>= 0.9.9) but it is not going to be installed
                    Recommends: samba-dsdb-modules but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我已经尝试过以下方法:

sudo apt --fix-broken install
sudo apt-get install -f
sudo apt-get update --fix-missing

这些一般都是输出这个。输出:

pi@octopi:~ $ sudo apt --fix-broken install
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:
  pigz
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libpython2.7 libpython2.7-dev
The following packages will be upgraded:
  libpython2.7 libpython2.7-dev
2 upgraded, 0 newly installed, 0 to remove and 106 not upgraded.
2 not fully installed or removed.
Need to get 0 B/31.7 MB of archives.
After this operation, 4,096 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 47289 files and directories currently installed.)
Preparing to unpack .../libpython2.7-dev_2.7.16-2+deb10u1_armhf.deb ...
Unpacking libpython2.7-dev:armhf (2.7.16-2+deb10u1) over (2.7.16-2) ...
dpkg: error processing archive /var/cache/apt/archives/libpython2.7-dev_2.7.16-2+deb10u1_armhf.deb (--unpack):
 unable to install (supposed) new info file '/var/lib/dpkg/tmp.ci/md5sums': Is a directory
Preparing to unpack .../libpython2.7_2.7.16-2+deb10u1_armhf.deb ...
dpkg: error processing archive /var/cache/apt/archives/libpython2.7_2.7.16-2+deb10u1_armhf.deb (--unpack):
 read error in '/var/lib/dpkg/info/libpython2.7:armhf.triggers': Is a directory
Errors were encountered while processing:
 /var/cache/apt/archives/libpython2.7-dev_2.7.16-2+deb10u1_armhf.deb
 /var/cache/apt/archives/libpython2.7_2.7.16-2+deb10u1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt update输出:

pi@octopi:~ $ sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
108 packages can be upgraded. Run 'apt list --upgradable' to see them.

先感谢您。

答案1

这是你可以尝试的事情,基于询问 Ubuntu 上的帖子。不确定它是否适合您,因为最初的问题略有不同,并且是关于 Ubuntu 而不是 Debian,但可能值得尝试:

运行stat / /dev /var以检查所有目录的所有者。

如果任何目录的所有者被列为“未知”,请运行chown root whateverdirectory(用未知所拥有的目录的名称替换whateverdirectory。)

相关内容