How to install fabric on CentOS

In this short article I will show you how to install fabric, a useful tool that can be used to automatize the way you execute ssh commands over multiple machines (from fabfile):
Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.
Multiple software must be installed before you can successfully use fabric:
  • Install python-devel : execute yum install python-devel
Install python-devel on CentOS
  • Install epel-release: execute yum install epel-release
Install epel-release on CentOS
Alternatively you can use wget to download the packge and then execute rpm -ivh epel-release-6-8.noarch.rpm to install it. Note that if you are located behind a proxy, you will need to set a proxy on your CentOS machine.
  • Now we’ll need to install python-pip by executing yum install -y python-pip, if you receive an error saying something like: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again, then you will need to edit the epel.repo file. Execute vim /etc/yum.repos.d/epel.repo to open this configuration file in a text editor. Now comment mirrorlist section and uncomment baseurl:
EPEL repository on CentOS
  • You can now execute yum update to perform a full update on the Operating System and then try again with the python-pip install. You’ll have to execute pip install paramiko==1.10 and if you receive a timeout error similar to the image below, configure a https proxy (export and then retry the install:
Install python-pip on CentOS
  • To complete the install operation execute pip install fabric and wait for the download/install operation to complete:
How to install fabric on CentOS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s