Score:1

apt install return /lib/ld-linux-armhf.so.3 but i'm on x86_64 machine

tg flag

I'm running on x86_64 machine

uname -a

return

5.4.0-135-generic #152~18.04.2-Ubuntu SMP Tue Nov 29 08:23:49 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

when I'm using apt or apt-get i get error message of:

input:

sudo apt install tree

output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
tree is already the newest version (1.7.0-5).
The following packages were automatically installed and are no longer required:
  gir1.2-appindicator3-0.1 gir1.2-spiceclientglib-2.0 gir1.2-spiceclientgtk-3.0 gnome-online-accounts linux-headers-5.4.0-131-generic linux-hwe-5.4-headers-5.4.0-131 linux-image-5.4.0-131-generic
  linux-modules-5.4.0-131-generic linux-modules-extra-5.4.0-131-generic python3-macaroonbakery python3-nacl python3-protobuf python3-pymacaroons python3-rfc3339 python3-tz ubuntu-system-service
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  multiboot-doc grub-emu xorriso desktop-base
The following packages will be upgraded:
  grub-common
1 upgraded, 0 newly installed, 0 to remove and 42 not upgraded.
12 not fully installed or removed.
Need to get 0 B/1,810 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 246727 files and directories currently installed.)
Preparing to unpack .../grub-common_2.02-2ubuntu8.25_amd64.deb ...
/lib/ld-linux-armhf.so.3: No such file or directory
/lib/ld-linux-armhf.so.3: No such file or directory
/lib/ld-linux-armhf.so.3: No such file or directory
invoke-rc.d: initscript grub-common, action "stop" failed.
dpkg: warning: old grub-common package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
/lib/ld-linux-armhf.so.3: No such file or directory
/lib/ld-linux-armhf.so.3: No such file or directory
/lib/ld-linux-armhf.so.3: No such file or directory
invoke-rc.d: initscript grub-common, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/grub-common_2.02-2ubuntu8.25_amd64.deb (--unpack):
 new grub-common package pre-removal script subprocess returned error exit status 1
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
/lib/ld-linux-armhf.so.3: No such file or directory
/lib/ld-linux-armhf.so.3: No such file or directory
/lib/ld-linux-armhf.so.3: No such file or directory
/lib/ld-linux-armhf.so.3: No such file or directory
invoke-rc.d: initscript grub-common, action "start" failed.
/lib/ld-linux-armhf.so.3: No such file or directory
dpkg: error while cleaning up:
 installed grub-common package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/grub-common_2.02-2ubuntu8.25_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The sources are

input:

> cat /etc/apt/sources.list

output:

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse

also

cat cat /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-bionic.list

output:

deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic main
# deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic main

I tried to reinstall apt and dpkg, but i didn't helped
i cant understand why x68_64 will need ld-linux-armhf.so.3

yntnm avatar
tg flag
done, full output
Organic Marble avatar
us flag
The list of packages to be removed suggests severe errors in your sources exist. Please add the contents of `/etc/apt/sources.list` and any files in `/etc/apt/sources.list.d` to your question.
yntnm avatar
tg flag
@OrganicMarble done
hr flag
Do you perhaps have an ARM version of dpkg installed somewhere early in sudo's `secure_path`? What does `sudo bash -c 'type -a dpkg'` say? How about `sudo bash -c 'ldd $(command -v dpkg)'` ?
yntnm avatar
tg flag
@steeldriver i guess i have in some way "sudo bash -c 'ldd $(command -v dpkg)' linux-vdso.so.1 (0x00007ffcc4f07000) libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f70c4bf7000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f70c4806000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f70c4595000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f70c4391000) /lib64/ld-linux-x86-64.so.2 (0x00007f70c527c000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f70c4172000)"
yntnm avatar
tg flag
@steeldriver and the sudo bash -c 'type -a dpkg' is dpkg is /usr/bin/dpkg
hr flag
Those would be easier to read as edits rather than comments - but I don't see anything ARM related there. Must be some other issue.
user.dz avatar
ng flag
It could be something injected in shell/bash profile/rc, because it seems to repeat multiple times for same step. Have you @yntnm modified it or installed manually new a tool lately?
hr flag
... since `invoke-rc.d` is a POSIX shell script (`/bin/sh`) that invokes another POSIX shell script (`/etc/init.d/grub-common`) I wonder if it is `/bin/sh` that is messed up? Either symlinked to something other than `/bin/dash` or `/bin/dash` itself is broken?
yntnm avatar
tg flag
@steeldriver yes "dpkg is /usr/bin/dpkg"
yntnm avatar
tg flag
@user.dz i do a lot of cross compile to arm, so i do lot of change, i dont know what broke what and when...
hr flag
@yntnm I'm not so interested in dpgk itself (I think we've pretty much ruled that out) - can you please check what /bin/sh resolves to (e.g. `realpath /bin/sh`) and verify that *it* works correctly
yntnm avatar
tg flag
realpath /bin/sh points to /bin/dash, and when i'm run it looks good...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.