Skip to content

Instantly share code, notes, and snippets.

@abhinavmsra
Last active March 14, 2024 10:58
Show Gist options
  • Save abhinavmsra/765f3c1aaa9a75d19c72 to your computer and use it in GitHub Desktop.
Save abhinavmsra/765f3c1aaa9a75d19c72 to your computer and use it in GitHub Desktop.
Install s3cmd on CentOs

Installing s3cmd on CentOs

  1. As a superuser, go to /etc/yum.repos.d

    cd /etc/yum.repos.d

  2. Download the repo file

    wget http://s3tools.org/repo/RHEL_6/s3tools.repo

  3. Install the s3cmd

    sudo yum install s3cmd

  4. Perform yum upgrade to get the very latest s3cmd for your system

    sudo yum upgrade

  5. Configure the s3

    s3cmd --configure

If running this shows error, you might need to downgrade the python version to 2.6. You can do this by

`sudo nano /usr/bin/s3cmd`

and add 2.6 to the first line

`#!/usr/bin/python2.6`

Now, s3cmd --configure should work fine.

  1. Feed the credentials of your bucket.
@BrainforgeUK
Copy link

BrainforgeUK commented Mar 27, 2018

Cannot get configure to work - any ideas?

$ which python
/usr/bin/python

$ python -V
Python 2.6.6

$ s3cmd --configure
Traceback (most recent call last):
File "/usr/bin/s3cmd", line 2013, in
except ParameterError, e:
NameError: name 'ParameterError' is not defined

I change the HashBang on first line of s3cmd to alternative version in /usr/local/bin/...
/usr/local/bin/python3.6 - produced a syntax error.
/usr/local/bin/python2.7 - got Problem: ImportError: No module named S3.Exceptions

I tried to install as suggested by https ://github.com/s3tools/s3cmd/issues/298
Get same error with /usr/local/bin/python2.7
$ wget --no-check-certificate https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz
$ tar zxvf python-dateutil-2.2.tar.gz
$ cd python-dateutil-2.2
$ /usr/local/bin/python2.7 setup.py install

@Developer-AWS
Copy link

thx!

nice job.

@tamthing
Copy link

tamthing commented Oct 4, 2018

Thanks

Copy link

ghost commented May 1, 2019

It worked here in another way too:

yum -y install epel-release
yum -y install s3cmd

https://wiki.centos.org/AdditionalResources/Repositories

@tayfunerbilen
Copy link

@4chm3d much better, thank you.

@donuts-are-good
Copy link

[root@app1c yum.repos.d]# yum update
Tools for managing Amazon S3 - Simple Storage Service (RHEL_6) 1.9 kB/s | 1.6 kB 00:00
Dependencies resolved.
Nothing to do.
Complete!
[root@app1c yum.repos.d]# yum install s3cmd
Last metadata expiration check: 0:00:06 ago on Sun 25 Sep 2022 03:09:07 PM EDT.
Error:
Problem: cannot install the best candidate for the job

  • nothing provides python(abi) = 2.6 needed by s3cmd-1.0.0-4.1.x86_64
    (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
    [root@app1c yum.repos.d]#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment