On Sun, Dec 17, 2023 at 09:42:19PM -0500, Cindy Sue Causey wrote:
> dpkg-deb: error: failed to read archive
> '/var/cache/apt/archives/dpkg_1.22.1_amd64.deb': Too many levels of
> symbolic links
> dpkg: error: parsing file '/var/lib/dpkg/status' near line 2 package 'dpkg':
>  'Version' field value '': version string is empty
> 
> Too many levels of symbolic links... I've seen that over the years
> while breaking my system. So I visually inspected the apt/archives
> directory. Whatever debootstrap is seeing as too many symlinks is not
> visually apparent.

Well, why not *show us*?

Here's one way to produce that error message:

unicorn:~$ mkdir /tmp/subdir
unicorn:~$ ln -s link /tmp/subdir/link
unicorn:~$ ls /tmp/subdir/link/foo
ls: cannot access '/tmp/subdir/link/foo': Too many levels of symbolic links
unicorn:~$ ls -ld /tmp/subdir/link
lrwxrwxrwx 1 greg greg 4 Dec 17 22:00 /tmp/subdir/link -> link

For your error message, you'd want to look at

    ls -ld /var /var/cache /var/cache/apt /var/cache/apt/archives

I think we can assume that / isn't a circular symlink, but if you want
to throw in / as well, it wouldn't hurt.

You mentioned debootstrap, so it's not clear to me whether the error
is coming from your regular directories, or from a /var/cache/apt/archives
that's inside a chroot somewhere.  If it's coming from a chroot, then
that's where you'll want to look.

Reply via email to