How To Install tar on Ubuntu 20.04
Introduction
In this tutorial we learn how to install tar on Ubuntu 20.04.
What is tar
tar is:
Tar is a program for packaging a set of files as a single archive in tar format. The function it performs is conceptually similar to cpio, and to things like PKZIP in the DOS world. It is heavily used by the Debian package management system, and is useful for performing system backups and exchanging sets of files with others. Task: minimal
Package: tar Architecture: amd64 Version: 1.30+dfsg-7 Multi-Arch: foreign Priority: required Essential: yes Section: utils Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Bdale Garbee [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 880 Pre-Depends: libacl1 (>= 2.2.23), libc6 (>= 2.17), libselinux1 (>= 1.32) Suggests: bzip2, ncompress, xz-utils, tar-scripts, tar-doc Conflicts: cpio (<= 2.4.2-38) Breaks: dpkg-dev (« 1.14.26) Replaces: cpio (« 2.4.2-39) Filename: pool/main/t/tar/tar_1.30+dfsg-7_amd64.deb Size: 240016 MD5sum: 5480cbe6972414abff195ecbdf2b9de5 SHA1: f8f6aa610006070f7e8a43fbfe2169a89a821ebd SHA256: 557e72166cd4ea6163ac32529cd90f4500959cdb6614009fac156ce85def5b96 Homepage: https://www.gnu.org/software/tar/ Description-en: GNU version of the tar archiving utility Tar is a program for packaging a set of files as a single archive in tar format. The function it performs is conceptually similar to cpio, and to things like PKZIP in the DOS world. It is heavily used by the Debian package management system, and is useful for performing system backups and exchanging sets of files with others. Task: minimal
There are three methods to install tar on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install tar Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install tar using apt-get by running the following command:
sudo apt-get -y install tar
Install tar Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install tar using apt by running the following command:
sudo apt -y install tar
Install tar Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install tar using aptitude by running the following command:
sudo aptitude -y install tar
How To Uninstall tar on Ubuntu 20.04
To uninstall only the tar package we can use the following command:
sudo apt-get remove tar
Uninstall tar And Its Dependencies
To uninstall tar and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove tar
Remove tar Configurations and Data
To remove tar configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge tar
Remove tar configuration, data, and all of its dependencies
We can use the following command to remove tar configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge tar
References
Summary
In this tutorial we learn how to install tar package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.