Skip to content

Instantly share code, notes, and snippets.

@leonardobiffi
Last active December 21, 2019 12:53
Show Gist options
  • Select an option

  • Save leonardobiffi/ba3dc2bfcc01d12b9acfbfe7aef613df to your computer and use it in GitHub Desktop.

Select an option

Save leonardobiffi/ba3dc2bfcc01d12b9acfbfe7aef613df to your computer and use it in GitHub Desktop.

Revisions

  1. leonardobiffi revised this gist Nov 2, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ubuntu_posinstall.sh
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,8 @@ PROGRAMAS_PARA_INSTALAR=(
    docker.io
    docker-compose
    tilix
    libreoffice
    libreoffice-l10n-pt-br
    )

    ## Atualizando o repositório depois da adição de novos repositórios ##
  2. leonardobiffi renamed this gist Nov 2, 2019. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. leonardobiffi created this gist Nov 2, 2019.
    52 changes: 52 additions & 0 deletions ubuntu_postinstall.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    #!/usr/bin/env bash

    #VARIAVEIS
    URL_GOOGLE_CHROME="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
    URL_TEAMVIEWER="https://download.teamviewer.com/download/linux/version_13x/teamviewer_amd64.deb"

    DIRETORIO_DOWNLOADS="$HOME/Downloads/programas"

    PROGRAMAS_PARA_INSTALAR=(
    flameshot
    vim
    gnome-tweak-tool
    docker.io
    docker-compose
    tilix
    )

    ## Atualizando o repositório depois da adição de novos repositórios ##
    sudo apt update -y

    ## Download e instalaçao de programas externos ##
    mkdir "$DIRETORIO_DOWNLOADS"
    wget -c "$URL_GOOGLE_CHROME" -P "$DIRETORIO_DOWNLOADS"
    wget -c "$URL_TEAMVIEWER" -P "$DIRETORIO_DOWNLOADS"


    ## Instalando pacotes .deb baixados na sessão anterior ##
    sudo dpkg -i $DIRETORIO_DOWNLOADS/*.deb

    # Instalar programas no apt
    for nome_do_programa in ${PROGRAMAS_PARA_INSTALAR[@]}; do
    if ! dpkg -l | grep -q $nome_do_programa; then # Só instala se já não estiver instalado
    apt install "$nome_do_programa" -y
    else
    echo "[INSTALADO] - $nome_do_programa"
    fi
    done

    ## Configuração para o Docker ##
    sudo usermod -aG docker $USER

    ## Instalando pacotes Snap ##
    sudo snap install spotify
    sudo snap install sublime-text

    # ----------------------------- PÓS-INSTALAÇÃO ----------------------------- #
    ## Finalização, atualização e limpeza##
    sudo apt install -f
    sudo apt update && sudo apt dist-upgrade -y
    flatpak update
    sudo apt autoclean
    sudo apt autoremove -y