How to Install ExifTool on Linux Mint 21/20
ExifTool is a free, open-source software program for reading, writing, and manipulating metadata found in images, audio, and video files. The following tutorial will demonstrate how to install ExifTool on Linux Mint 21 or Linux Mint 20 releases using the default repository or manually downloading the latest archive and making and installing the application with cli commands and some additional common usage examples with ExifTool.
What is ExifTool?
ExifTool is a platform-independent Perl library and command-line tool used to manipulate EXIF and IPTC metadata embedded in the image, audio, and video files. This powerful application reads, writes, and edits metadata information in various file formats, allowing photographers to store, view accurately, or edit metadata in images.
Note about the Tutorial
The following tutorial was done with a Linux Mint 21, which many users know is based on the Ubuntu 22.04 Jammy Jellyfish LTS release., and example images were taken. Still, it was tested on the older Linux Mint 20 release that is still supported and based on Ubuntu 20.04 LTS Focal Fosa. In the future, if Ubuntu makes any changes to break the tutorial for one of the distribution versions, please place a comment for me to investigate so I can update the tutorial.
Recommended Steps Before Installation
Before proceeding with the tutorial, ensuring your system is up-to-date with all existing packages is good.
sudo apt update
Optionally, you can list the updates for users who require review or are curious.
sudo apt --list upgradable
Proceed to upgrade any outdated packages using the following command.
sudo apt upgrade
#1st Method: Install ExifTool — Default APT Repository
ExifTool is available to install from the Linux Mint default repository, making the installation quick and straightforward without importing third-party repositories.
In your terminal, execute the following command.
sudo apt install libimage-exiftool-perl -y
Confirm it was installed by running the following command.
apt-cache policy libimage-exiftool-perl
#2nd Method: Install ExifTool — Download & Build
The second method may suit users more confident in using the command line terminal or prefer the latest build without relying on adding or finding a third-party repository.
First, visit the official website and download the latest version.
Next, extract the downloaded archive and navigate to it.
gzip -dc Image-ExifTool-*.tar.gz | tar -xf -
Before running the installation command, run the following command to verify and generate the make file.
joshua@linux-mint:~/Image-ExifTool-12.52$ perl Makefile.PL
Checking if your kit is complete...
Generating a Unix-style Makefile
Writing Makefile for Image::ExifTool
Writing MYMETA.yml and MYMETA.json
Lastly, run the install command.
sudo make install
Appending installation info to /usr/local/lib/x86_64-linux-gnu/perl/5.34.0/perllocal.pod
How to Use ExifTool on Linux Mint
Now that you have the software installed, some basic commands are as follows. For more information, I would check the official website for the long term, as ExifTool can achieve many operations that are too extensive to list.
Extract information from a file
A basic command to extract all metadata from a file named a.jpg.
Basic write example
exiftool -artist=me a.jpg
Writes the Artist tag to a.jpg. Since no group is specified, EXIF: Artist will be registered, and all other existing Artist tags will be updated with the new value (“me”).
Write multiple files
exiftool -artist=me a.jpg b.jpg c.jpg
Writes Artist tag to three image files.
Write to all files in a directory
exiftool -artist=me /images
Writes Artist tag to all files in a directory
Write multiple tags
exiftool -artist="Phil Harvey" -copyright="2011 Phil Harvey" a.jpg
Writes two tags to
Extracting duplicate tags
exiftool -a -u -g1 a.jpg
Print all meta information in an image, including duplicate and unknown tags, sorted by group (for family 1).
Print common meta information
exiftool -common dir
Print standard meta-information for all images in dir.
List meta information
exiftool -T -createdate -aperture -shutterspeed -iso DIR > out.txt
List meta information in tab-delimited column form for all images in the directory
DIR to an output text file named “out.txt.”
Print ImageSize and ExposureTime
exiftool -s -ImageSize -ExposureTime b.jpg
Print ImageSize and ExposureTime tag names and values.
Print Canon information
exiftool -l -canon c.jpg d.jpg
Print standard Canon information from two image files.
Recursively extract common meta-information
exiftool -r -w .txt -common pictures
Recursively extract standard meta information from files in an example directory, writing text output into files with the same names but with aC<.txt> extension.
Move Thumbnail Image
exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg
Save the thumbnail image from one image file to another image file.
Recursively extract JPG images from CRW.
exiftool -b -JpgFromRaw -w _JFR.JPG -ext CRW -r .
Recursively extract JPG images from all Canon CRW files in the current directory, adding C<_JFR.JPG> for the name of the output JPG files.
Print formatted date/time for JPG files
exiftool -d "%r %a, %B %e, %Y" -DateTimeOriginal -S -s *.jpg
Print formatted date/time for all JPG files in the current directory.
Extract image resolution
exiftool -IFD1:XResolution -IFD1:YResolution image.jpg
Extract image resolution from EXIF IFD1 information (thumbnail image IFD).
Extract all tags with names with “example word”
exiftool "-*resolution*" image.jpg
Extract all tags containing the word “Resolution” from an image.
Extract all author-related XMP
exiftool -xmp:author:all -a image.jpg
Extract all author-related XMP information from an image.
Extract complete XMP data
exiftool -xmp -b a.jpg > out.xmp
Extract the entire XMP data record intact from
a.jpg and write it to
out.xmp use the unique
XMP tag (see the Extra Tags)
Print output date time original
exiftool -p "$filename has date $dateTimeOriginal" -q -f dir
Print one line of output containing the file name and DateTimeOriginal for each image in the directory
Extract all GPS positions from AVCHD
exiftool -ee -p "$gpslatitude, $gpslongitude, $gpstimestamp" a.m2ts
Extract all GPS positions from an AVCHD video.
exiftool -icc_profile -b -w icc image.jpg
Save the complete ICC_Profile from an image to an output file with the same name and an extension of filename<.icc>.
Generate HTML pages from HEX Dump
exiftool -htmldump -w tmp/%f_%e.html t/images
Generate HTML pages from a hex dump of EXIF information in all images from the C directory. The output HTML files are written to the C directory (created if it didn’t exist), with names of the form “FILENAME_EXT.html.”
Additional Commands & Tips
Depending on the method of installation used, the following commands can be used to update the software and any system package. Ideally, the terminal update command should be used even with auto-updates in your desktop GUI to ensure everything is updating correctly.
sudo apt upgrade && sudo apt upgrade
Use the following command for users who no longer require ExifTool on their system and wish to remove it.
sudo apt autoremove libimage-exiftool-perl --purge -y
The above command will automatically remove any unused dependencies installed from ExifTool and other leftovers from previous removals. This command should be run often to keep your system from bloating.
Lastly, for users that manually installed ExifTool, remove all associated ExifTool directories.
The tutorial demonstrated how to install ExifTool on Linux Mint using several methods and some of the most common commands. ExifTool can be used to achieve much more than what was listed. I would suggest visiting the official website and learning more about what you can edit and achieve if you are looking to edit EXIF data.