├── .gitignore ├── README.md ├── files ├── adb-path.sh ├── browser.sh ├── dotnet-path.sh ├── dotnet-repository.sh ├── firefox.sh ├── flutter-path.sh ├── flutter-versions.sh ├── gradle-path.sh ├── gradle-versions.sh ├── noise-suppression-99-input-denoising.conf ├── php-repository-composer.sh ├── php-repository.sh └── postman.desktop ├── img └── 1.png ├── main.py ├── pkg ├── adb.json ├── browser.json ├── dotnet.json ├── firefox.json ├── flutter.json ├── gradle.json ├── java.json ├── mtp.json ├── node.json ├── noise_suppression.json ├── php.json ├── postman.json └── yay.json ├── pkgs.json └── src ├── Menu.py ├── PackageInstall.py ├── __init__.py └── util ├── Color.py ├── Command.py ├── Download.py ├── PackageManager.py ├── Printing.py ├── Temporal.py ├── UnCompress.py └── __init__.py /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | .idea 3 | ./temp 4 | temp 5 | *.pyc 6 | *.pyo 7 | *.pyd 8 | __pycache__/ 9 | venv/ 10 | .env/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Catálago de Software para instalar en GNULinux 2 | 3 | El objetivo de esta Wiki es poner a su disposición una lista de Software para instalar en su GNULinux. Fácil y sencillo como copiar y pegar código. 4 | 5 | ## Índice 6 | 7 | ### Script 8 | 9 | Este repositorio pone a su disposición un archivo Python que puede ejecutarse usando `python main.py` 10 | 11 | ![Linux-Installation](img/1.png) 12 | 13 | 14 | Los scripts estan divididos en gestores de paquetes como apt, dnf-yum, pacman-yay y genéricos (gnu-linux). 15 | 16 | - **Nota 1)**: Usted solo seleccione el paquete que desea instalar y el script hará el resto. 17 | 18 | - **Nota 2)**: Para distribuciones que usan el gestor de paquetes DNF-YUM; algunos script son especificos de una sola distribución, cuando este sea el caso. 19 | 20 | - **Nota 3)**: Para distribuciones que usan el gestor de paquetes DNF-YUM; se ha probado los script en distribuciones RHEL Family como CentOS 7, Centos 8, CentOs Stream 9, Fedora 33, Fedora 34, Fedora 35 o superior, RHEL 8. Si usted detecta algún error por favor reportarlo en *issues*. 21 | 22 | - **Nota 4)**: Usted puede realizar contribuciones al repositorio para agregar compatibilidad a otras GNULinux o agregar otros scripts para instalar paquetes con proceso de instalación largo. 23 | 24 | 25 | ### Fedora Linux 26 | 27 | - [Fedora 29 - 35 | Instalación de Apache Server y PHP 7.x](https://github.com/arteaprogramar/Linux-Installations/wiki/Fedora-%7C-Apache-Server-y-PHP-7.x) 28 | - [Fedora 33 - 35 | Instalación de Postgresql 12 y PGAdmin4](https://github.com/arteaprogramar/Linux-Installations/wiki/Fedora-%7C-Postgresql-12-y-PGAdmin4) 29 | - [Fedora 34 - 35 | Instalación de MySQL Server 5.7](https://github.com/arteaprogramar/Linux-Installations/wiki/Fedora-%7C-MySQL-Server-5.7) 30 | - [Fedora 34 - 35 | Instalación de MySQL Workbench](https://github.com/arteaprogramar/Linux-Installations/wiki/Fedora-%7C-MySQL-Workbench) 31 | 32 | ### RedHat Family Linux 33 | 34 | - [CentOS Stream 9 | Instalación de Apache Server y PHP 7.4](https://github.com/arteaprogramar/Linux-Installations/wiki/Centos-Stream-9-%7C-Apache-Server-y-PHP-7.4) 35 | - [RedHat Family 8+ | Instalación de VirtualBox](https://github.com/arteaprogramar/Linux-Installations/wiki/RHEL-Family-%7C-VirtualBox-6.1) 36 | 37 | ### Ubuntu 38 | 39 | - [Ubuntu 21+ | Instalación de Apache Server y PHP 7.4](https://github.com/arteaprogramar/Linux-Installations/wiki/Ubuntu-%7C-Apache-Server-y-PHP-7.4) 40 | - [Ubuntu 21+ | Instalación de MySQL Server 5.7](https://github.com/arteaprogramar/Linux-Installations/wiki/Ubuntu-%7C-MySQL-Server-5.7) 41 | 42 | ### Manjaro | ArchLinux Family 43 | 44 | - [Manjaro 21+ | Instalación de Apache Server y PHP 7.x](https://github.com/arteaprogramar/Linux-Installations/wiki/Manjaro-%7C-Apache-Server-y-PHP-7.x) 45 | - [Manjaro 21+ | Instalación de Postgresql 12 y PGAdmin4](https://github.com/arteaprogramar/Linux-Installations/wiki/Manjaro-%7C-Postgresql-12-y-PGAdmin4) 46 | - [Manjaro 21+ | Instalación de MySQL Server 5.7](https://github.com/arteaprogramar/Linux-Installations/wiki/Manjaro-%7C-MySQL-Server-5.7) -------------------------------------------------------------------------------- /files/adb-path.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Archivo de configuracion para exportar el adb al Bash de Linux 4 | export ADB_HOME=/opt/platform-tools 5 | export PATH=${ADB_HOME}:${PATH} 6 | -------------------------------------------------------------------------------- /files/browser.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | manager=$1 4 | 5 | if "$manager" --version > /dev/null 2>&1; then 6 | 7 | if [ "$manager" = "dnf" ]; then 8 | sudo dnf -y install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm 9 | 10 | # Instalación de Microsoft Edge 11 | sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc 12 | sudo dnf config-manager --add-repo https://packages.microsoft.com/yumrepos/edge 13 | sudo mv /etc/yum.repos.d/packages.microsoft.com_yumrepos_edge.repo /etc/yum.repos.d/microsoft-edge.repo 14 | sudo dnf install microsoft-edge-stable 15 | fi 16 | 17 | if [ "$manager" = "apt" ]; then 18 | wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -P temp 19 | sudo dpkg -i temp/google-chrome-stable_current_amd64.deb 20 | sudo apt -f install -y 21 | 22 | # Instalación de Microsoft Edge 23 | curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg 24 | sudo install -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/ 25 | sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-stable.list' 26 | sudo rm microsoft.gpg 27 | sudo apt update 28 | sudo apt install microsoft-edge-stable 29 | fi 30 | 31 | if [ "$manager" = "yay" ]; then 32 | yay -S google-chrome --noconfirm; 33 | yay -S microsoft-edge-stable-bin --noconfirm 34 | fi 35 | 36 | fi -------------------------------------------------------------------------------- /files/dotnet-path.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Archivo de configuracion para exportar al Path Linux 4 | export DOTNET_HOME=/usr/share/dotnet 5 | export PATH=${DOTNET_HOME}:${PATH} 6 | -------------------------------------------------------------------------------- /files/dotnet-repository.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | versions=("6" "7" "8" "9") 4 | 5 | if [ -z "$1" ]; then 6 | wget https://dot.net/v1/dotnet-install.sh -P temp > /dev/null 2>&1 7 | chmod +x temp/dotnet-install.sh 8 | 9 | printf '%s\n' "${versions[@]}" 10 | exit 0 11 | fi 12 | 13 | dotnet_version=$1 14 | 15 | for version in "${versions[@]}"; do 16 | if [ "$dotnet_version" = "$version" ]; then 17 | echo "Se instalará .NET $dotnet_version" 18 | sudo bash temp/dotnet-install.sh --runtime dotnet --version "$dotnet_version".0.0 --install-dir /usr/share/dotnet 19 | sudo bash temp/dotnet-install.sh --channel "$dotnet_version".0.1xx --install-dir /usr/share/dotnet 20 | exit 0 21 | fi 22 | done 23 | 24 | echo "Se ha seleccionado una opción invalida" 25 | exit 1 26 | -------------------------------------------------------------------------------- /files/firefox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | os_id=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) 4 | 5 | if [[ $os_id = "debian" || $os_id = "ubuntu" ]]; then 6 | 7 | if [ $os_id = "debian" ]; then 8 | sudo apt -y install firefox-esr 9 | fi 10 | 11 | if [ $os_id = "ubuntu" ]; then 12 | 13 | sudo install -d -m 0755 /etc/apt/keyrings 14 | wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null 15 | gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}' 16 | echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null 17 | echo ' 18 | Package: * 19 | Pin: origin packages.mozilla.org 20 | Pin-Priority: 1000 21 | ' | sudo tee /etc/apt/preferences.d/mozilla 22 | 23 | sudo apt update && sudo apt -y remove firefox 24 | sudo apt update && sudo apt -y install firefox 25 | 26 | fi 27 | 28 | else 29 | echo "Se requiere Ubuntu o Debian pero estas ejecutando : $os_id" 30 | fi -------------------------------------------------------------------------------- /files/flutter-path.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Archivo de configuracion para exportar al Path Linux 4 | export FLUTTER_HOME=/opt/Flutter 5 | export PATH=${FLUTTER_HOME}/bin:${PATH} 6 | -------------------------------------------------------------------------------- /files/flutter-versions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Obtener el JSON de la URL 4 | flutter_version=$(curl -s https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json) 5 | 6 | # Extraer las versiones estables 7 | stable_versions=$(echo "$flutter_version" | awk -F'"' '/"channel": *"stable"/ {getline; print $4}' | grep -v '^$' | head -n 20) 8 | 9 | # Mostrar las versiones estables 10 | echo "$stable_versions" 11 | -------------------------------------------------------------------------------- /files/gradle-path.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Archivo de configuracion para exportar el Gradle al Bash de Linux 4 | export GRADLE_HOME=/opt/Gradle 5 | export PATH=${GRADLE_HOME}/bin:${PATH} 6 | -------------------------------------------------------------------------------- /files/gradle-versions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | gradle_url=$(curl -s https://raw.githubusercontent.com/gradle/gradle/master/released-versions.json) 4 | versions=$(echo "$gradle_url" | sed -n '/"finalReleases": \[/,/\]/p' | grep -oP '"version":\s*"\K[0-9.]+' | grep -v '^$' | head -n 20) 5 | 6 | # Mostrar los resultados 7 | printf '%s\n' "${versions[@]}" -------------------------------------------------------------------------------- /files/noise-suppression-99-input-denoising.conf: -------------------------------------------------------------------------------- 1 | context.modules = [ 2 | { name = libpipewire-module-filter-chain 3 | args = { 4 | node.description = "Noise Canceling source" 5 | media.name = "Noise Canceling source" 6 | filter.graph = { 7 | nodes = [ 8 | { 9 | type = ladspa 10 | name = rnnoise 11 | plugin = /usr/lib64/ladspa/librnnoise_ladspa.so 12 | label = noise_suppressor_mono 13 | control = { 14 | "VAD Threshold (%)" = 50.0 15 | "VAD Grace Period (ms)" = 200 16 | "Retroactive VAD Grace (ms)" = 0 17 | } 18 | } 19 | ] 20 | } 21 | capture.props = { 22 | node.name = "capture.rnnoise_source" 23 | node.passive = true 24 | audio.rate = 48000 25 | } 26 | playback.props = { 27 | node.name = "rnnoise_source" 28 | media.class = Audio/Source 29 | audio.rate = 48000 30 | } 31 | } 32 | } 33 | ] -------------------------------------------------------------------------------- /files/php-repository-composer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | os_id=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) 4 | 5 | if [[ $os_id == "debian" || $os_id == "ubuntu" ]]; then 6 | echo "Estas ejecutando GNU Linux : $os_id" 7 | 8 | curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php 9 | HASH=`curl -sS https://composer.github.io/installer.sig` 10 | echo $HASH 11 | php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" 12 | sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer 13 | 14 | else 15 | echo "Estas ejecutando GNU Linux : $os_id" 16 | fi 17 | -------------------------------------------------------------------------------- /files/php-repository.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | os_id=$(grep '^ID=' /etc/os-release | cut -d'=' -f2) 4 | 5 | if [[ $os_id = "debian" || $os_id = "ubuntu" ]]; then 6 | echo "Estas ejecutando GNU Linux : $os_id" 7 | 8 | # Instrucciones para Debian 9 | if [ $os_id = "debian" ]; then 10 | 11 | sudo apt install lsb-release apt-transport-https ca-certificates wget -y 12 | sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg 13 | 14 | # Obtener el nombre base de debian 15 | codename=$(lsb_release -sc) 16 | 17 | # Validar si se usa Debian Testing con nombre base "trixie" 18 | if [[ $codename = "trixie" || $codename = "testing" ]]; then 19 | echo "deb https://packages.sury.org/php/ bookworm main" | sudo tee /etc/apt/sources.list.d/php.list 20 | else 21 | echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list 22 | fi 23 | 24 | fi 25 | 26 | # Instrucciones para Ubuntu 27 | if [ $os_id == "ubuntu" ]; then 28 | sudo add-apt-repository ppa:ondrej/php 29 | fi 30 | 31 | # Actualizar repositorios 32 | sudo apt update 33 | 34 | else 35 | echo "Estas ejecutando GNU Linux : $os_id" 36 | fi 37 | -------------------------------------------------------------------------------- /files/postman.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=Postman 4 | Exec=/opt/Postman/app/Postman %U 5 | Icon=/opt/Postman/app/resources/app/assets/icon.png 6 | Terminal=false 7 | Type=Application 8 | Categories=Development; -------------------------------------------------------------------------------- /img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteaprogramar/Linux-Installations/0ee5812e28620d854f68d53a5b2c563a8616e717/img/1.png -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | import json 4 | import os 5 | 6 | from src.util import Printing, Temporal, PackageManager 7 | from src import PackageInstall, Menu 8 | 9 | 10 | def parser_int(value: str): 11 | try: 12 | return int(value) 13 | except ValueError: 14 | return -1 15 | 16 | 17 | def start(): 18 | Temporal.folder_delete(Temporal.FOLDER_TEMP) 19 | 20 | pkg_manager = PackageManager.get_package_manager() 21 | Temporal.temp_folder_create() 22 | 23 | Printing.title("Arte a Programar : v3.0") 24 | Printing.subtitle(f'Gestor de Paquetes : {pkg_manager}', False) 25 | Printing.subtitle(f'Arquitectura : {os.uname().machine}') 26 | 27 | packages = json.load(open('pkgs.json')) 28 | filtered = [item for item in packages if pkg_manager in item["manager"] or "gnu" in item["manager"]] 29 | option = Menu.show('Lista de paquetes disponibles para instalar', filtered) 30 | 31 | PackageInstall.init(option, pkg_manager) 32 | 33 | if __name__ == '__main__': 34 | start() 35 | 36 | -------------------------------------------------------------------------------- /pkg/adb.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe los paquetes unzip, wget", 4 | "command" : null, 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--execute-all-commands", 9 | "param" : ["unzip --help", "wget --version"] 10 | }, 11 | "warning" : null 12 | }, 13 | { 14 | "action" : "Descargar ADB", 15 | "command" : null, 16 | "command_alternative" : null, 17 | "required_output" : false, 18 | "extra" : { 19 | "name" : "--download", 20 | "param" : "https://dl.google.com/android/repository/platform-tools-latest-linux.zip" 21 | }, 22 | "warning" : null 23 | }, 24 | { 25 | "action" : "Descomprimir archivo", 26 | "command" : "unzip temp/platform-tools-latest-linux.zip -d temp", 27 | "command_alternative" : null, 28 | "required_output" : false, 29 | "extra" : null, 30 | "warning" : null 31 | }, 32 | { 33 | "action" : "Mover a OPT", 34 | "command" : "sudo mv temp/platform-tools /opt/platform-tools", 35 | "command_alternative" : null, 36 | "required_output" : false, 37 | "extra" : null, 38 | "warning" : null 39 | }, 40 | { 41 | "action" : "Agrega al PATH de Linux el ADB y darle permisos de ejecución", 42 | "command" : "sudo cp files/adb-path.sh /etc/profile.d/adb.sh; sudo chmod +x /etc/profile.d/adb.sh", 43 | "command_alternative" : null, 44 | "required_output" : false, 45 | "extra" : null, 46 | "warning" : null 47 | }, 48 | { 49 | "action" : "Se require su contraseña para aplicar el comando '$ source /etc/profile.d/adb.sh'", 50 | "command" : "su -c 'source /etc/profile.d/adb.sh' root", 51 | "command_alternative" : null, 52 | "required_output" : false, 53 | "extra" : null, 54 | "warning" : "En caso de no ingresar de manera exitosa su contraseña, favor de ejecutar manualmente $ source /etc/profile.d/adb.sh" 55 | }, 56 | { 57 | "action" : "En algunas distribuciones requiere reiniciar el sistema", 58 | "command" : "/opt/platform-tools/adb --version", 59 | "command_alternative" : null, 60 | "required_output" : false, 61 | "extra" : null, 62 | "warning" : null 63 | } 64 | ] -------------------------------------------------------------------------------- /pkg/browser.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe los paquetes wget, curl", 4 | "command" : null, 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--execute-all-commands", 9 | "param" : ["wget --version", "curl --version"] 10 | }, 11 | "warning" : null 12 | }, 13 | { 14 | "action" : "Instalación de Google Chrome & Microsoft Edge", 15 | "command" : null, 16 | "command_alternative" : { 17 | "dnf" : "bash files/browser.sh dnf", 18 | "apt" : "bash files/browser.sh apt", 19 | "pacman" : "bash files/browser.sh yay" 20 | }, 21 | "required_output" : false, 22 | "extra" : null, 23 | "warning" : null 24 | } 25 | ] -------------------------------------------------------------------------------- /pkg/dotnet.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Obtener versiones disponibles de .NET", 4 | "command" : " bash files/dotnet-repository.sh ", 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "Lista de versiones disponibles", 9 | "param" : null 10 | }, 11 | "warning" : null 12 | }, 13 | { 14 | "action" : "Descargar e instalar .NET", 15 | "command" : " bash files/dotnet-repository.sh {version} ", 16 | "command_alternative" : null, 17 | "required_output" : false, 18 | "extra" : null, 19 | "warning" : null 20 | }, 21 | { 22 | "action" : "Agregar al PATH de Linux y dar permisos de ejecución a .NET", 23 | "command" : "sudo cp files/dotnet-path.sh /etc/profile.d/dotnet.sh; sudo chmod +x /etc/profile.d/dotnet.sh", 24 | "command_alternative" : null, 25 | "required_output" : false, 26 | "extra" : null, 27 | "warning" : null 28 | }, 29 | { 30 | "action" : "Se require su contraseña para aplicar el comando '$ source /etc/profile.d/dotnet.sh'", 31 | "command" : "su -c 'source /etc/profile.d/dotnet.sh' root", 32 | "command_alternative" : null, 33 | "required_output" : false, 34 | "extra" : null, 35 | "warning" : "En caso de no ingresar de manera exitosa su contraseña, favor de ejecutar manualmente $ source /etc/profile.d/dotnet.sh" 36 | }, 37 | { 38 | "action" : "En algunas distribuciones requiere reiniciar el sistema", 39 | "command" : "/usr/share/dotnet/dotnet --version", 40 | "command_alternative" : null, 41 | "required_output" : false, 42 | "extra" : null, 43 | "warning" : null 44 | } 45 | ] -------------------------------------------------------------------------------- /pkg/firefox.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe los paquetes wget", 4 | "command" : null, 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--execute-all-commands", 9 | "param" : ["wget --version"] 10 | }, 11 | "warning" : null 12 | }, 13 | { 14 | "action" : "Instalación de Firefox", 15 | "command" : " bash files/firefox.sh ", 16 | "command_alternative" : null, 17 | "required_output" : true, 18 | "extra" : { 19 | "name" : "Lista de versiones disponibles", 20 | "param" : null 21 | }, 22 | "warning" : null 23 | } 24 | ] -------------------------------------------------------------------------------- /pkg/flutter.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe los paquetes bash, curl, file, git, mkdir, rm, which, cmake, clang, unzip", 4 | "command" : null, 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--execute-all-commands", 9 | "param" : ["bash --version", "curl --version", "file --version", "git --version", "mkdir --version", "rm --version", "which --version", "cmake --version", "clang --version", "unzip --help"] 10 | }, 11 | "warning" : null 12 | }, 13 | { 14 | "action" : "Instalación de CoreUtils", 15 | "command" : null, 16 | "command_alternative" : { 17 | "dnf" : " sudo dnf -y install coreutils ", 18 | "apt" : " sudo apt -y install coreutils ", 19 | "pacman" : " pacman -S coreutils --noconfirm " 20 | }, 21 | "required_output" : false, 22 | "extra" : null, 23 | "warning" : null 24 | }, 25 | { 26 | "action" : "Instalación de XZ y Mesa", 27 | "command" : null, 28 | "command_alternative" : { 29 | "dnf" : " sudo dnf -y install xz mesa-libGLU ", 30 | "apt" : " sudo apt -y install xz-utils libglu1-mesa ", 31 | "pacman" : " pacman -S xz glu --noconfirm " 32 | }, 33 | "required_output" : false, 34 | "extra" : null, 35 | "warning" : null 36 | }, 37 | { 38 | "action" : "Obtener versiones disponibles de Flutter", 39 | "command" : " bash files/flutter-versions.sh ", 40 | "command_alternative" : null, 41 | "required_output" : true, 42 | "extra" : { 43 | "name" : "Lista de versiones disponibles", 44 | "param" : null 45 | }, 46 | "warning" : null 47 | }, 48 | { 49 | "action" : "Descarga de Flutter", 50 | "command" : null, 51 | "command_alternative" : null, 52 | "required_output" : false, 53 | "extra" : { 54 | "name" : "--download", 55 | "param" : "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_{version}-stable.tar.xz" 56 | }, 57 | "warning" : null 58 | }, 59 | { 60 | "action" : "Descomprimir archivo", 61 | "command" : "tar xf temp/flutter_linux_{version}-stable.tar.xz --directory temp", 62 | "command_alternative" : null, 63 | "required_output" : false, 64 | "extra" : null, 65 | "warning" : null 66 | }, 67 | { 68 | "action" : "Mover a OPT", 69 | "command" : "sudo mv temp/flutter /opt/Flutter", 70 | "command_alternative" : null, 71 | "required_output" : false, 72 | "extra" : null, 73 | "warning" : null 74 | }, 75 | { 76 | "action" : "Agregar al PATH de Linux y dar permisos de ejecución a Flutter", 77 | "command" : "sudo cp files/flutter-path.sh /etc/profile.d/flutter.sh; sudo chmod +x /etc/profile.d/flutter.sh", 78 | "command_alternative" : null, 79 | "required_output" : false, 80 | "extra" : null, 81 | "warning" : null 82 | }, 83 | { 84 | "action" : "Se require su contraseña para aplicar el comando '$ source /etc/profile.d/flutter.sh'", 85 | "command" : "su -c 'source /etc/profile.d/flutter.sh' root", 86 | "command_alternative" : null, 87 | "required_output" : false, 88 | "extra" : null, 89 | "warning" : "En caso de no ingresar de manera exitosa su contraseña, favor de ejecutar manualmente $ source /etc/profile.d/flutter.sh" 90 | }, 91 | { 92 | "action" : "En algunas distribuciones requiere reiniciar el sistema", 93 | "command" : "/opt/Flutter/bin/flutter doctor", 94 | "command_alternative" : null, 95 | "required_output" : false, 96 | "extra" : null, 97 | "warning" : null 98 | } 99 | ] -------------------------------------------------------------------------------- /pkg/gradle.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe los paquetes unzip, wget, curl, java", 4 | "command" : null, 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--execute-all-commands", 9 | "param" : ["unzip --help", "wget --version", "curl --version", "java -version"] 10 | }, 11 | "warning" : "Se requiere que Java este instalado en su sistema" 12 | }, 13 | { 14 | "action" : "Obtener versiones disponibles de Gradle", 15 | "command" : " bash files/gradle-versions.sh ", 16 | "command_alternative" : null, 17 | "required_output" : true, 18 | "extra" : { 19 | "name" : "Lista de versiones disponibles", 20 | "param" : null 21 | }, 22 | "warning" : null 23 | }, 24 | { 25 | "action" : "Descarga de Gradle", 26 | "command" : null, 27 | "command_alternative" : null, 28 | "required_output" : false, 29 | "extra" : { 30 | "name" : "--download", 31 | "param" : "https://services.gradle.org/distributions/gradle-{version}-all.zip" 32 | }, 33 | "warning" : null 34 | }, 35 | { 36 | "action" : "Descomprimir archivo", 37 | "command" : "unzip temp/gradle-{version}-all.zip -d temp", 38 | "command_alternative" : null, 39 | "required_output" : false, 40 | "extra" : null, 41 | "warning" : null 42 | }, 43 | { 44 | "action" : "Mover a OPT", 45 | "command" : "sudo mv temp/gradle-{version} /opt/Gradle", 46 | "command_alternative" : null, 47 | "required_output" : false, 48 | "extra" : null, 49 | "warning" : null 50 | }, 51 | { 52 | "action" : "Agregar al PATH de Linux y dar permisos de ejecución a Gradle", 53 | "command" : "sudo cp files/gradle-path.sh /etc/profile.d/gradle.sh; sudo chmod +x /etc/profile.d/gradle.sh", 54 | "command_alternative" : null, 55 | "required_output" : false, 56 | "extra" : null, 57 | "warning" : null 58 | }, 59 | { 60 | "action" : "Se require su contraseña para aplicar el comando '$ source /etc/profile.d/gradle.sh'", 61 | "command" : "su -c 'source /etc/profile.d/gradle.sh' root", 62 | "command_alternative" : null, 63 | "required_output" : false, 64 | "extra" : null, 65 | "warning" : "En caso de no ingresar de manera exitosa su contraseña, favor de ejecutar manualmente $ source /etc/profile.d/gradle.sh" 66 | }, 67 | { 68 | "action" : "En algunas distribuciones requiere reiniciar el sistema", 69 | "command" : "/opt/Gradle/bin/gradle --version", 70 | "command_alternative" : null, 71 | "required_output" : false, 72 | "extra" : null, 73 | "warning" : null 74 | } 75 | ] -------------------------------------------------------------------------------- /pkg/java.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Actualizar sistema", 4 | "command" : null, 5 | "command_alternative" : { 6 | "dnf" : "sudo dnf -y upgrade", 7 | "apt" : "sudo apt update; sudo apt -y upgrade", 8 | "pacman" : "sudo pacman -Syu --noconfirm" 9 | }, 10 | "required_output" : false, 11 | "extra" : null, 12 | "warning" : null 13 | }, 14 | { 15 | "action" : "Versiones disponibles de Java", 16 | "command" : null, 17 | "command_alternative" : { 18 | "dnf" : " dnf search openjdk | awk -v arch=$(uname -m) '$0 ~ \"openjdk\\\\.\" arch {split($1, a, \"-\"); print a[1] \"-\" a[2]}' ", 19 | "apt" : " apt-cache search openjdk | awk '$0 ~ \"[0-9]{1,2}-jdk -\" { split($1, a, \"-\"); print a[1] \"-\" a[2] }' ", 20 | "pacman" : " pacman -Ss jre | grep -E jre'([0-9]{0,2})'-openjdk'\\s[0-9]{1,2}' | awk -F '[-]' '{print $1}' | awk -F 'jre' '{print $2}' " 21 | }, 22 | "required_output" : true, 23 | "extra" : { 24 | "name" : "Lista de versiones disponibles de Java", 25 | "param" : null 26 | }, 27 | "warning" : null 28 | }, 29 | { 30 | "action" : "Instalación de Java", 31 | "command" : null, 32 | "command_alternative" : { 33 | "dnf" : " sudo dnf -y install {version}-openjdk {version}-openjdk-devel {version}-openjdk-headless {version}-openjdk-javadoc ", 34 | "apt" : " sudo apt -y install {version}-jdk {version}-jre version}-doc ", 35 | "pacman" : " pacman -S jre{version}-openjdk jdk{version}-openjdk --noconfirm " 36 | }, 37 | "required_output" : false, 38 | "extra" : null, 39 | "warning" : null 40 | }, 41 | { 42 | "action" : "Verificar Java", 43 | "command" : "java -version", 44 | "command_alternative" : null, 45 | "required_output" : false, 46 | "extra" : null, 47 | "warning" : null 48 | } 49 | ] -------------------------------------------------------------------------------- /pkg/mtp.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Instalación de Media Transfer Protocol", 4 | "command" : "sudo pacman -S mtpfs gvfs-mtp --noconfirm", 5 | "command_alternative" : null, 6 | "required_output" : false, 7 | "extra" : null, 8 | "warning" : null 9 | }, 10 | { 11 | "action" : "Nota: Se requiere reiniciar el sistema", 12 | "command" : null, 13 | "command_alternative" : null, 14 | "required_output" : false, 15 | "extra" : null, 16 | "warning" :null 17 | } 18 | ] -------------------------------------------------------------------------------- /pkg/node.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe el paquete CURL", 4 | "command" : "curl --version", 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--pkg-exists", 9 | "param" : null 10 | }, 11 | "warning" : "Si el paquete CURL no existe en su SO favor de descargarlo" 12 | }, 13 | { 14 | "action" : "Instalación de NodeJS", 15 | "command" : null, 16 | "command_alternative" : { 17 | "dnf" : "sudo dnf -y install nodejs", 18 | "apt" : "sudo curl -sL https://deb.nodesource.com/setup_23.x -o /tmp/nodesource_setup.sh; sudo bash /tmp/nodesource_setup.sh; sudo apt update; sudo apt install -y nodejs ", 19 | "pacman" : "pacman -S nodejs npm --noconfirm" 20 | }, 21 | "required_output" : false, 22 | "extra" : null, 23 | "warning" : null 24 | }, 25 | { 26 | "action" : "Verificar versión de Node", 27 | "command" : "node --version", 28 | "command_alternative" : null, 29 | "required_output" : false, 30 | "extra" : null, 31 | "warning" : null 32 | } 33 | ] 34 | -------------------------------------------------------------------------------- /pkg/noise_suppression.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe los paquetes wget, curl", 4 | "command" : null, 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--execute-all-commands", 9 | "param" : ["wget --version", "curl --version", "pipewire --version"] 10 | }, 11 | "warning" : null 12 | }, 13 | { 14 | "action" : "Descargar Noise Suppression", 15 | "command" : null, 16 | "command_alternative" : null, 17 | "required_output" : false, 18 | "extra" : { 19 | "name" : "--download", 20 | "param" : "https://github.com/werman/noise-suppression-for-voice/releases/download/v1.10/linux-rnnoise.zip" 21 | }, 22 | "warning" : null 23 | }, 24 | { 25 | "action" : "Descomprimir archivo", 26 | "command" : "unzip temp/linux-rnnoise.zip -d temp", 27 | "command_alternative" : null, 28 | "required_output" : false, 29 | "extra" : null, 30 | "warning" : null 31 | }, 32 | { 33 | "action" : "Mover a LADSPA", 34 | "command" : "sudo mkdir -p /usr/lib64/ladspa; sudo cp temp/linux-rnnoise/ladspa/librnnoise_ladspa.so /usr/lib64/ladspa", 35 | "command_alternative" : null, 36 | "required_output" : false, 37 | "extra" : null, 38 | "warning" : null 39 | }, 40 | { 41 | "action" : "Crear archivo de congfiguración para el cancelador mediante Pipewire", 42 | "command" : "mkdir -p ~/.config/pipewire/pipewire.conf.d; cp files/noise-suppression-99-input-denoising.conf ~/.config/pipewire/pipewire.conf.d/99-input-denoising.conf", 43 | "command_alternative" : null, 44 | "required_output" : false, 45 | "extra" : null, 46 | "warning" : null 47 | }, 48 | { 49 | "action" : "Reiniciar servicio de Pipewire para mostrar el cancelador como nuevo metodo de entrada en ajustes", 50 | "command" : "systemctl restart --user pipewire.service", 51 | "command_alternative" : null, 52 | "required_output" : false, 53 | "extra" : null, 54 | "warning" : null 55 | }, 56 | { 57 | "action" : "Verificar estado del servicio Pipewire", 58 | "command" : "systemctl status --user pipewire.service", 59 | "command_alternative" : null, 60 | "required_output" : false, 61 | "extra" : null, 62 | "warning" : "En caso de que el servicio no este activo por algún error se recomienda borrar la carpeta '~/.config/pipewire/pipewire.conf.d' y reiniciar el servicio" 63 | } 64 | ] 65 | -------------------------------------------------------------------------------- /pkg/php.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Actualizar sistema", 4 | "command" : null, 5 | "command_alternative" : { 6 | "dnf" : "sudo dnf -y upgrade", 7 | "apt" : "sudo apt update; sudo apt -y upgrade", 8 | "pacman" : "sudo pacman -Syu --noconfirm" 9 | }, 10 | "required_output" : false, 11 | "extra" : null, 12 | "warning" : null 13 | }, 14 | { 15 | "action" : "Instalación de Apache Server", 16 | "command" : null, 17 | "command_alternative" : { 18 | "dnf" : "sudo dnf -y install httpd curl", 19 | "apt" : "sudo apt -y install apache2 curl", 20 | "pacman" : "sudo pacman -S apache curl --noconfirm" 21 | }, 22 | "required_output" : false, 23 | "extra" : null, 24 | "warning" : null 25 | }, 26 | { 27 | "action" : "Agregar repositorio, esta acción solo es requerida en Ubuntu/Debian", 28 | "command" : "bash files/php-repository.sh", 29 | "command_alternative" : null, 30 | "required_output" : false, 31 | "extra" : null, 32 | "warning" : null 33 | }, 34 | { 35 | "action" : "Versiones disponibles de PHP", 36 | "command" : null, 37 | "command_alternative" : { 38 | "dnf" : " dnf search php | awk -v arch=$(uname -m) '$1 ~ \"^php\\\\.\" arch \":$\" {split($1, a, \".\"); print a[1]}' ", 39 | "apt" : " apt-cache search php | egrep '^php[0-9]+.[0-9]+[[:space:]]+-[[:space:]]' | awk '{print $1}' ", 40 | "pacman" : " pacman -Ss php | grep -E '/php[0-9]{0,2}[[:space:]]' | awk '{print $1}' | awk -F '/' '{print $2}' " 41 | }, 42 | "required_output" : true, 43 | "extra" : { 44 | "name" : "Lista de versiones disponibles de Java", 45 | "param" : null 46 | }, 47 | "warning" : null 48 | }, 49 | { 50 | "action" : "Instalación de PHP y Módulos de Apache", 51 | "command" : null, 52 | "command_alternative" : { 53 | "dnf" : " sudo dnf -y install {version} {version}-common ", 54 | "apt" : " sudo apt -y install {version} ", 55 | "pacman" : " sudo pacman -S {version} {version}-apache --noconfirm " 56 | }, 57 | "required_output" : false, 58 | "extra" : null, 59 | "warning" : null 60 | }, 61 | { 62 | "action" : "Instalación de Módulos de PHP", 63 | "command" : null, 64 | "command_alternative" : { 65 | "dnf" : " sudo dnf -y install {version}-cgi {version}-enchant {version}-fpm {version}-gd {version}-intl {version}-odbc {version}-pgsql {version}-sqlite3 {version}-tidy {version}-xsl {version}-memcache {version}-zip {version}-curl ", 66 | "apt" : " sudo apt -y install {version}-cgi {version}-enchant {version}-fpm {version}-gd {version}-imap {version}-intl {version}-odbc {version}-pgsql {version}-sqlite3 {version}-tidy {version}-xsl {version}-memcache {version}-zip {version}-curl ", 67 | "pacman" : " sudo pacman -S {version}-apache {version}-cgi {version}-dblib {version}-embed {version}-enchant {version}-fpm {version}-gd {version}-imap {version}-intl {version}-odbc {version}-pgsql {version}-snmp {version}-sqlite {version}-tidy {version}-xsl {version}-memcache --noconfirm " 68 | }, 69 | "required_output" : false, 70 | "extra" : null, 71 | "warning" : null 72 | }, 73 | { 74 | "action" : "Instalación de Composer", 75 | "command" : null, 76 | "command_alternative" : { 77 | "dnf" : " sudo dnf -y install composer ", 78 | "apt" : " bash files/php-repository-composer.sh ", 79 | "pacman" : " sudo pacman -S composer --noconfirm " 80 | }, 81 | "required_output" : false, 82 | "extra" : null, 83 | "warning" : null 84 | }, 85 | { 86 | "action" : "Reiniciar servicios de apache", 87 | "command" : null, 88 | "command_alternative" : { 89 | "dnf" : " sudo systemctl restart httpd; sudo systemctl status httpd ", 90 | "apt" : " sudo systemctl restart apache2; sudo systemctl status apache2 ", 91 | "pacman" : " sudo systemctl restart httpd; sudo systemctl status httpd " 92 | }, 93 | "required_output" : false, 94 | "extra" : null, 95 | "warning" : null 96 | }, 97 | { 98 | "action" : "Abrir el navegador para ver información de PHP", 99 | "command" : null, 100 | "command_alternative" : { 101 | "dnf" : " sudo chmod 777 /var/www/; echo '' > /var/www/index.php; xdg-open http://127.0.0.1 ", 102 | "apt" : " sudo chmod 777 /var/www/; echo '' > /var/www/index.php; xdg-open http://127.0.0.1 ", 103 | "pacman" : " sudo chmod 777 /srv/http; echo '' > /srv/http/index.php; xdg-open http://127.0.0.1 " 104 | }, 105 | "required_output" : false, 106 | "extra" : null, 107 | "warning" : null 108 | } 109 | ] -------------------------------------------------------------------------------- /pkg/postman.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe los paquetes tar, wget", 4 | "command" : null, 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--execute-all-commands", 9 | "param" : ["tar --version", "wget --version"] 10 | }, 11 | "warning" : null 12 | }, 13 | { 14 | "action" : "Descargar Postman x64", 15 | "command" : null, 16 | "command_alternative" : null, 17 | "required_output" : false, 18 | "extra" : { 19 | "name" : "--download", 20 | "param" : "https://dl.pstmn.io/download/latest/linux_64" 21 | }, 22 | "warning" : null 23 | }, 24 | { 25 | "action" : "Descomprimir archivo", 26 | "command" : "tar zxvf temp/linux_64 --directory temp", 27 | "command_alternative" : null, 28 | "required_output" : false, 29 | "extra" : null, 30 | "warning" : null 31 | }, 32 | { 33 | "action" : "Mover a OPT", 34 | "command" : "sudo mv temp/Postman /opt/Postman", 35 | "command_alternative" : null, 36 | "required_output" : false, 37 | "extra" : null, 38 | "warning" : null 39 | }, 40 | { 41 | "action" : "Crear entrada Postman 'postman.desktop'", 42 | "command" : "sudo cp files/postman.desktop ~/.local/share/applications/Postman.desktop", 43 | "command_alternative" : null, 44 | "required_output" : false, 45 | "extra" : null, 46 | "warning" : null 47 | }, 48 | { 49 | "action" : "Nota: Asegurese de tener instalado openssl en su ordenador", 50 | "command" : null, 51 | "command_alternative" : null, 52 | "required_output" : false, 53 | "extra" : null, 54 | "warning" : "https://learning.postman.com/docs/getting-started/installation/installation-and-updates/#linux-installation-notes" 55 | } 56 | ] -------------------------------------------------------------------------------- /pkg/yay.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "action" : "Comprobar si existe los paquetes git", 4 | "command" : null, 5 | "command_alternative" : null, 6 | "required_output" : true, 7 | "extra" : { 8 | "name" : "--execute-all-commands", 9 | "param" : ["git --version"] 10 | }, 11 | "warning" : null 12 | }, 13 | { 14 | "action" : "Descargar e instalar YAY", 15 | "command" : "cd temp; git clone https://aur.archlinux.org/yay.git; cd yay; makepkg -si --noconfirm", 16 | "command_alternative" : null, 17 | "required_output" : true, 18 | "extra" : null, 19 | "warning" : null 20 | }, 21 | { 22 | "action" : "Obtener versión de YAY", 23 | "command" : "yay --version", 24 | "command_alternative" : null, 25 | "required_output" : false, 26 | "extra" : null, 27 | "warning" : null 28 | } 29 | ] -------------------------------------------------------------------------------- /pkgs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name" : "Instalación de ADB", 4 | "manager" : ["gnu"], 5 | "actions" : "pkg/adb.json" 6 | }, 7 | { 8 | "name" : "Instalación de Java", 9 | "manager" : ["dnf", "pacman", "apt"], 10 | "actions" : "pkg/java.json" 11 | }, 12 | { 13 | "name" : "Instalación de Gradle", 14 | "manager" : ["gnu"], 15 | "actions" : "pkg/gradle.json" 16 | }, 17 | { 18 | "name" : "Instalación de Postman x64", 19 | "manager" : ["gnu"], 20 | "actions" : "pkg/postman.json" 21 | }, 22 | { 23 | "name" : "Instalación de PHP", 24 | "manager" : ["dnf", "pacman", "apt"], 25 | "actions" : "pkg/php.json" 26 | }, 27 | { 28 | "name" : "Instalación de NodeJS", 29 | "manager" : ["dnf", "pacman", "apt"], 30 | "actions" : "pkg/node.json" 31 | }, 32 | { 33 | "name" : "Instalación de Media Transfer Protocol", 34 | "manager" : ["pacman"], 35 | "actions" : "pkg/mtp.json" 36 | }, 37 | { 38 | "name" : "Instalación de Flutter", 39 | "manager" : ["dnf", "pacman", "apt"], 40 | "actions" : "pkg/flutter.json" 41 | }, 42 | { 43 | "name" : "Instalación de dotNet SDK & Runtime", 44 | "manager" : ["gnu"], 45 | "actions" : "pkg/dotnet.json" 46 | }, 47 | { 48 | "name" : "Instalación de YAY Helper", 49 | "manager" : ["pacman"], 50 | "actions" : "pkg/yay.json" 51 | }, 52 | { 53 | "name" : "Instalación de Google Chrome & Microsoft Edge x64", 54 | "manager" : ["dnf", "pacman", "apt"], 55 | "actions" : "pkg/browser.json" 56 | }, 57 | { 58 | "name" : "Instalación de Firefox sin snap en Debian y Ubuntu", 59 | "manager" : ["apt"], 60 | "actions" : "pkg/firefox.json" 61 | }, 62 | { 63 | "name" : "Cancelador de Ruido para Pipewire", 64 | "manager" : ["gnu"], 65 | "actions" : "pkg/noise_suppression.json" 66 | } 67 | ] -------------------------------------------------------------------------------- /src/Menu.py: -------------------------------------------------------------------------------- 1 | from main import parser_int 2 | from src.util import Printing 3 | 4 | 5 | def show(title : str, list): 6 | """ 7 | Require un array que tenga la llave 'name' para funcionar 8 | :param title: 9 | :param list: 10 | :return: 11 | """ 12 | Printing.title(title, False) 13 | selected = -1 14 | 15 | for index, item in enumerate(list): 16 | value = item['name'] if 'name' in item else list[index] 17 | print(f"[\033[1m{index}\033[0m] {value}") 18 | 19 | continue_menu = True 20 | 21 | while continue_menu: 22 | selected = parser_int(input("Ingrese una opción : ")) 23 | 24 | if selected < len(list): 25 | continue_menu = False 26 | 27 | print("\n") 28 | return list[selected] 29 | -------------------------------------------------------------------------------- /src/PackageInstall.py: -------------------------------------------------------------------------------- 1 | import json 2 | from src import Menu 3 | from src.util import Printing, Command, Download, Temporal 4 | 5 | def init(pkg, manager: str): 6 | Printing.title(pkg['name']) 7 | 8 | process = json.load(open(pkg['actions'])) 9 | apply(process, manager) 10 | Temporal.folder_delete(Temporal.FOLDER_TEMP) 11 | 12 | 13 | def apply(instructions, manager: str): 14 | version = '' 15 | 16 | for instruction in instructions: 17 | Printing.title(instruction['action'], False) 18 | 19 | output = None 20 | command = None 21 | captured_output = instruction['required_output'] 22 | extra = instruction['extra'] 23 | warning = instruction['warning'] 24 | 25 | # Mostrar mensaje de advertencia 26 | if warning is not None: 27 | Printing.warning(warning, True) 28 | 29 | # Comando 30 | if instruction['command'] is not None and instruction['command_alternative'] is None: 31 | command = instruction['command'] 32 | 33 | # Comando alternativo 34 | if instruction['command'] is None and instruction['command_alternative'] is not None: 35 | command = instruction['command_alternative'][manager] 36 | 37 | # Ejecutar el comando cuando sea necesario 38 | if command is not None: 39 | # Si se trata de un comando para manipular versiones 40 | if "{version}" in command: 41 | command = command.format(version=version) 42 | 43 | output = Command.execute(command, captured_output) 44 | 45 | # Acciones extras 46 | if extra is not None: 47 | 48 | # Permite descargar archivos 49 | if extra['name'] == '--download': 50 | 51 | if "{version}" in extra['param']: 52 | Download.for_wget(extra['param'].format(version=version)) 53 | else: 54 | Download.for_wget(extra['param']) 55 | 56 | # Permite validar si existe un paquete 57 | elif extra['name'] == '--pkg-exists': 58 | 59 | if not isinstance(output, list): 60 | Printing.warning("Se requiere una dependencia que no existe en su sistema") 61 | exit() 62 | 63 | # Permite ejecutar multiples comandos y requiere que todos sean executados correctamente 64 | elif extra['name'] == '--execute-all-commands': 65 | 66 | if isinstance(extra['param'], list): 67 | Command.require_all_execute(extra['param']) 68 | Printing.warning("Se han executado todos los comandos con existo") 69 | else: 70 | Printing.warning("Se requiere una lista de comandos") 71 | exit() 72 | 73 | # Muestra un un menu de opciones 74 | else: 75 | version = Menu.show(extra['name'], output) 76 | 77 | print() 78 | -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteaprogramar/Linux-Installations/0ee5812e28620d854f68d53a5b2c563a8616e717/src/__init__.py -------------------------------------------------------------------------------- /src/util/Color.py: -------------------------------------------------------------------------------- 1 | class Color: 2 | PURPLE = '\033[95m' 3 | CYAN = '\033[96m' 4 | DARKCYAN = '\033[36m' 5 | BLUE = '\033[94m' 6 | GREEN = '\033[92m' 7 | YELLOW = '\033[93m' 8 | RED = '\033[91m' 9 | BOLD = '\033[1m' 10 | UNDERLINE = '\033[4m' 11 | END = '\033[0m' 12 | ITALIC = '\033[3m' 13 | RESET = '\033[0m' 14 | 15 | -------------------------------------------------------------------------------- /src/util/Command.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | from src.util import Printing 4 | 5 | def execute(args: str, capture_output: bool = False, hidden_log : bool = False): 6 | """ 7 | Este metodo nos permitira executar un comando en unix mediante python y obtener el resultado 8 | de la ejecución de ese comando 9 | :param capture_output: 10 | :param hidden_log: 11 | :param args: 12 | :return: 13 | """ 14 | try: 15 | command = None 16 | 17 | if not hidden_log: 18 | Printing.title("Comando a ejecutar : ", False) 19 | Printing.subtitle(args) 20 | 21 | if capture_output: 22 | command = subprocess.run( 23 | args, 24 | shell=True, 25 | check=True, 26 | stdout=subprocess.PIPE, 27 | stderr=subprocess.PIPE 28 | ) 29 | 30 | if not capture_output: 31 | subprocess.run( 32 | args, 33 | shell=True, 34 | check=True 35 | ) 36 | 37 | if not hidden_log: 38 | if capture_output: 39 | Printing.title("Logs: ", False) 40 | print(command.stdout.decode("utf-8")) 41 | 42 | print("") 43 | 44 | if capture_output: 45 | return command.stdout.decode("utf-8").strip().split("\n") 46 | else: 47 | return "Ok" 48 | except Exception as exception: 49 | if not hidden_log: 50 | print(f"Se ha producido un error : ${exception}") 51 | return False 52 | 53 | 54 | def require_all_execute(commands: list): 55 | for cmd in commands: 56 | result = execute(cmd, True, True) 57 | 58 | if not isinstance(result, list): 59 | Printing.warning(f"Ocurrido un error al ejecutar {cmd} verifique si el paquete/comando esta instalado o puede ser llamado en su sistema") 60 | exit() -------------------------------------------------------------------------------- /src/util/Download.py: -------------------------------------------------------------------------------- 1 | from src.util import Command, Temporal, Printing 2 | 3 | 4 | def for_wget(url : str): 5 | make = Temporal.folder_exists(Temporal.FOLDER_TEMP) 6 | 7 | if make: 8 | Command.execute(f'wget {url} -P {Temporal.FOLDER_TEMP}') 9 | # Command.execute(f'curl -O --output-dir {Temporal.FOLDER_TEMP} {url}') 10 | 11 | if not make: 12 | Printing.warning("Se ha producido un error al crear la carpeta temporal") 13 | exit() -------------------------------------------------------------------------------- /src/util/PackageManager.py: -------------------------------------------------------------------------------- 1 | from src.util import Command, Printing 2 | 3 | packages = ['apt', 'dnf', 'pacman'] 4 | 5 | def get_package_manager(): 6 | manager = '' 7 | 8 | for package in packages: 9 | result = package_exists(package) 10 | 11 | if result: 12 | manager = package 13 | 14 | return manager 15 | 16 | 17 | def package_exists(name : str) : 18 | """ 19 | Permite saber si un paquete existe atraves del argumento --version 20 | :param name: 21 | :return: 22 | """ 23 | result = Command.execute(f"{name} --version", True, True) 24 | return isinstance(result, list) -------------------------------------------------------------------------------- /src/util/Printing.py: -------------------------------------------------------------------------------- 1 | from src.util.Color import Color 2 | 3 | 4 | def title(text : str, require_new_line : bool = True): 5 | print(Color.BOLD + text + Color.END) 6 | 7 | if require_new_line: 8 | print("") 9 | 10 | 11 | def warning(text : str, require_new_line : bool = True): 12 | print(Color.RED + text + Color.END) 13 | 14 | if require_new_line: 15 | print("") 16 | 17 | 18 | def subtitle(text: str, require_new_line : bool = True): 19 | print(Color.ITALIC + text + Color.END) 20 | 21 | if require_new_line: 22 | print("") 23 | -------------------------------------------------------------------------------- /src/util/Temporal.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | 4 | FOLDER_TEMP = 'temp' 5 | 6 | def folder_exists(path: str): 7 | return os.path.exists(path) 8 | 9 | 10 | def temp_folder_create(): 11 | try: 12 | if not folder_exists(FOLDER_TEMP): 13 | os.makedirs(FOLDER_TEMP) 14 | 15 | return folder_exists(FOLDER_TEMP) 16 | except OSError: 17 | return False 18 | 19 | 20 | def folder_delete(path: str): 21 | try: 22 | if folder_exists(path): 23 | shutil.rmtree(path) 24 | 25 | return not folder_exists(path) 26 | except OSError: 27 | return False -------------------------------------------------------------------------------- /src/util/UnCompress.py: -------------------------------------------------------------------------------- 1 | from src.util import Command 2 | 3 | 4 | def unzip(path: str, directory_output: str): 5 | result = Command.execute(f'unzip {path} -d {directory_output}') 6 | 7 | if isinstance(result, bool): 8 | return result 9 | else: 10 | return True 11 | 12 | 13 | def un_tar_gz(path: str, directory_output: str): 14 | result = Command.execute(f'tar zxvf {path} --directory {directory_output}') 15 | 16 | if isinstance(result, bool): 17 | return result 18 | else: 19 | return True 20 | 21 | 22 | def un_tar_xz(path: str, directory_output: str): 23 | result = Command.execute(f'tar xf {path} --directory {directory_output}') 24 | 25 | if isinstance(result, bool): 26 | return result 27 | else: 28 | return True -------------------------------------------------------------------------------- /src/util/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arteaprogramar/Linux-Installations/0ee5812e28620d854f68d53a5b2c563a8616e717/src/util/__init__.py --------------------------------------------------------------------------------