Linux Debian 개발환경 설정 가이드

IDE


Visual Studio Code


C++


build-essential

sudo apt-get install -y gcc libc6-dev build-essential libglu1-mesa-dev

Qt Creator

./qt...online.run


C#


.Net Core

Unity 3D


Python


pyenv

sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
CFLAGS=-I/usr/include/openssl
LDFLAGS=-L/usr/lib64
exec "$SHELL"
pyenv install -l # 설치 가능한 버전 확인
pyenv install 3.11.0 # 버전 설치
pyenv versions # 설치된 버전 확인
pyenv global 3.11.0 # 버전 사용
python --version

Tensorflow

pip install -U --user pip six numpy wheel mock
pip install -U --user keras_applications==1.0.5 --no-deps
pip install -U --user keras_preprocessing==1.0.3 --no-deps
pip install tensorflow
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-IaVeRg/termcolor/

만약 위와같은 오류가 발생하면 아래의 명령을 입력한다.

pip install --upgrade setuptools

텐서플로우가 정상적으로 작동하는지 간단히 확인하기 위해서 tensor.py를 작성해 보았다.

import tensorflow as tf

hello = tf.constant('hello tensorflow')
sess = tf.Session()
print(sess.run(hello))

a = tf.constant(10)
b = tf.constant(32)
print(sess.run(a + b))
python tensor.py
hello tensorflow
42


Ruby


rbenv

sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install -l # 설치 가능한 버전 확인
rbenv install 3.1.2 # 버전 설치
rbenv versions # 설치된 버전 확인
rbenv global 3.1.2 # 버전 사용
ruby -v


JavaScript


Node (nvm)

sudo apt-get install -y build-essential libssl-dev curl
curl https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
source ~/.bashrc
nvm install 16.14.0 # 버전 설치
nvm version # 설치된 버전 확인
nvm use 16.14.0 # 버전 사용
node -v

Deno

sudo apt-get install unzip -y
curl -fsSL https://deno.land/x/install/install.sh | sh
echo 'export DENO_INSTALL="$HOME/.deno"' >> ~/.bashrc
echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
deno --version


Rust


Rustup

sudo apt-get install build-essential

curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
export PATH="$HOME/.cargo/bin:$PATH"
rustc --version

업데이트는 rustup update로 가능 아래 두 명령어는 bashrcprofile에 등록해 두는게 편하다.

source $HOME/.cargo/env
export PATH="$HOME/.cargo/bin:$PATH"


Java


Android Studio

/dev/kvm permission denied. 오류가 발생할 경우

sudo apt-get install qemu-kvm
sudo adduser <username> kvm
sudo chown <username> /dev/kvm


Shell


Git Branch

vi ~/.bashrc
parse_git_branch()
{
   if git rev-parse --git-dir >/dev/null 2>&1
   then
      gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
   else
      return 0
   fi
   echo -e \($gitver\)
}

...

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(parse_git_branch) \$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch) \$ '
fi

LoadEnv

vi ~/.bashrc
loadEnv() {
  local envFile="${1?Missing environment file}"
  local environmentAsArray variableDeclaration
  mapfile environmentAsArray < <(
    grep --invert-match '^#' "${envFile}" \
      | grep --invert-match '^\s*$'
  ) # Uses grep to remove commented and blank lines
  for variableDeclaration in "${environmentAsArray[@]}"; do
    export "${variableDeclaration//[$'\r\n']}" # The substitution removes the line breaks
  done
}
loadEnv .env

Git Emoji

vi ~/.bashrc
alias gitemoji="curl -L gitemoji.vvip.page"

이 글이 도움이 되었나요?

0 minutes ago
작성된 댓글이 없습니다. 첫 댓글을 달아보세요!
    댓글을 작성하려면 로그인이 필요합니다.