0

I started with this command to install a minimal Ubuntu OS:

debootstrap jammy /mnt

This was done in a USB booted Live Ubuntu 24.04's Terminal Emulator.

After a successful installation, I realized this installed Ubuntu 22.04. My aim instead is a minimal Ubuntu 24.04 installation. So I executed the command:

debootstrap noble /mnt

on the expectation that would overwrite the jammy installation. After many lines showing it was retrieving, and validating, it terminated with this error:

I: Chosen extractor for .deb packages: dpkg-deb
I: Extracting base-files...
E: Tried to extract package, but tar failed. Exit...

Is it possible the existing 22.04 installation caused this failure? If so what is the best way to undo the 22.04 installation to make way for 24.04?

Can a minimal Ubuntu 22.04 installation be upgraded to a minimal only 24.04 installation?

Or is there something wrong with the package it failed to extract?

I tried the command:

apt remove ubuntu-minimal

This did appear to remove something, but this did not make a difference for the "debootstrap noble /mnt' command. Installation failed with the same error.

My interest at this time is to install only a minimal Ubuntu 24.04.

Stephen
  • 591
  • I solved this problem by reformatting the drives to make sure they were empty. Since this worked to get minimal noble installed I conclude there was nothing wrong with any package, the prior jammy installation was blocking, and the command "apt remove ubuntu-minimal" did not sufficiently undo the jammy installation. I still want to know if there was a less drastic solution I could have done. – Stephen Apr 14 '25 at 18:57

2 Answers2

1

I have bumped into a similar problem recently. In my case the problem was that dpkg-deb, which is used by debootstrap to extract packages, was being provided by the busybox. Simplified busybox implementation does not support --fsys-tarfile option which is used by debootstrap script. The script calls dpkg-deb --fsys-tarfile and pipe its output into tar. This explains why I have seen the "tar failed" message:

extract_dpkg_deb_data () {
    local pkg="$1"
    dpkg-deb --fsys-tarfile "$pkg" | tar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST "Tried to extract package, but tar failed. Exit..."
}

The solution was to force debootstrap to use ar instead of dpkg-deb to extract packages:

debootstrap --extractor=ar jammy /mnt
  • This solution worked when I installed minimal 25.04 (I decided to install this over 24.04). Thanks :) – Stephen Apr 29 '25 at 05:20
0

I stumbled over the same thing. I just found out ubuntu uses zstd compressed dep packages. On my system zstd was not installed, so dpkg-deb could not extract it.

Just sudo apt install zstd or apk add zstd solved my problem