How To Install git-lfs on CentOS 8

git-lfs is Git extension for versioning large files

Introduction

In this tutorial we learn how to install git-lfs on CentOS 8.

What is git-lfs

Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server.

We can use yum or dnf to install git-lfs on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install git-lfs.

Install git-lfs on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

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

sudo dnf -y install git-lfs

Install git-lfs on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install git-lfs using yum by running the following command:

sudo yum -y install git-lfs

How To Uninstall git-lfs on CentOS 8

To uninstall only the git-lfs package we can use the following command:

sudo dnf remove git-lfs

git-lfs Package Contents on CentOS 8

/usr/bin/git-lfs
/usr/lib/.build-id
/usr/lib/.build-id/5c
/usr/lib/.build-id/5c/98074778bbc5d114285d4dfd21a5aab1baa422
/usr/share/doc/git-lfs
/usr/share/doc/git-lfs/CHANGELOG.md
/usr/share/doc/git-lfs/README.md
/usr/share/doc/git-lfs/docs
/usr/share/doc/git-lfs/docs/README.md
/usr/share/doc/git-lfs/docs/api
/usr/share/doc/git-lfs/docs/api/README.md
/usr/share/doc/git-lfs/docs/api/authentication.md
/usr/share/doc/git-lfs/docs/api/basic-transfers.md
/usr/share/doc/git-lfs/docs/api/batch.md
/usr/share/doc/git-lfs/docs/api/locking.md
/usr/share/doc/git-lfs/docs/api/schemas
/usr/share/doc/git-lfs/docs/api/schemas/http-batch-request-schema.json
/usr/share/doc/git-lfs/docs/api/schemas/http-batch-response-schema.json
/usr/share/doc/git-lfs/docs/api/schemas/http-lock-create-request-schema.json
/usr/share/doc/git-lfs/docs/api/schemas/http-lock-create-response-schema.json
/usr/share/doc/git-lfs/docs/api/schemas/http-lock-delete-request-schema.json
/usr/share/doc/git-lfs/docs/api/schemas/http-lock-list-response-schema.json
/usr/share/doc/git-lfs/docs/api/schemas/http-lock-verify-response-schema.json
/usr/share/doc/git-lfs/docs/api/server-discovery.md
/usr/share/doc/git-lfs/docs/custom-transfers.md
/usr/share/doc/git-lfs/docs/extensions.md
/usr/share/doc/git-lfs/docs/howto
/usr/share/doc/git-lfs/docs/howto/release-git-lfs.md
/usr/share/doc/git-lfs/docs/linux-build.md
/usr/share/doc/git-lfs/docs/man
/usr/share/doc/git-lfs/docs/man/git-lfs-checkout.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-clean.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-clone.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-config.5.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-dedup.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-env.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-ext.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-fetch.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-filter-process.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-fsck.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-install.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-lock.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-locks.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-logs.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-ls-files.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-migrate.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-pointer.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-post-checkout.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-post-commit.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-post-merge.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-pre-push.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-prune.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-pull.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-push.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-smudge.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-standalone-file.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-status.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-track.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-uninstall.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-unlock.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-untrack.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs-update.1.ronn
/usr/share/doc/git-lfs/docs/man/git-lfs.1.ronn
/usr/share/doc/git-lfs/docs/man/index.txt
/usr/share/doc/git-lfs/docs/proposals
/usr/share/doc/git-lfs/docs/proposals/README.md
/usr/share/doc/git-lfs/docs/proposals/locking.md
/usr/share/doc/git-lfs/docs/proposals/locking_api.md
/usr/share/doc/git-lfs/docs/proposals/ntlm.md
/usr/share/doc/git-lfs/docs/proposals/ssh_adapter.md
/usr/share/doc/git-lfs/docs/proposals/transfer_adapters.md
/usr/share/doc/git-lfs/docs/spec.md
/usr/share/licenses/git-lfs
/usr/share/licenses/git-lfs/LICENSE.md
/usr/share/man/man1/git-lfs-checkout.1.gz
/usr/share/man/man1/git-lfs-clean.1.gz
/usr/share/man/man1/git-lfs-clone.1.gz
/usr/share/man/man1/git-lfs-dedup.1.gz
/usr/share/man/man1/git-lfs-env.1.gz
/usr/share/man/man1/git-lfs-ext.1.gz
/usr/share/man/man1/git-lfs-fetch.1.gz
/usr/share/man/man1/git-lfs-filter-process.1.gz
/usr/share/man/man1/git-lfs-fsck.1.gz
/usr/share/man/man1/git-lfs-install.1.gz
/usr/share/man/man1/git-lfs-lock.1.gz
/usr/share/man/man1/git-lfs-locks.1.gz
/usr/share/man/man1/git-lfs-logs.1.gz
/usr/share/man/man1/git-lfs-ls-files.1.gz
/usr/share/man/man1/git-lfs-migrate.1.gz
/usr/share/man/man1/git-lfs-pointer.1.gz
/usr/share/man/man1/git-lfs-post-checkout.1.gz
/usr/share/man/man1/git-lfs-post-commit.1.gz
/usr/share/man/man1/git-lfs-post-merge.1.gz
/usr/share/man/man1/git-lfs-pre-push.1.gz
/usr/share/man/man1/git-lfs-prune.1.gz
/usr/share/man/man1/git-lfs-pull.1.gz
/usr/share/man/man1/git-lfs-push.1.gz
/usr/share/man/man1/git-lfs-smudge.1.gz
/usr/share/man/man1/git-lfs-standalone-file.1.gz
/usr/share/man/man1/git-lfs-status.1.gz
/usr/share/man/man1/git-lfs-track.1.gz
/usr/share/man/man1/git-lfs-uninstall.1.gz
/usr/share/man/man1/git-lfs-unlock.1.gz
/usr/share/man/man1/git-lfs-untrack.1.gz
/usr/share/man/man1/git-lfs-update.1.gz
/usr/share/man/man1/git-lfs.1.gz
/usr/share/man/man5/git-lfs-config.5.gz

References

Summary

In this tutorial we learn how to install git-lfs on CentOS 8 using yum and dnf.