How To Install htslib on CentOS 8

htslib is C library for high-throughput sequencing data formats

Introduction

In this tutorial we learn how to install htslib on CentOS 8.

What is htslib

HTSlib is an implementation of a unified C library for accessing common file formats, such as SAM, CRAM and VCF, used for high-throughput sequencing data, and is the core library used by samtools and bcftools.

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

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

sudo dnf -y install htslib

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

sudo yum -y install htslib

How To Uninstall htslib on CentOS 8

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

sudo dnf remove htslib

htslib Package Contents on CentOS 8

/usr/lib/.build-id
/usr/lib/.build-id/0d
/usr/lib/.build-id/0d/c346908322b4b9417d4d8253eb94896af6340a
/usr/lib/.build-id/27
/usr/lib/.build-id/27/6240cafb17d8e040915181db330d8be410405e
/usr/lib/.build-id/44
/usr/lib/.build-id/44/5dd6fee7a43ad97f39327d5341f87c2dfa5f65
/usr/lib/.build-id/56
/usr/lib/.build-id/56/5a8b41e9bc728076f1984a91b53d69ac72cf4f
/usr/lib64/libhts.so.1.9
/usr/lib64/libhts.so.2
/usr/libexec/htslib
/usr/libexec/htslib/hfile_gcs.so
/usr/libexec/htslib/hfile_libcurl.so
/usr/libexec/htslib/hfile_s3.so
/usr/share/doc/htslib
/usr/share/doc/htslib/NEWS
/usr/share/licenses/htslib
/usr/share/licenses/htslib/LICENSE
/usr/share/man/man5/faidx.5.gz
/usr/share/man/man5/sam.5.gz
/usr/share/man/man5/vcf.5.gz

References

Summary

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