This article describes how to install the python component pip on linux and rely on wget. Currently, it is not smart enough. for details, refer to the following code:
#! /Bin/bash
Files_url = (https://pypi.python.org/packages/source/s/setuptools/setuptools-2.1.tar.gz#md5=2044725530450d0517393882dc4b7508 https://pypi.python.org/packages/source/p/pip/pip-1.5.tar.gz)
Files = (setuptools pip)
Packages_dir =/data/packages/temp/
If [! -D $ packages_dir]
Then
Mkdir-p $ packages_dir
Fi
Downfile (){
Count = 0
For I in $ {files_url [*]}
Do
Wget $ I-O $ packages_dir $ {files [$ count]} ". tgz"
Tar xvzf $ packages_dir $ {files [$ count]} ". tgz"-C $ packages_dir
Count = $ ($ count + 1 ))
Done
}
Installfile (){
For z in $ (ls $ packages_dir)
Do
Pacname = $ (tar tf $ packages_dir/$ z | head-1 | cut-d/-f 1)
Tar xvzf $ packages_dir $ z-C $ packages_dir
Python $ packages_dir $ pacname/setup. py install
Done
}
Downfile
Installfile
Echo-e "#############"
Echo-e "# python OK #"
Echo-e "#############"