tar xf error: Directory renamed before its status could be extracted

The error

When you execute the command tar xf file.tar, you get the error:

Directory renamed before its status could be extracted

Solution

Execute the following apt command:

apt install -y bsdtar && ln -sf $(which bsdtar) $(which tar)