Closed doobersn closed 2 years ago
Can you try following
apt update && apt upgrade
We saw this error a few times, but never were able to find out what's causing it and how to resolve:
Must be some issue with an underlying library used by APT or dpkg. The problem is that we cannot reinstall packages due to exactly this error, without rewriting sources.list
to use plain HTTP instead of encrypted+authenticated HTTPS. But even stranger, in your case http://raspbian.raspberrypi.org/raspbian
was used, as the Raspbian repo is not available via HTTPS, but still the "https" method died. But let's see first the output of Joulinar's commands, to get the full ficture.
Can you try following
apt update && apt upgrade
I usually try that first. I also tried (I think it was) sudo apt-get update && sudo apt-get dist-upgrade
by accident. Here is the output:
dietpi@DietPi:~$ apt update && apt upgrade
Reading package lists... Error!
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: can not open /var/lib/apt/lists/raspbian.raspberrypi.org_raspbian_dists_buster_InRelease - fopen (13: Permission denied)
E: The package lists or status file could not be parsed or opened.
That same command with sudo gives me:
dietpi@DietPi:~$ sudo apt update && apt upgrade
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Reading package lists... Done
E: Method https has died unexpectedly!
E: Sub-process https received a segmentation fault.
We saw this error a few times, but never were able to find out what's causing it and how to resolve:
- apt and wget segmentation fault #4088
- Upgrade 2.28 - 2.30 fails #3564 (not exactly the same)
- PREP_SYSTEM_FOR_DIETPI.sh fails because https is enabled in sources.list #2257
Must be some issue with an underlying library used by APT or dpkg. The problem is that we cannot reinstall packages due to exactly this error, without rewriting
sources.list
to use plain HTTP instead of encrypted+authenticated HTTPS. But even stranger, in your casehttp://raspbian.raspberrypi.org/raspbian
was used, as the Raspbian repo is not available via HTTPS, but still the "https" method died. But let's see first the output of Joulinar's commands, to get the full ficture.
Thanks a lot! Do you think I messed it up by trying sudo apt-get update && sudo apt-get dist-upgrade
? I didnt mean to copy and past that, but was googling to see what it did and accidentally did iirc.
The issue has no relation to the usage of apt-get
Running an APT list update and package upgrade, including distro upgrades, is a common task, not causing such errors. But indirectly, a filesystem corruption or such may have happened. Can you also check:
dmesg -l emerg,alert,crit,err
If the above does not give further hints. Please try to reinstall the apt
package manually, which includes the method file /usr/lib/apt/methods/https
:
cd /tmp
curl -LO 'http://raspbian.raspberrypi.org/raspbian/pool/main/a/apt/apt_1.8.2.3_armhf.deb'
dpkg -i apt_1.8.2.3_armhf.deb
rm apt_1.8.2.3_armhf.deb
Running an APT list update and package upgrade, including distro upgrades, is a common task, not causing such errors. But indirectly, a filesystem corruption or such may have happened. Can you also check:
dmesg -l emerg,alert,crit,err
For this I got:
dietpi@DietPi:~$ dmesg -l emerg,alert,crit,err
[ 17.111755] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 17.418007] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 17.418266] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 17.418422] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[ 17.419743] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
[ 24.261064] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save disabled
[ 27.525326] EXT4-fs error (device mmcblk0p2): ext4_mb_generate_buddy:805: group 25, block bitmap and bg descriptor inconsistent: 7994 vs 10042 free clusters
[ 101.610978] mmc0: timeout waiting for hardware interrupt.
Should I go ahead and reinstall the apt package like you mentioned? Thank you so much for helping me!
There is at least one filesystem error in the logs, though seems to be not critical and was shortly after boot. However, please do an fsck scan and repair on reboot first:
> /forcefsck
reboot
# after reboot
journalctl -t systemd-fsck
If you have a screen attached: Depending on the SD card size and speed this may take a while. Leave it running, the greenish LED should give a hint about I/O activity, so when it calms down, it's ready for SSH access.
When
There is at least one filesystem error in the logs, though seems to be not critical and was shortly after boot. However, please do an fsck scan and repair on reboot first:
> /forcefsck reboot # after reboot journalctl -t systemd-fsck
If you have a screen attached: Depending on the SD card size and speed this may take a while. Leave it running, the greenish LED should give a hint about I/O activity, so when it calms down, it's ready for SSH access.
When I try to run > /forcefsck
(even with sudo) it says: Permission denied
. My gosh, im not cut out for this, haha.
Try using root
user
Ah, do so:
sudo eval '> /forcefsck'
sudo
does not span across shell redirects, so those need to be wrapped into eval
, a subshell or similar.
Ah, do so:
sudo eval '> /forcefsck'
sudo
does not span across shell redirects, so those need to be wrapped intoeval
, a subshell or similar.
Alrighty, that gives me:
dietpi@DietPi:~$ sudo eval '> /forcefsck' sudo: eval: command not found dietpi@DietPi:~$ sudo eval > /forcefsck -bash: /forcefsck: Permission denied
I tried with and without the `! Insanity! Thanks for sticking with me through this. :)
Try using root
user. This will simplify thinks.
Or:
sudo dash -c '> /forcefsck'
Try using
root
user. This will simplify thinks.
I do sudo -I
for that right?
Or:
sudo dash -c '> /forcefsck'
This worked (I think) but didnt say anything. Then when I did reboot
it said Failed to connect to bus: No such file or directory
. So Im thinking maybe its running? Or maybe not, lol.
sudo reboot
How did you reboot before? 😄
```shell sudo reboot
How did you reboot before? 😄
🤦♂️ Whoops, lol.
Okie dokie so, I'm here now:
dietpi@DietPi:~$ journalctl -t systemd-fsck
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
dietpi@DietPi:~$ sudo journalctl -t systemd-fsck
Illegal instruction
I wish I knew how to format these posts so it would appear as it does in the terminal. Sorry about that!
Use code fences for multi line console pasts, like so:
line 1 line 2
Illegal instruction
hmm, that doesn't sound so good. Can you please login as root
user and try that again (without sudo
)? Also it makes things easier for package reinstalls etc. Does journalctl
(without any arguments) return Illegal instructions
as well? Also check again dmesg -l emerg,alert,crit,err
then.
And let's see whether APT can be repaired now:
cd /tmp
curl -LO 'http://raspbian.raspberrypi.org/raspbian/pool/main/a/apt/apt_1.8.2.3_armhf.deb'
dpkg -i apt_1.8.2.3_armhf.deb
rm apt_1.8.2.3_armhf.deb
/boot/dietpi/func/dietpi-set_software apt-cache clean
apt update
apt upgrade
O
Use code fences for multi line console pasts, like so:
line 1 line 2
Illegal instruction
hmm, that doesn't sound so good. Can you please login asroot
user and try that again (withoutsudo
)? Also it makes things easier for package reinstalls etc. Doesjournalctl
(without any arguments) returnIllegal instructions
as well? Also check againdmesg -l emerg,alert,crit,err
then.And let's see whether APT can be repaired now:
cd /tmp curl -LO 'http://raspbian.raspberrypi.org/raspbian/pool/main/a/apt/apt_1.8.2.3_armhf.deb' dpkg -i apt_1.8.2.3_armhf.deb rm apt_1.8.2.3_armhf.deb /boot/dietpi/func/dietpi-set_software apt-cache clean apt update apt upgrade
Ooooh, thank you! Okay, I have no idea how to login as a root user. I tried sudo -I
and that was an illegal command. I'm seeing varying things when I google. Should I try this?
You will need to do:
sudo passwd root Then go ahead to set password. Use the root user using
su root
Which honestly the second part makes no sense to me, lol. Man, I hate this! I feel like im taking up too much of your time. I really should just buy a new sd card and reinstall, but it takes so long.
How do you login as user dietpi
? Simply use user root
instead.
O
Use code fences for multi line console pasts, like so:
line 1 line 2
Illegal instruction
hmm, that doesn't sound so good. Can you please login asroot
user and try that again (withoutsudo
)? Also it makes things easier for package reinstalls etc. Doesjournalctl
(without any arguments) returnIllegal instructions
as well? Also check againdmesg -l emerg,alert,crit,err
then. And let's see whether APT can be repaired now:cd /tmp curl -LO 'http://raspbian.raspberrypi.org/raspbian/pool/main/a/apt/apt_1.8.2.3_armhf.deb' dpkg -i apt_1.8.2.3_armhf.deb rm apt_1.8.2.3_armhf.deb /boot/dietpi/func/dietpi-set_software apt-cache clean apt update apt upgrade
Ooooh, thank you! Okay, I have no idea how to login as a root user. I tried
sudo -I
and that was an illegal command. I'm seeing varying things when I google. Should I try this?You will need to do: sudo passwd root Then go ahead to set password. Use the root user using su root
Which honestly the second part makes no sense to me, lol. Man, I hate this! I feel like im taking up too much of your time. I really should just buy a new sd card and reinstall, but it takes so long.
systemd-fsck[99]: Signal (11) SIGSEGV si_code=SEGV_MAPERR fault addr=0x6da4d2a6
fsck
itself fails with a segmentation fault 🤔. Let's try to reinstall it as well:
cd /tmp
curl -LO 'http://raspbian.raspberrypi.org/raspbian/pool/main/e/e2fsprogs/e2fsprogs_1.44.5-1+deb10u3_armhf.deb'
dpkg -i e2fsprogs_1.44.5-1+deb10u3_armhf.deb
rm e2fsprogs_1.44.5-1+deb10u3_armhf.deb
Let's also try to switch to plain HTTP with the RPi repo:
sed -i 's|https://|http://|' /etc/apt/sources.list.d/raspi.list
apt update
systemd-fsck[99]: Signal (11) SIGSEGV si_code=SEGV_MAPERR fault addr=0x6da4d2a6
fsck
itself fails with a segmentation fault 🤔. Let's try to reinstall it as well:cd /tmp curl -LO 'http://raspbian.raspberrypi.org/raspbian/pool/main/e/e2fsprogs/e2fsprogs_1.44.5-1+deb10u3_armhf.deb' dpkg -i e2fsprogs_1.44.5-1+deb10u3_armhf.deb rm e2fsprogs_1.44.5-1+deb10u3_armhf.deb
Let's also try to switch to plain HTTP with the RPi repo:
sed -i 's|https://|http://|' /etc/apt/sources.list.d/raspi.list apt update
Alrighty, here's another!
root@DietPi:~# sed -i 's|https://|http://|' /etc/apt/sources.list.d/raspi.list
root@DietPi:~# apt update
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:4 http://archive.raspberrypi.org/debian buster/main armhf Packages [393 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian buster/contrib armhf Packages [58.8 kB]
Get:6 http://raspbian.raspberrypi.org/raspbian buster/non-free armhf Packages [104 kB]
Get:7 http://raspbian.raspberrypi.org/raspbian buster/rpi armhf Packages [1,360 B]
Fetched 13.6 MB in 30s (461 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
44 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@DietPi:~# cd /tmp
root@DietPi:/tmp# curl -LO 'http://raspbian.raspberrypi.org/raspbian/pool/main/e/e2fsprogs/e2fsprogs_1.44.5-1+deb10u3_armhf.deb'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 383 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 519k 100 519k 0 0 610k 0 --:--:-- --:--:-- --:--:-- 1794k
root@DietPi:/tmp# dpkg -i e2fsprogs_1.44.5-1+deb10u3_armhf.deb
(Reading database ... 25253 files and directories currently installed.)
Preparing to unpack e2fsprogs_1.44.5-1+deb10u3_armhf.deb ...
Unpacking e2fsprogs (1.44.5-1+deb10u3) over (1.44.5-1+deb10u3) ...
Setting up e2fsprogs (1.44.5-1+deb10u3) ...
root@DietPi:/tmp# rm e2fsprogs_1.44.5-1+deb10u3_armhf.deb
root@DietPi:/tmp#
Btw, when you post these commands, can I literally copy and paste them when they are multiple lines? Thank you so so much!
OMFG!!!!
IT WORKED!!!
Longest install ever but it apparently even fixed the pihole webgui!! THANK YOU @MichaIng! Also thank you to @Joulinar!!!
I think the only thing not correct is the timezone now!
I try to have the commands in code blocks so that they can be copy&pasted all together. But it may have some advantage to paste them one by one to have more control.
44 packages can be upgraded. Run 'apt list --upgradable' to see them.
44 packages were waiting for an upgrade, which is the reason it took a while 🙂.
The time zone can be adjusted via dietpi-config
or dpkg-reconfigure tzdata
.
Great that it worked now. Still, I'd retry the fsck
and after that worked try to fix HTTPS for APT:
sudo dash -c '> /forcefsck'
sudo reboot
# after reboot
sudo journalctl -t systemd-fsck
Marking this as closed now. Feel free to reopen when required.
I run only pihole on my pi zero w on dietpi. Noticed pihole wasnt blocking everything correctly (though some stuff still seems to be blocked) even though status shows everything is fine. So I updated pihole but it made no difference. Tried updating dietpi and it gave me this error:
Any suggestions on what to do to fix it? Thank you very much!