How to Install xclip on CentOS 8

Updated on February 7, 2022

I recently started using CentOS 8 on my server and I couldn’t see the package xclip installed on CentOS 8 (below is the command not found error message). This article will help you to install xclip on CentOS 8.

# xclip
-bash: xclip: command not found
What is xclip?

xclip is a command line utility that is designed to run on any system with an X11 implementation. It provides an interface to X selections (“the clipboard”) from the command line. It can read data from standard in or a file and place it in an X selection for pasting into other X applications.

How to install xclip on CentOS 8 using dnf

Firstly you need to install the EPEL (Extra Packages for Enterprise Linux) repository and enable it.

What is EPEL?

EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux.

Step 1: Install EPEL Repo

# dnf install epel-release
Did you get the error - failed to download metadata for repo ‘AppStream’?

If you encountered the error “failed to download metadata for repo ‘AppStream’”: then follow article to resolve:

Step 2: Install xclip

# dnf install xclip
Last metadata expiration check: 0:06:09 ago on Mon 07 Feb 2022 10:39:39 AM IST.
Dependencies resolved.
=============================================================================================================================================================
 Package                             Architecture                         Version                                   Repository                          Size
=============================================================================================================================================================
Installing:
 xclip                               x86_64                               0.13-8.el8                                epel                                35 k

Transaction Summary
=============================================================================================================================================================
Install  1 Package

How to install xclip using source package

You can compile yourself from the source and install it as below:

Step 1: Install libXmu & X11 development library

# yum install libXmu-devel libX11-devel

Step 2: Obtain the source code

# git clone https://github.com/astrand/xclip.git

Step 3: Compile and Install at the default location

# cd xclip
# ./bootstrap
# ./configure
# make
# make install

Step 4: Verify the installation

# man xclip

That’s It!

Was this article helpful?

Related Articles

Leave a Comment