User avatar
DarkPlatinum
Posts: 867
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Upgrading gives dpkg errors.

Sun Dec 15, 2019 12:47 pm

Not sure what to do here. Ive tried looking online for a fix to solve this problem when doing a

Code: Select all

sudo apt full-upgrade 
Error:

Code: Select all

[email protected]:/etc/apache2 $ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  adduser apt base-passwd ca-certificates dirmngr fdisk gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv
  init-system-helpers libapt-pkg5.0 libassuan0 libblkid1 libc-bin libdebconfclient0 libfdisk1 libffi6 libgmp10 libgnutls30 libgpm2 libhogweed4
  libidn2-0 libksba8 libldap-2.4-2 libldap-common libmount1 libncursesw6 libnettle6 libnpth0 libp11-kit0 libreadline7 libsasl2-2 libsasl2-modules
  libsasl2-modules-db libseccomp2 libsemanage-common libsemanage1 libsepol1 libsmartcols1 libsqlite3-0 libssl1.1 libstdc++6 libtasn1-6 libudev1
  libunistring2 libuuid1 libzstd1 login lsb-base manpages ncurses-base ncurses-bin openssl passwd pinentry-curses raspbian-archive-keyring
  readline-common sed sysvinit-utils util-linux uuid-runtime
0 upgraded, 68 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/23.6 MB of archives.
After this operation, 58.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Traceback (most recent call last):
  File "/usr/bin/apt-listchanges", line 30, in <module>
    import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-37m-arm-linux-gnueabihf.so: ELF file version does not match current one
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 2762 files and directories currently installed.)
Preparing to unpack .../login_1%3a4.5-1.1_armhf.deb ...
Unpacking login (1:4.5-1.1) ...
dpkg: error processing archive /var/cache/apt/archives/login_1%3a4.5-1.1_armhf.deb (--unpack):
 unable to stat './usr/share/man/cs/man8/faillog.8.gz' (which I was about to install): Structure needs cleaning
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/login_1%3a4.5-1.1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Dmesg Log:

Code: Select all

[   13.199009] Bluetooth: BNEP socket layer initialized
[  292.852939] EXT4-fs error (device mmcblk0p2): ext4_lookup:1590: inode #30081: comm dpkg: iget: bad extended attribute block 256
Apache service logs:

Code: Select all

[email protected]:/etc/apache2 $ sudo service apache2 status
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2019-12-15 12:27:50 GMT; 28min ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 465 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Dec 15 12:27:49 RaspiWebService systemd[1]: Starting The Apache HTTP Server...
Dec 15 12:27:50 RaspiWebService apachectl[465]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.
Dec 15 12:27:50 RaspiWebService apachectl[465]: Action 'start' failed.
Dec 15 12:27:50 RaspiWebService apachectl[465]: The Apache error log may have more information.
Dec 15 12:27:50 RaspiWebService systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 15 12:27:50 RaspiWebService systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 15 12:27:50 RaspiWebService systemd[1]: Failed to start The Apache HTTP Server.
Not sure what happened. I had rebooted my Pi and two things happened, 1. apache did not startup (I have a wordpress site running) and 2. Attempting and update and upgrade fails.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

User avatar
rpdom
Posts: 16791
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Upgrading gives dpkg errors.

Sun Dec 15, 2019 1:18 pm

Looks like file system damage.

Can you put the card in a USB reader, then boot the Pi from another card and run fsck on the old card?

It could be that the card itself is failing, but hopefully a fsck will get things in a usable state. You may need to force a reinstall of some software.
Unreadable squiggle

User avatar
DarkPlatinum
Posts: 867
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: Upgrading gives dpkg errors.

Sun Dec 15, 2019 2:06 pm

rpdom wrote:
Sun Dec 15, 2019 1:18 pm
Looks like file system damage.

Can you put the card in a USB reader, then boot the Pi from another card and run fsck on the old card?
Couldn't do that since fsck didn't detect the card. I tried erasing the card and then reflashing. Reflashing with etcher failed. I tried another SD card (erasing) but disk utility couldn't erase it for some stupid reason "the disk has to be unmounted first" (should automatically unmount it). So either I have 2 dead SD cards, or a bug in etcher/disk utility.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

User avatar
DarkPlatinum
Posts: 867
Joined: Thu Nov 02, 2017 2:30 pm
Location: Unknown
Contact: Website YouTube

Re: Upgrading gives dpkg errors.

Sun Dec 15, 2019 2:09 pm

Looks like I must have 2 dead SD cards. How stupid. Why can't SD cards last longer.
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): https://html.dynu.net

Return to “Troubleshooting”