Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Last active December 2, 2017 14:26
Show Gist options
  • Save joffilyfe/50684ad3bf11769151a7 to your computer and use it in GitHub Desktop.
Save joffilyfe/50684ad3bf11769151a7 to your computer and use it in GitHub Desktop.
Instalação do python 3 no debian 6
#!/bin/sh
clear
message() {
echo "##################################################";
echo "# #";
echo "# INSTALANDO O PYTHON 3.5 #";
echo "# #";
echo "##################################################";
}
download_deps() {
echo "Baixando e instalando as dependências..."
cd /tmp && wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz
cd /tmp && wget https://github.com/madler/zlib/archive/master.zip
clear
}
debia_deps_install() {
clear
message
echo "Instalando o OpenSSL && SQLite3!"
apt-get update
apt-get install libssl-dev openssl python-pysqlite2 libsqlite3-dev sqlite3 make
}
zlib_install() {
message()
echo "Instalando o Z-lib"
clear()
cd /tmp && unzip master.zip && rm -rf master.zip
cd /tmp/zlib-master && ./configure && make && make install
}
python_install() {
echo "Instalando o Python 3.5"
cd /tmp && tar -xf Python-3.5.1.tar.xz
cd /tmp/Python-3.5.1 && ./configure --with-ensurepip=install && make && make install
cd .. && rm -rf /tmp/Python-3.5.1
}
# Iniciando o script
clear
message
# Baixando os pacotes
download_deps
# Instalando o SSL
debia_deps_install
# Instalando o zlib
zlib_install
# Instalando o Python
python_install
echo "Saindo do modo root! bye!"
exit
echo "alias python='/usr/local/bin/python3'" >> ~/.bashrc
echo "Ok, tudo pronto!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment