WSL/Ubuntu에 작업 환경 설정하기

  • C++ 개발환경 설정하기
apt update
apt upgrade
apt install build-essential gdb
// 설치 및 버전 확인
g++ --version
  • Windows Directory mount 하기
# windows folder를 mount 할 로컬 경로 생성
mkdir /<localdir>
# 그룹을 만들고 사용자 id 추가
sudo groupadd <localGroup>
sudo usermod -aG <localGroup> <userid>
sudo chown -R :<localGroup> /<localDir>
# fstab 에 mount 설정 추가
cat /etc/fstab
LABEL=cloudimg-rootfs / ext4 defaults 0 0
/mnt/c/_Work/<WindowWorkingFolder> /<localDir> auto nosuid,nodev,nofail,bind 0 0
# 자동으로 마운트 되도록 설정 'mount -a' 를 추가 함. root user에 설정. 일반 사용자의 .bashrc 에 설정하는 경우 'sudo mount -a' 사용
vi .bashrc
mount -a
  • 디렉토리 이동을 위한 alias 설정하기
alias cds  ='cd /DirectoryPath1'
alias cdn  ='cd /DirectoryPath2'
alias cdsn ='cd /DirectoryPath3'
alias cdm  ='cd /DirectoryPath4'
alias cdl  ='cd /DirectoryPath5'
alias cdio ='cd /DirectoryPath6'
alias cdb  ='cd /DirectoryPath7'
alias cdns ='cd /DirectoryPath8'
alias cdsvc='cd /DirectoryPath9'
alias cdtr ='cd /DirectoryPath10'
alias cdc  ='cd /DirectoryPath11'
alias psg  ='ps -ef | grep '
  • Python 설치하기
apt install python3.8 python3-dev
  • WSL에 설치된 ubuntu Restart 하기
    • 윈도우에서 관리자 모드로 PowerShell을 실행한다.
    • Restart-Service LxssManager 을 실행한다.
  • 윈도우에 VScode 설치하기
    https://code.visualstudio.com/ 에서 다운로드
  • ubuntu에서 vscode 설정하기
    ubuntu의 임의 폴더에서 code . 실행하여 vscode 를 실행한다.
    “Remote WSL” extention 을 설치한다.
  • WSL uninstall
    wslconfig /u Ubuntu-20.04
  • .profile 설정
PATH=".:$PATH"
LD_LIBRARY_PATH=/ois/Lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

This entry was posted in 리눅스. Bookmark the permalink.

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다