sh – DevHouse Internet Software Development House http://localhost:8080 Desenvolvimento de Sistemas para Internet e Mobile Tue, 23 Jun 2026 08:58:43 +0000 pt-BR hourly 1 https://wordpress.org/?v=4.8.14 Editando a variável de ambiente PATH no Linux Mint Debian http://localhost:8080/editando-a-variavel-de-ambiente-path-no-linux-mint-debian/ http://localhost:8080/editando-a-variavel-de-ambiente-path-no-linux-mint-debian/#comments Fri, 15 Jun 2012 20:50:47 +0000 http://www.devhouse.com.br/?p=346 Para colocar um aplicativo na variável PATH o Linux Mint Debian, ou qualquer Debian edite o arquivo /etc/profile.

$ sudo pluma /etc/profile

Antes da linha “export PATH” insira PATH=$PATH:/caminho/para/o/programa. Use o “:” como separador de valores. Veja como ficou o meu /etc/profile com path para o eclipse:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
PATH=$PATH:/opt/eclipse
export PATH

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

As alterações no /etc/profile são aplicadas a todos os usuários do sistema. Na pasta home do usuário existe um arquivo .profile que também pode ser editado.

Uma outra forma de colocar um aplicativo no path é colocar um link simbólico para o aplicativo na pasta /usr/bin. Veja como o instalador do Google Chrome fez:

$ ls -l /usr/bin/google-chrome 
lrwxrwxrwx 1 root root 32 Jun  7 03:17 /usr/bin/google-chrome -> /opt/google/chrome/google-chrome

Você consegue o mesmo efeito usando o seguinte comando:

$ ln -s /opt/google/chrome/google-chrome /usr/bin/google-chrome

Por hoje é só pessoal!

]]>
http://localhost:8080/editando-a-variavel-de-ambiente-path-no-linux-mint-debian/feed/ 3