Skip to content

Instantly share code, notes, and snippets.

@raspiduino
Last active December 24, 2023 16:38
Show Gist options
  • Save raspiduino/3ef0d7f5fa3f5db7317b1c16fe7384c1 to your computer and use it in GitHub Desktop.
Save raspiduino/3ef0d7f5fa3f5db7317b1c16fe7384c1 to your computer and use it in GitHub Desktop.
Quick and dirty solution for the Segmentation fault problem of processing package libc-bin when using apt in Armbian

I recently have Armbian installed on my set-top box and its apt got crazy when I used it:

$ sudo apt install xfce4-terminal
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libvte-2.91-0 libvte-2.91-common
The following NEW packages will be installed:
  libvte-2.91-0 libvte-2.91-common xfce4-terminal
0 upgraded, 3 newly installed, 0 to remove and 26 not upgraded.
1 not fully installed or removed.
Need to get 2,106 kB of archives.
After this operation, 5,189 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://deb.debian.org/debian bookworm/main arm64 libvte-2.91-common arm64 0.70.6-2~deb12u1 [642 kB]
Get:2 http://deb.debian.org/debian bookworm/main arm64 libvte-2.91-0 arm64 0.70.6-2~deb12u1 [774 kB]
Get:3 http://deb.debian.org/debian bookworm/main arm64 xfce4-terminal arm64 1.0.4-1 [690 kB]
Fetched 2,106 kB in 1s (1,497 kB/s)
Armbian live patch apt
      DF00FAF1C577104B50BF1D0093D6889F9F0E78D5
Patch file is signed with Armbian GPG key
Running Armbian Live Patch
Setting up libc-bin (2.36-9+deb12u3) ...
Segmentation fault
Segmentation fault
dpkg: error processing package libc-bin (--configure):
 installed libc-bin package post-installation script subprocess returned error exit status 139
Errors were encountered while processing:
 libc-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)

After a lot of tests, here is the quick and dirty solution: create a script file of whatever name you want (let's say apt.sh) wherever you want (let's say ~), then paste this content in:

#!/bin/bash

# Create dir for holding deb files
mkdir /tmp/apt

# Tell apt to download all the deb files to the newly created dir
sudo apt-get --download-only -o Dir::Cache="/tmp/apt" "$@"

# Use dpkg to install
sudo dpkg -i /tmp/apt/archives/*.deb

# Cleanup
sudo rm -rf /tmp/apt

Save it, then give it the execute permission with chmod +x apt.sh

After that, you can install your package without the crazy libc-bin error:

$ ./apt.sh install xfce4-terminal

Enjoy your new quick and dirty workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment