27

Today while attempting to upgrade based on Ubuntu Software suggestion, I see the following errors. This is the first time I see this error. My 18.04 system has been working just fine for many months now.

Any help is appreciated.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu 
DISTRIB_RELEASE=18.04 
DISTRIB_CODENAME=bionic 
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"



$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libc6-armel-cross libc6-armhf-cross libc6-dev-armel-cross libc6-dev-armhf-cross
4 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/5,871 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 388166 files and directories currently installed.)
Preparing to unpack .../libc6-dev-armel-cross_2.27-3ubuntu1cross1.1_all.deb ...
Unpacking libc6-dev-armel-cross (2.27-3ubuntu1cross1.1) over (2.27-3ubuntu1cross1) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-dev-armel-cross_2.27-3ubuntu1cross1.1_all.deb (--unpack):
 unable to open '/usr/arm-linux-gnueabi/lib/Mcrt1.o.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Preparing to unpack .../libc6-armel-cross_2.27-3ubuntu1cross1.1_all.deb ...
Unpacking libc6-armel-cross (2.27-3ubuntu1cross1.1) over (2.27-3ubuntu1cross1) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-armel-cross_2.27-3ubuntu1cross1.1_all.deb (--unpack):
 unable to open '/usr/arm-linux-gnueabi/lib/ld-2.27.so.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Preparing to unpack .../libc6-dev-armhf-cross_2.27-3ubuntu1cross1.1_all.deb ...
Unpacking libc6-dev-armhf-cross (2.27-3ubuntu1cross1.1) over (2.27-3ubuntu1cross1) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-dev-armhf-cross_2.27-3ubuntu1cross1.1_all.deb (--unpack):
 unable to open '/usr/arm-linux-gnueabihf/lib/Mcrt1.o.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Preparing to unpack .../libc6-armhf-cross_2.27-3ubuntu1cross1.1_all.deb ...
Unpacking libc6-armhf-cross (2.27-3ubuntu1cross1.1) over (2.27-3ubuntu1cross1) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-armhf-cross_2.27-3ubuntu1cross1.1_all.deb (--unpack):
 unable to open '/usr/arm-linux-gnueabihf/lib/ld-2.27.so.dpkg-new': No such file or directory
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 /var/cache/apt/archives/libc6-dev-armel-cross_2.27-3ubuntu1cross1.1_all.deb
 /var/cache/apt/archives/libc6-armel-cross_2.27-3ubuntu1cross1.1_all.deb
 /var/cache/apt/archives/libc6-dev-armhf-cross_2.27-3ubuntu1cross1.1_all.deb
 /var/cache/apt/archives/libc6-armhf-cross_2.27-3ubuntu1cross1.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
2
  • Something appears wrong with some downloaded packages. Try running sudo apt clean and then run the upgrade again. Sep 30, 2018 at 20:27
  • 1
    I did tried clearing the package cache and re-download the packages, however the same problem showed up. Oct 1, 2018 at 2:20

6 Answers 6

53

I was able to cleanly solve this problem with a variation of the approach used by Gen.Stack. The problem with the accepted solution is that it removes dependencies of the packages in question but fails to restore them. This solution prevents that problem.

First, remove the problem packages and purge their configuration without removing dependencies:

sudo dpkg -P --force-depends libc6-armel-cross libc6-armhf-cross libc6-dev-armel-cross libc6-dev-armhf-cross

Clean the package cache:

sudo apt clean

Update the package listing:

sudo apt update

Fix broken dependencies (should automatically install two of the removed packages):

sudo apt -f install

Finally, install the remaining two packages:

sudo apt install libc6-dev-armel-cross libc6-dev-armhf-cross

This will bring your system back into working order.

5
  • 3
    works fine. for an upgrade from ubuntu 14.04 to ubuntu 18.04 Nov 29, 2018 at 8:26
  • 4
    Thanks, I also resolved for the same problem Ubuntu 14.04, 16.04 to 18.04.
    – minish
    Dec 18, 2018 at 2:04
  • 4
    Amazing. My package manager was so broken after upgrading from Ubuntu 16.04 to 18.04. I tried everything the command line recommended and various other solutions online. This one appears to have worked perfectly. Thank you Olek Wojnar!! Apr 10, 2019 at 23:59
  • 1
    I love a good, well laid out solution that works! Thanks.
    – Whome
    Nov 25, 2019 at 19:37
  • MAGIC! Thank you
    – Grynn
    Mar 6, 2023 at 21:51
19

Try reinstalling libc6-dev-armhf-cross (do the same for libc6-dev-armel-cross)

sudo apt remove libc6-dev-armhf-cross followed by sudo apt install libc6-dev-armhf-cross

(apt install --reinstall doesn't seem to work)

Note that running sudo apt remove may remove packages dependent on it. See Olek Wojnar's answer below on how to do this without removing dependent packages

4
  • Hi Woofas, I also tried --reinstall but didn't think there would be a difference with remove and install. I just tried and now it is installing properly. Thanks! Oct 1, 2018 at 2:19
  • 1
    That almost worked for me, I had to remove all these—then reinstall—libc6-dev-armhf-cross libc6-armel-cross libc6-dev-armel-cross libc6-armhf-cross
    – A T
    Oct 1, 2018 at 9:44
  • 1
    You may need to reinstall other packages that get removed due to dependencies, such as gcc, see my post below.
    – John JJ
    Oct 1, 2018 at 13:11
  • As John said, you need to account for the packages that are removed. Take a look at my answer for a fairly clean way of taking care of that. Oct 19, 2018 at 2:31
2

To prevent too many dependencies from being removed, try dpkg -P --force-depends:

dpkg -P --force-depends libc6-armel-cross libc6-armhf-cross libc6-dev-armel-cross libc6-dev-armhf-cross

Then update, fetch and install those packages again:

apt update
[...]
apt clean
apt install libc6-armel-cross libc6-armhf-cross libc6-dev-armel-cross libc6-dev-armhf-cross
Building dependency tree       
Reading state information... Done
After this operation, 0 B of additional disk space will be used.
Get:1 http://en.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libc6-armel-cross all 2.27-3ubuntu1cross1.1 [1,031 kB]
Get:2 http://en.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libc6-armhf-cross all 2.27-3ubuntu1cross1.1 [1,005 kB]
Get:3 http://en.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libc6-dev-armel-cross all 2.27-3ubuntu1cross1.1 [1,936 kB]
Get:4 http://en.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libc6-dev-armhf-cross all 2.27-3ubuntu1cross1.1 [1,899 kB]
Fetched 5,871 kB in 9s (661 kB/s)                                                                                                                                                           
Selecting previously unselected package libc6-armel-cross.
(Reading database ... 760110 files and directories currently installed.)
Preparing to unpack .../libc6-armel-cross_2.27-3ubuntu1cross1.1_all.deb ...
Unpacking libc6-armel-cross (2.27-3ubuntu1cross1.1) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-armel-cross_2.27-3ubuntu1cross1.1_all.deb (--unpack):
 unable to open '/usr/arm-linux-gnueabi/lib/ld-2.27.so.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
[...]

So, no luck with reinstalling neither by --reinstall nor manually with dependencies nor by using dpkg -[P|i] --force-depends.

2018-10-09: As those packages are still broken but w/ no updates in sight I just removed them all to be able to use apt for (un-)installing packages. Leaving the status quo meant not being able to install or remove packages. I am using locally installed toolchains to fullfil my requirements.

edit: note about removing all offending packages and dependencies.

3
  • @Olek: Thx for the edit. But no, it does not work for me. That is why I left the post as I did. Even now with your edit this does not provide me with a solution to this problem. Would you mind reverting your edit, please? Thx.
    – Gen.Stack
    Oct 8, 2018 at 7:03
  • Strange that it didn't work on your machine. I had the exact same problem and my solution fixed it. Based on how apt works, I'm frankly confused why it would not work for you. Perhaps there is another problem at play for you? In any case, I created my own answer. Good luck fixing your problems! Oct 14, 2018 at 20:54
  • @OlekWojnar yes, it is strange. I ignore the underlying reasons as of now. Won't dig deeper as I got the other toolchain, no need for stock one. If one day I realize how to solve this, I'll update this. thx
    – Gen.Stack
    Oct 15, 2018 at 21:19
1

When using the apt remove/install method above, dependencies may cause apt to remove more than you intend. You may also need to reinstall other packages. I also reinstalled the following.

Some of these would already automatically be reinstalled, but it was easier to copy the list of removed packages and let apt figure out what needed to be done.

sudo apt-get install \
  g++-7-arm-linux-gnueabihf g++-7-multilib-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
  gcc-7-arm-linux-gnueabihf gcc-7-multilib-arm-linux-gnueabihf gcc-arm-linux-gnueabihf \
  libasan4-armhf-cross libasan4-dbg-armhf-cross libatomic1-armhf-cross libatomic1-dbg-armhf-cross \
  libc6-armel-armhf-cross libc6-armel-cross libc6-armhf-cross libc6-dev-armel-armhf-cross \
  libc6-dev-armel-cross libc6-dev-armhf-cross libcilkrts5-armhf-cross libcilkrts5-dbg-armhf-cross \
  libgcc-7-dev-armhf-cross libgcc1-armhf-cross libgcc1-dbg-armhf-cross libgomp1-armhf-cross \
  libgomp1-dbg-armhf-cross libsfasan4-armhf-cross libsfatomic1-armhf-cross \
  libsfcilkrts5-armhf-cross libsfgcc-7-dev-armhf-cross libsfgcc1-armhf-cross \
  libsfgomp1-armhf-cross libsfstdc++-7-dev-armhf-cross libsfstdc++6-armhf-cross \
  libsfubsan0-armhf-cross libstdc++-7-dev-armhf-cross libstdc++6-7-dbg-armhf-cross \
  libstdc++6-armhf-cross libubsan0-armhf-cross libubsan0-dbg-armhf-cross \
1
  • I like that you've identified the problem of removed dependencies in your answer. Unfortunately, your solution would mark all those packages as manually installed and they would therefore not be removed automatically if unnecessary in the future. Oct 14, 2018 at 21:08
0

I solved the error using synaptic package manager in Ubuntu 18.04 by removing problamatic packages and reinstalling them later.

-1

I got the same error when install libc6-dev-armel-cross_2.27-3ubuntu1cross1.1_all.deb and libc6-armel-cross_2.27-3ubuntu1cross1.1_all.deb package, and run

apt -f install 

didn't work. I downloaded the libc6-dev-armel-cross_2.27-3ubuntu1cross1_all.deb and libc6-armel-cross_2.27-3ubuntu1cross1_all.deb from the Ubuntu packages mirror and install them with

dpkg -i *.deb 

and it solved my problem.

1
  • Thanks Patrick, as Woofas mentioned, apt remove and install solved the problem. Oct 1, 2018 at 2:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .