-
우분투 18.04 기본 개발 환경 설정How to Dev 2020. 12. 29. 14:38
우분투 18.04 기본 환경 설정
신규 서버 구성시 우분투에 필요한 도구 및 프로그래밍 환경 설정
Git 설치
형상 관리 및 Git 허브에서의 소스 다운로드
sudo apt update && sudo apt upgrade -y sudo apt-get install git -y
기본 유틸 설치
18.04에서는 설치되어 있어 skip 가능
# Install some basic utilities sudo apt-get install -y build-essential git make curl unzip g++ libtool
visual studio code
sudo apt-get install curl sudo sh -c 'curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg' sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' sudo apt update sudo apt install code
외부 터미널
dpkg -l | grep openssh sudo apt-get install openssh-server sudo service ssh start
vsftpd 설치 (on Ubuntu 18.04)
lsb_release -a sudo apt-get install vsftpd sudo vi /etc/vsftpd.conf sudo systemctl restart vsftpd
Go 작업 공간 디렉토리 생성
cd /opt #gopath는 프로젝트 통일 sudo mkdir -vp gopath/{src,pkg,bin} #소유권 변경 sudo chown -R ubuntu:ubuntu gopath #기본 디렉토리 생성 cd gopath cd src mkdir github.com cd github.com
Go 언어 다운로드 및 설치
cd /opt sudo wget https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz sudo tar -xzf go1.15.2.linux-amd64.tar.gz
환경 설정 파일 수정
sudo cat > /etc/profile <<EOF export GOPATH="/opt/gopath" export GOROOT="/opt/go" export PATH=$GOROOT/bin:$GOPATH/bin:$PATH EOF
안드로이드 스튜디오
sudo cat > /etc/profile <<EOF export ANDROID_HOME="$HOME/Android/Sdk" export PATH=$PATH:$ANDROID_HOME/tools; PATH=$PATH:$ANDROID_HOME/platform-tools EOF
nvm install
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh bash install_nvm.sh source ~/.profile nvm list
Node.js 설치
sudo apt install curl curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs sudo apt-get install -y build-essential #글로벌로 설치시 퍼미션 오류 해결 mkdir ~/npm-global-modules && npm config set prefix '~/npm-global-modules' && echo "export PATH=~/npm-global-modules/bin:\$PATH" >> ~/.profile && source ~/.profile
yarn install
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt update sudo apt install yarn sudo apt install --no-install-recommends yarn yarn --version
docker 설치
Install using the repository
SET UP THE REPOSITORY
1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt-get update sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
2.Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88
3. Use the following command to set up the stable repository
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
INSTALL DOCKER ENGINE
- Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
- test
sudo docker run hello-world
- docker-compose 설치
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
grant
sudo groupadd docker # sudo usermod -aG docker $USER sudo usermod -aG docker $(whoami) sudo reboot
utils
-
vsftpd 설치 (on Ubuntu 18.04)
# 설치 sudo apt-get install vsftpd # 재시작시 자동 시작 sudo systemctl stop vsftpd.service sudo systemctl start vsftpd.service sudo systemctl enable vsftpd.service # 550 에러 sudo vi /etc/vsftpd.conf # write_enable=YES sudo /etc/init.d/vsftpd restart
도커 삭제
sudo rm -rf /etc/docker sudo rm -rf /var/lib/docker sudo rm -rf /var/run/docker.sock suo rm -rf /var/run/docker.pid sudo apt-get --purge remove docker-ce sudo apt-get remove docker sudo apt-get remove docker-ce -y sudo apt-get remove docker-ce-cli -y sudo apt-get remove containerd.io -y sudo systemctl list-jobs sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce dpkg -l|grep docker
'How to Dev' 카테고리의 다른 글
Quasar 개발 환경 설정 (0) 2021.08.17 [Git] Git Hub 토큰 인증 로그인 - Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. (0) 2021.08.17 hyperledger fabric 백업 및 복구 (0) 2020.12.29 무료 DNS 사용 (0) 2020.12.29 소프트웨어 엔지니어 및 개발자로 성장하는 방법 (0) 2020.12.29 - Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version: