Is it possible to install aws-cli package without root permission?

前端 未结 3 1684
忘掉有多难
忘掉有多难 2021-02-13 19:51

As title suggested, I haven\'t been able to find a good way to install aws-cli (https://github.com/aws/aws-cli/) without having the root access (or equivalent of

3条回答
  •  忘掉有多难
    2021-02-13 19:59

    Obviously, the answers is possible. The trick is to install the whole stack in an alternate location on the host machine.

    So altinstall python, then easy_intsall, then pip. Here are the command history in my log.

    cd
    mkdir installations
    cd installations/
    curl -O https://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2
    tar xjf Python-2.7.tar.bz2 
    cd Python-2.7
    mkdir -p ~/usr/local
    make altinstall prefix=~/usr/local exec-prefix=~/usr/local
    ~/usr/local/bin/python2.7 -V
    ln -s ~/usr/local/bin/python2.7 ~/usr/local/bin/python
    echo "export $PATH=~/usr/local/bin:$PATH" >> ~/.bashrc
    source ~/.bashrc
    cd
    mkdir virtualenv
    cd virtualenv/
    curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py
    mkdir ~/envs
    python virtual-python.py --prefix=~/env/aws
    curl -O http://peak.telecommunity.com/dist/ez_setup.py
    ~/env/aws/bin/python ez_setup.py
    echo "export $PATH=~/env/aws/bin:~/usr/local/bin:$PATH" >> ~/.bashrc
    source ~/.bashrc
    easy_install virtualenv
    virtualenv --no-site-packages ~/env/awscli
    source ~/env/awscli/bin/activate
    pip -V
    pip install awscli
    

    These are helpful links that I followed to help me achieve that goal.

    Install Python in an alternate location

    Install Python stack without root privilege

提交回复
热议问题