Error with apt install

When i try to install something with apt install it show me this error an i cant understand it. Any ideas?


there is no need to do print screen, you could simply copy your output from SSH terminal directly. This will be easier to read and to work with.

Can you run following and share the full output pls

/boot/dietpi/func/dietpi-set_software apt-cache clean
apt update && apt upgrade
root@DietPi:~# /boot/dietpi/func/dietpi-set_software apt-cache clean

 DietPi-Set_software
─────────────────────────────────────────────────────
 Mode: apt-cache (clean)

[  OK  ] apt-cache clean | Completed
root@DietPi:~# apt update && apt upgrade
Get:1 https://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 https://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:3 https://deb.debian.org/debian-security bullseye-security InRelease [44.1 k                                                                                                                       B]
Get:4 https://deb.debian.org/debian bullseye-backports InRelease [43.7 kB]
Get:5 https://archive.raspberrypi.org/debian bullseye InRelease [23.5 kB]
Get:6 https://deb.debian.org/debian bullseye/main armhf Packages [7942 kB]
Get:7 https://deb.debian.org/debian bullseye/contrib armhf Packages [40.2 kB]
Get:8 https://deb.debian.org/debian bullseye/non-free armhf Packages [56.3 kB]
Get:9 https://deb.debian.org/debian bullseye-updates/main armhf Packages [2600 B                                                                                                                       ]
Get:10 https://deb.debian.org/debian-security bullseye-security/main armhf Packa                                                                                                                       ges [88.9 kB]
Get:11 https://deb.debian.org/debian bullseye-backports/main armhf Packages [132                                                                                                                        kB]
Get:12 https://deb.debian.org/debian bullseye-backports/contrib armhf Packages [                                                                                                                       2864 B]
Get:13 https://deb.debian.org/debian bullseye-backports/non-free armhf Packages                                                                                                                        [1224 B]
Get:14 https://archive.raspberrypi.org/debian bullseye/main armhf Packages [205                                                                                                                        kB]
Fetched 8738 kB in 7s (1224 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: No sandbox user '_apt' on the system, can not drop privileges
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@DietPi:~#

Like this?

it’s perfectly fine this way.

It’s just a warning but strange that you are missing the user _apt. Let’s try to reinstall apt package

apt install --reinstall apt
root@DietPi:~# apt install --reinstall apt
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Archives directory /var/cache/apt/archives/partial is missing. - Acquire (2: No such file or directory)
root@DietPi:~#

something wrong on your system as you missing the directory as well. Not sure how this could happen. Could you check for kernel error messages

dmesg -l err,crit,alert,emerg
root@DietPi:~# dmesg -l err,crit,alert,emerg
[    5.146259] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    5.400139] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    5.409057] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    5.955182] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jan  4 2021 19:56:29 version 7.45.229 (617f1f5 CY) FWID 01-2dbd9d2e
[    6.346628] EXT4-fs error (device mmcblk0p2): ext4_validate_block_bitmap:390: comm systemd: bg 32: bad block bitmap checksum
[    7.890681] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled

it’s just 1 but at least a file system error. can you try following

> /forcefsck
reboot
# then after reboot
journalctl -t systemd-fsck

I think my raspberry is dead because now is in bootloop :cry:

do you have a screen attached? Does it displey something?

Chek the video

And this is the last frame


restart.PNG

could you remove the SD card and place it in desktop computer. There you should be able to access the bootFS partition. On that partition you have a file cmdline.txt. Open it and remove the quiet. Save the file, place it back to your device and reboot… Hopefully it will give some more information.

ok, now another loop after some operation it says check disk and when complete it repeated again

can you put back the SD card to your computer. There should be a file forcefsck on boot partition. Pls remove and reboot afterwards the device

i don’t have any file with this name


MichaIng
Any ideas why system is running in boot loop. We tried to do a forcefsck

forcefsck needs to be located in the root partition, not in the boot partition. But since it’s ext4, it is hard to access from Windows or macOS. What you can do instead is adding fsck.mode=force to the boot parameters in cmdline.txt. When boot succeeds, you need to manually remove it, else all drives will be forcefully checked on every boot :wink:.

Another thing is to enable boot messages on console. For this remove quiet from cmdline.txt. The boot loop is very quick, but when doing a video you’re hopefully able to catch the related error message. The quality should be higher, maybe but the camera onto a table instead of holding it and avoid lossy compression when uploading or viewing it.

Not sure how I could mix RootFS and BootFS :cry:

MichaIng
quite we already removed

Ah sorry, the exact error message would be good + the fsck.mode=force mentioned above.

Also try to check and fix the boot/FAT filesystem from Windows or macOS.

Reading from the start of the thread, there seems to be something seriously wrong indeed. Do you have a backup on an external drive? Probably its easier to reformat the SD card, flash a new DietPi image (for partitioning) and then removing all content + copying the backup inside, e.g. from a VM or other Linux system which can mount ext4.