@Halvor Raknes wrote:
Resource constraints may be relevant. How much space is available on the drive? For example, on a machine here, the following command and output will show usage:
Code:
[~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 7901224 0 7901224 0% /dev
tmpfs 1600420 1764 1598656 1% /run
/dev/nvme0n1p3 463735568 46717292 412279176 11% / <-------NOTE ROOT PARTITION USAGE
tmpfs 8002092 544 8001548 1% /dev/shm
efivarfs 192 98 90 53% /sys/firmware/efi/efivars
none 1024 0 1024 0% /run/credentials/systemd-journald.service
tmpfs 8002092 4216 7997876 1% /tmp
/dev/nvme0n1p1 486456 4936 481520 2% /boot/efi
none 1024 0 1024 0% /run/credentials/[email protected]
tmpfs 1600416 48 1600368 1% /run/user/1000
If, for example, one had deleted the /var/lib/dpkg/info file to create a bit more space, then the situation described in post #1 could result.
In any case, the situation appears dire to me because of the following considerations.
Since apt has missing metadata that is normally available in /var/lib/dpkg/info, then apt itself would need to be re-installed. Doubtless that missing metadata is implicated in the the failures of apt that you have described. Clearly, a fully functioning apt is necessary for normal installation using apt. Unfortunately, apt has numerous dependencies, as seen here:
Code:
[~]$ apt depends apt
apt
|Depends: base-passwd (>= 3.6.1)
Depends: adduser
Depends: sqv (>= 1.3.0)
Depends: libapt-pkg7.0 (>= 3.3.1)
Depends: debian-archive-keyring
Depends: libc6 (>= 2.38)
Depends: libgcc-s1 (>= 3.0)
Depends: libseccomp2 (>= 2.4.2)
Depends: libssl3t64 (>= 3.0.0)
Depends: libstdc++6 (>= 13.1)
Depends: libsystemd0
Conflicts: <apt-verify>
Conflicts: <libnettle8> (<< 3.9.1-2.2~)
Breaks: apt-transport-https (<< 1.5~alpha4~)
Breaks: apt-utils (<< 1.3~exp2~)
Breaks: aptitude (<< 0.8.10)
Recommends: ca-certificates
Suggests: apt-doc
|Suggests: aptitude
|Suggests: synaptic
Suggests: wajig
Suggests: dpkg-dev (>= 1.17.2)
|Suggests: gnupg
|Suggests: gnupg2
Suggests: gnupg1
Suggests: powermgmt-base
Replaces: apt-transport-https (<< 1.5~alpha4~)
Replaces: apt-utils (<< 1.3~exp2~)
To satisfy those dependencies, theoretically one could download all the relevant .deb files and then ask dpkg to install all of them. However, any of the those dependencies may have their own dependencies which can lead to "dependency hell" which could be a very long time-consuming activity to involve oneself in to try and get a fully functioning apt back on the system. The apt package manager was designed to manage and resolve just these dependency issues.
In the past, many years ago, I did follow dependencies on numerous occasons to try and catch them all to install a package that needed them. It was time-consuming, a headache for me, and what I learnt was that "dependency hell" isn't my favourite place to be, and that package managers are very handy software

. At this point, I would be thinking of backing up and re-installing the system.