How To Install gpart on Ubuntu 20.04
Introduction
In this tutorial we learn how to install gpart
on Ubuntu 20.04.
What is gpart
gpart is:
Gpart is a tool which tries to guess the primary partition table of a PC-type disk in case the primary partition table in sector 0 is damaged, incorrect or deleted.
It is also good at finding and listing the types, locations, and sizes of inadvertently-deleted partitions, both primary and logical. It gives you the information you need to manually re-create them (using fdisk, cfdisk, sfdisk, etc.).
The guessed table can also be written to a file or (if you firmly believe the guessed table is entirely correct) directly to a disk device.
Currently supported (guessable) filesystem or partition types:
- BeOS filesystem type.
- BtrFS filesystem type.
- FreeBSD/NetBSD/386BSD disklabel sub-partitioning scheme used on Intel platforms.
- Linux second extended filesystem (Ext2).
- MS-DOS FAT12, FAT16 and FAT32 “filesystems”.
- IBM OS/2 High Performance filesystem.
- Linux LVM and LVM2 physical volumes.
- Linux swap partitions (versions 0 and 1).
- The Minix operating system filesystem type.
- MS Windows NT/2000 filesystem.
- QNX 4.x filesystem.
- The Reiser filesystem (version 3.5.X, X > 11).
- Sun Solaris on Intel platforms uses a sub-partitioning scheme on PC hard disks similar to the BSD disklabels.
- Silicon Graphics journaled filesystem for Linux.
Gpart is useful in recovery actions and forensics investigations.
There are three methods to install gpart
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 gpart Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install gpart
using apt-get
by running the following command:
sudo apt-get -y install gpart
Install gpart Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install gpart
using apt
by running the following command:
sudo apt -y install gpart
Install gpart 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 gpart
using aptitude
by running the following command:
sudo aptitude -y install gpart
How To Uninstall gpart on Ubuntu 20.04
To uninstall only the gpart
package we can use the following command:
sudo apt-get remove gpart
Uninstall gpart And Its Dependencies
To uninstall gpart
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove gpart
Remove gpart Configurations and Data
To remove gpart
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge gpart
Remove gpart configuration, data, and all of its dependencies
We can use the following command to remove gpart
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge gpart
References
Summary
In this tutorial we learn how to install gpart
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.