How To Install hfsprogs on Ubuntu 22.04

In this tutorial we learn how to install hfsprogs on Ubuntu 22.04. hfsprogs is mkfs and fsck for HFS and HFS+ file systems

Introduction

In this tutorial we learn how to install hfsprogs on Ubuntu 22.04.

What is hfsprogs

hfsprogs is:

The HFS+ file system used by Apple Computer for their Mac OS is supported by the Linux kernel. Apple provides mkfs and fsck for HFS+ with the Unix core of their operating system, Darwin.

This package is a port of Apple’s tools for HFS+ filesystems.

For users, HFS+ seems to be a good compromise to carry files between MacOS X and Linux Machines, as HFS+ doesn’t suffer the problems of FAT32 like:

  • huge space waste (in slack space as devices grow faster);
  • ability to create files that are more than 4GB in size (especially good for those working with multimedia and that need to carry large ISO files);
  • ability to use case preserving (and even sensitivity!);
  • ability to use uid’s and gid’s on the filesystem.

Users in general can enjoy such benefits since it is expected to have more HFS+ filesystems in use, as Apple has announced Macintoshes for ix86-64, besides the filesystem being already supported by PowerPC systems since the beginning.

There are three methods to install hfsprogs on Ubuntu 22.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 hfsprogs Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install hfsprogs using apt-get by running the following command:

sudo apt-get -y install hfsprogs

Install hfsprogs Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install hfsprogs using apt by running the following command:

sudo apt -y install hfsprogs

Install hfsprogs 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 hfsprogs using aptitude by running the following command:

sudo aptitude -y install hfsprogs

How To Uninstall hfsprogs on Ubuntu 22.04

To uninstall only the hfsprogs package we can use the following command:

sudo apt-get remove hfsprogs

Uninstall hfsprogs And Its Dependencies

To uninstall hfsprogs and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove hfsprogs

Remove hfsprogs Configurations and Data

To remove hfsprogs configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge hfsprogs

Remove hfsprogs configuration, data, and all of its dependencies

We can use the following command to remove hfsprogs configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge hfsprogs

References

Summary

In this tutorial we learn how to install hfsprogs package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.