Setting up FreeBSD tar (also BSD tar) on Fedora 39 WKS, Ubuntu 22.04, Debian BookWorm
FreeBSD tar (also BSD tar) has become the default tar on most Berkeley Software Distribution-based operating systems including Mac OS X. The core functionality is available as libarchive for inclusion in other applications. This implementation automatically detects the format of the file and can extract from tar, pax, cpio, zip, rar, ar, xar, rpm and ISO 9660 cdrom images. It also comes with a functionally equivalent cpio command-line interface.
Bsdtar is availabe along with it's extended functionality on recently released Fedora 39 and most probably on the previous Fedora releases
boris@fedora:~$ uname -a
Linux fedora 6.6.1-300.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 10 20:08:54 UTC 2023 x86_64 GNU/Linux
boris@fedora:~/SENDTO2$ sudo dnf install bsdtar
[sudo] password for boris:
Last metadata expiration check: 1:40:05 ago on Mon 13 Nov 2023 12:36:56 PM MSK.
Dependencies resolved.
================================================
Package Architecture Version Repository Size
================================================
Installing:
bsdtar x86_64 3.7.1-1.fc39 fedora 65 k
Transaction Summary
================================================
Install 1 Package
Total download size: 65 k
Installed size: 134 k
Is this ok [y/N]: y
Downloading Packages:
bsdtar-3.7.1-1.fc39.x86_64.rpm 457 kB/s | 65 kB 00:00
-----------------------------------------------------------------------------------
Total 86 kB/s | 65 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : bsdtar-3.7.1-1.fc39.x86_64 1/1
Running scriptlet: bsdtar-3.7.1-1.fc39.x86_64 1/1
Verifying : bsdtar-3.7.1-1.fc39.x86_64 1/1
Installed:
bsdtar-3.7.1-1.fc39.x86_64
Complete!
boris@fedora:~/SENDTO$ bsdtar -xf virtio-win-0.1.240-1.noarch.rpm
boris@fedora:~/SENDTO$ ll
total 252216
drwxr-xr-x. 1 boris boris 10 Nov 13 14:17 usr
-rw-r--r--. 1 boris boris 258267861 Nov 11 19:24 virtio-win-0.1.240-1.noarch.rpm
boris@fedora:~/SENDTO$ cd usr/share/virt*
boris@fedora:~/SENDTO/usr/share/virtio-win$ ll
total 612816
drwxr-xr-x. 1 boris boris 46 Nov 13 14:17 drivers
drwxr-xr-x. 1 boris boris 68 Nov 13 14:17 guest-agent
drwxr-xr-x. 1 boris boris 136 Nov 13 14:17 installer
-rw-r--r--. 1 boris boris 627519488 Sep 19 09:18 virtio-win-0.1.240.iso
lrwxrwxrwx. 1 boris boris 22 Sep 19 09:18 virtio-win.iso -> virtio-win-0.1.240.iso
boris@fedora:~$ sudo dnf install bsdcpio
[sudo] password for boris:
Last metadata expiration check: 0:10:06 ago on Tue 14 Nov 2023 06:01:35
Dependencies resolved.
=============================================
Package Architecture Version Repository Size
=============================================
Installing:
bsdcpio x86_64 3.7.1-1.fc39 fedora 47 k
Transaction Summary
=============================================
Install 1 Package
Total download size: 47 k
Installed size: 98 k
Is this ok [y/N]: y
Downloading Packages:
bsdcpio-3.7.1-1.fc39.x86_64.rpm 290 kB/s | 47 kB 00:00
-------------------------------------------------------------------------
Total 23 kB/s | 47 kB 00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : bsdcpio-3.7.1-1.fc39.x86_64 1/1
Running scriptlet: bsdcpio-3.7.1-1.fc39.x86_64 1/1
Verifying : bsdcpio-3.7.1-1.fc39.x86_64 1/1
Installed:
bsdcpio-3.7.1-1.fc39.x86_64
Complete!
===========================================
Install bsdtar on Ubuntu 22.04.3 && Debian BookWorm
===========================================
Here bsdtar is supposed to be installed via package libarchive-tools. Libarchive provides command-line utilities called bsdtar and bsdcpio. These are complete re-implementation based on libarchive. These are the default system tar and cpio on FreeBSD, NetBSD, macOS and Windows.There is also bsdcat, designed to decompress a file to the
standard output like zcat.
boris@boris-ubuntu:~/Downloads/usr/share/virtio-win$ hostnamectl
Static hostname: boris-ubuntu
Icon name: computer-vm
Chassis: vm
Machine ID: 9e9d585b54484b63a758d1b0098cfebd
Boot ID: 7fb70e669aad4d5398574c029585d5e6
Virtualization: kvm
Operating System: Ubuntu 22.04.3 LTS
Kernel: Linux 6.2.0-36-generic
Architecture: x86-64
Hardware Vendor: QEMU
Hardware Model: Standard PC _Q35 + ICH9, 2009
boris@boris-ubuntu:~$ sudo apt -y install libarchive-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
libarchive-tools
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 61,1 kB of archives.
After this operation, 209 kB of additional disk space will be used.
. . . . . . . . . . . .
Preparing to unpack .../libarchive-tools_3.6.0-1ubuntu1_amd64.deb ...
Unpacking libarchive-tools (3.6.0-1ubuntu1) ...
Setting up libarchive-tools (3.6.0-1ubuntu1) ...
Processing triggers for man-db (2.10.2-1) …
boris@boris-ubuntu:~$ which bsdtar
/usr/bin/bsdtar
boris@boris-ubuntu:~/Downloads$ ll
total 252228
drwxr-xr-x 2 boris boris 4096 nov 13 16:35 ./
drwxr-x--- 16 boris boris 4096 nov 13 16:28 ../
-rw-r--r-- 1 boris boris 258267861 nov 13 virtio-win-0.1.240-1.noarch.rpm
boris@boris-ubuntu:~/Downloads$ bsdtar -xf virtio-win-0.1.240-1.noarch.rpm
boris@boris-ubuntu:~/Downloads$ ll
total 252232
drwxr-xr-x 3 boris boris 4096 nov 13 16:36 ./
drwxr-x--- 16 boris boris 4096 novf 13 16:28 ../
drwxrwxr-x 3 boris boris 4096 nov 13 16:36 usr/
-rw-r--r-- 1 boris boris 258267861 nov 13 16:35 virtio-win-0.1.240-1.noarch.rpm
boris@boris-ubuntu:~/Downloads/usr/share/virtio-win$ ll
total 612836
drwxr-xr-x 5 boris boris 4096 sep 19 09:18 ./
drwxrwxr-x 4 boris boris 4096 nov 13 16:36 ../
drwxrwxr-x 6 boris boris 4096 nov 13 16:36 drivers/
drwxrwxr-x 2 boris boris 4096 nov 13 16:36 guest-agent/
drwxrwxr-x 2 boris boris 4096 nov 16:36 installer/
-rw-r--r-- 1 boris boris 627519488 sep 19 09:18 virtio-win-0.1.240.iso
lrwxrwxrwx 1 boris boris 22 sep 19 09:18 virtio-win.iso -> virtio-win-0.1.240.iso
Debian 12.1
boris@boris-ms7c37:~$ sudo apt install libarchive-tools
[sudo] password for boris:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libbotan-2-19 librnp0
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
libarchive-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 73.6 kB of archives.
After this operation, 203 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 libarchive-tools amd64 3.6.2-1 [73.6 kB]
Fetched 73.6 kB in 0s (301 kB/s)
Selecting previously unselected package libarchive-tools.
(Reading database ... 203703 files and directories currently installed.)
Preparing to unpack .../libarchive-tools_3.6.2-1_amd64.deb ...
Unpacking libarchive-tools (3.6.2-1) ...
Setting up libarchive-tools (3.6.2-1) ...
Processing triggers for man-db (2.11.2-2) ...
boris@boris-ms7c37:~$ which bsdtar
/usr/bin/bsdtar
boris@boris-ms7c37:~$ cd Downloads
boris@boris-ms7c37:~/Downloads$ ls -l
total 252216
-rw-r--r-- 1 boris boris 258267861 Nov 13 22:01 virtio-win-0.1.240-1.noarch.rpm
boris@boris-ms7c37:~/Downloads$ bsdtar -xf virtio-win-0.1.240-1.noarch.rpm
boris@boris-ms7c37:~/Downloads$ ls -l
total 252220
drwxr-xr-x 3 boris boris 4096 Nov 13 22:02 usr
-rw-r--r-- 1 boris boris 258267861 Nov 13 22:01 virtio-win-0.1.240-1.noarch.rpm