How To Install libfaketime on Fedora 34

libfaketime is Manipulate system time per process for testing purposes

Introduction

In this tutorial we learn how to install libfaketime on Fedora 34.

What is libfaketime

libfaketime intercepts various system calls which programs use to retrieve the current date and time. It can then report faked dates and times (as specified by you, the user) to these programs. This means you can modify the system time a program sees without having to change the time system- wide.

We can use yum or dnf to install libfaketime on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install libfaketime.

Install libfaketime on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install libfaketime using dnf by running the following command:

sudo dnf -y install libfaketime

Install libfaketime on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install libfaketime using yum by running the following command:

sudo yum -y install libfaketime

How To Uninstall libfaketime on Fedora 34

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

sudo dnf remove libfaketime

libfaketime Package Contents on Fedora 34

/usr/bin/faketime
/usr/lib/.build-id
/usr/lib/.build-id/65
/usr/lib/.build-id/65/c846cfe9952c51822f0d7e7af0132aa2ea1b53
/usr/lib/.build-id/bc
/usr/lib/.build-id/bc/cc0dc049debabae2c67aacff8a52e31cbce03f
/usr/lib/.build-id/c4
/usr/lib/.build-id/c4/3a014fc20aed5a05ff4f648eac99e6ffbd559d
/usr/lib64/faketime
/usr/lib64/faketime/libfaketime.so.1
/usr/lib64/faketime/libfaketimeMT.so.1
/usr/share/doc/libfaketime
/usr/share/doc/libfaketime/NEWS
/usr/share/doc/libfaketime/README
/usr/share/doc/libfaketime/README.developers
/usr/share/licenses/libfaketime
/usr/share/licenses/libfaketime/COPYING
/usr/share/man/man1/faketime.1.gz

References

Summary

In this tutorial we learn how to install libfaketime on Fedora 34 using yum and dnf.