I have a Debian 10 server where I can't update apt packages any more because of dependency issues:
# apt 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:
openssh-sftp-server : Depends: openssh-client (= 1:7.9p1-10+deb10u2) but 1:7.9p1-10+deb10u3 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Well I tried apt --fix-broken install and here is the result:
# 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:
openssh-sftp-server
The following packages will be upgraded:
openssh-sftp-server
1 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
2 not fully installed or removed.
Need to get 0 B/45,1 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Reading changelogs... Done
(Reading database ... 61990 files and directories currently installed.)
Preparing to unpack .../openssh-sftp-server_1%3a7.9p1-10+deb10u3_amd64.deb ...
Unpacking openssh-sftp-server (1:7.9p1-10+deb10u3) over (1:7.9p1-10+deb10u2) ...
dpkg: error processing archive /var/cache/apt/archives/openssh-sftp-server_1%3a7.9p1-10+deb10u3_amd64.deb (--unpack):
error creating symbolic link './usr/lib/sftp-server': Operation not permitted
Errors were encountered while processing:
/var/cache/apt/archives/openssh-sftp-server_1%3a7.9p1-10+deb10u3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I'm running this as root, so I have no idea why the operation is not permitted. I tried to google these error messages but found only different problems.
I found the solution myself: I had no idea why, but
/usr/libwas set to immutable, sochattr -i /usr/libwas enough.