shell自动安装python3的脚本写法
root用户权限
#viminstall_python3.sh 1 #!/bin/sh yum-yinstallzlib-develbzip2-developenssl-develncurses-develsqlite-develreadline-develtk-develgdbm-develdb4-devellibpcap-develxz-devellibffi-devel wgethttps://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz tar-zxvfPython-3.7.0.tgz mkdir/usr/local/python3 cdPython-3.7.0 ./configure--prefix=/usr/local/python3 make&&makeinstall [-f/usr/bin/python3]&&mv/usr/bin/python3/usr/bin/python3_old [-f/usr/bin/pip3]&&mv/usr/bin/pip3/usr/bin/pip3_old ln-s/usr/local/python3/bin/python3.7/usr/bin/python3 ln-s/usr/local/python3/bin/pip3.7/usr/bin/pip3
ps:下面看下shell脚本--一键安装python3+pip
安装python3.6.1
#!/bin/bash yum-yinstallzlib-develbzip2-developenssl-develncurses-develsqlite-develepel-releasegcc wgethttps://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz tarvxfPython-3.6.1.tgz cdPython-3.6.1 ./configure--prefix=/usr/local make&&makeinstall cd.. yum-yinstallpython-pip
安装python3.6.6
yuminstallzlibzlib-develreadline-develsqlite-develbzip2-developenssl-develgdbm-devellibdbi-develncurses-libskernel-devellibxslt-devellibffi-develpython-develzlib-developenldap-develsshpassgccgit-y yuminstallhttp://www.percona.com/downloads/percona-release/redhat/0.1-6/percona-release-0.1-6.noarch.rpm-y yuminstallPercona-Server-server-56installPercona-Server-devel-56-y wgethttps://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz#CentOS7不用安装python2.7 tar-xzvfPython-3.6.6.tgz cdPython-3.6.6 ./configure--prefix=/usr/local/python3 makeall makeinstall makeclean makedistclean ln-s/usr/local/python3/bin/python3/usr/bin/python3 ln-s/usr/local/python3/bin/pip3/usr/bin/pip3
总结
以上所述是小编给大家介绍的shell自动安装python3的脚本写法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对毛票票网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。