Override git user name and email address temporarily

Override git user name and email address temporarily

이 글에서는 전역이나 프로젝트에 설정된 git 사용자가 자신이 아닌경우 임시로 username과 email을 설정 하는 방법을 설명한다.

Terminal에서 git 명령을 수행 하기 전에 아래 명령을 수행하여 git 명령을 잠시 override 하자.

alias git='git -c "user.name=euikook" -c "[email protected]"'

임시 사용자 이름 및 이메일 주소 설정

Terminal을 빠져 나오면 설정이 날아가기 때문에 타인의 PC에서 수정한 사항을 커밋할 경우 유용하게 사용할 수 있다.

현재 설정된 user.nameuser.email을 확인하기 위해서는

git config user.name
git config user.email

설정된 설정을 모두 확인 하고 싶으면 --list 옵션을 사용하면 된다.

git config --list

Let use zsh

Let use zsh

.zshrc

ZSH=/usr/share/oh-my-zsh/
ZSH_THEME="agnoster"
DISABLE_AUTO_UPDATE="true"
plugins=(git virtualenv)


ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
if [[ ! -d $ZSH_CACHE_DIR ]]; then
  mkdir $ZSH_CACHE_DIR
fi

source $ZSH/oh-my-zsh.sh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/nvm/init-nvm.sh

prompt_context() {
  if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    CONTEXT="%(!.%{%F{yellow}%}.)%n"
    if [[ -n "$SSH_CLIENT" ]]; then
      CONTEXT="${CONTEXT}@%m"
      #prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
    fi
    prompt_segment black default ${CONTEXT}
  fi
}


[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

Usages of SSH key pair

Usages of SSH key pair

Generate SSH key pair

ssh-keygen

ssh-keygen -t rsa -b 4096 -f test
  • test.pub: Public Key
  • test: Private Key

Use key

Copy to remote system

Copy Public key to $REMOTE_HOST

ssh-copy-id $USER@$REMOTE_HOST -i test

or, if there is no public key in remote host

scp ~/.ssh/test.pub $USER@$REMOTE_HOST:.ssh/authorized_keys

Login use Private Key

ssh $USER@$REMOTE_HOST -i .ssh/test

./ssh/config

Edit ~/.ssh/config as following.

Host 1.2.3.4 test
    Hostname 1.2.3.4
    User username
    Port 22
    SendEnv LANG LC_*
    IdentityFile ~/.ssh/test

Connect remote system using ssh command

ssh test

Instructions of post OS install

OS 재설치 후 해야 하는것 들

OS 재설치 후 해야 하는 내용들을 정리 한다.

파일 복사

rsync를 이용한다.

USB등 외부 디스크를 통한 복사

rsync -avzh $SRC $DST

네트워크(SSH)통한 복사.

시간이 오래 걸리지만 편함.

rsync -avz -e ssh $REMOTE_HOST:/$$SRC $DST

Root 권한이 필요한 경우

rsync -avz -e ssh --rsync-path='sudo ssh' $REMOTE_HOST:/$$SRC $DST

리모트 시스템에 해당 유저의 sudo 설정이 NOPASSWD로 설정되어 있아야 한다.

visudo
username ALL=NOPASSWD:/usr/bin/rsync

Application

Virtualbox

rsync -avzh $OLD_HOME/.config/VirtualBox $HOME/.config/VirtualBox

Insync

Stop Insync

이미 Insync를 실행하여 설정 파일이 생성되어 있다면 파일을 삭제한다.

rm -rf $HOME/.config/Insync

파일을 복사한다.

rsync -avzh $OLD_HOME/.config/Insync $HOME/.config/Insync

VirtualBox 동적 할당 디스크 사이즈 줄이기(내보내기)

Shrink dynamically allocated VirtualBox Disk Image(VDI)

Motivation

업무에 VirtualBox을 자주 활용한다.

개발 환경등을 시스템에 설치 하기 힘들때 VirtualBox를 사용하여 개발환경을 구축 하거나 결과물을 설치 하여 테스트용으로 배포한다.

여러대의 머신이 필요하지만 AWS나 GCP를 사용하기 힘들때 유용한 대안이 바로 VirtualBox이다.

Virtualbox 가상머신의 디스크를 동적 할당 디스크로 생성 하였을 경우 경우 환경 설치 후 불필요한 파일을 삭제 하더라도 디스크의 크기가 줄어들지 않기 때문에 내보내기 한 이미지도 같이 커진다.

혼자만 사용할 때는 디스크 용량만 차지할 뿐 아무 문제가 없지만 가상머신을 배포 해야 하는 경우가 되면 이미지의 사이즈가 너무 커서 배포하기 부담스러워 진다.

위와 같은 경우에 효율적인 배포를 위한 동적 할당 디스크의 이미지 사이즈를 줄이는 방법을 소개 한다.

vboxmanage modifymedium --compact 명령을 이용하여 VDI 이미지 사이즈를 줄일 수 있다. --compact 옵션에 대한 설명은 다으과 같다.

The --compact option can be used to compact disk images. Compacting removes blocks that only contains zeroes. Using this option will shrink a dynamically allocated image. It will reduce the physical size of the image without affecting the logical size of the virtual disk. Compaction works both for base images and for differencing images created as part of a snapshot.

자세한 내용은 여기를 참고.

하지만 위의 설명과 같이 --compact 옵션은 VDI 파일에서 빈 블럭(only contains zero)만을 찾아 제거해주는 옵션이다.

리눅스 시스템에서 rm 명령으로 파일을 삭제하더라도 해당 블럭이 실제로 zeroing 되는 것이 아니기 때문에 명령을 실행전 설치된 운영체제나 파일시스템에 맞는 방법으로 비어 있는 블럭을 zeroing 해주어야 한다. (파일 시스템이 extN인 경우 zerofree 명령을 사용하여 zeroing을 한다.

Cleanup your system System (Optional)

불필요한 파일을 삭제 하자. (필요한 경우에만 수행한다.)

Cleanup APT cache

sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*

Cleanup docker cache

도커를 사용 하는 경우 테스트를 위해 여러 이미지를 당겨받아 테스트 하다 보면 꽤많은 용량을 사용하게 된다.

모두 삭제하고

docker system prune -a -f

필요한 이미지만 다시 당겨받자.

docker pull mongo:4

Uninstall snap package.

사용하지 않을 경우 삭제 하자.

sudo apt-get autoremove --purge snapd

Cleanup /var/log

시스템을 오래 사용하였을 경우 꽤 많은 로그가 쌓여 있다. 삭제할경우 동작중인 프로그램에 문제가 생길수도 있으니 빈 파일로 만든다.

for f in $(find /var/log -type f); do
	sudo cat /dev/null > $f;
	echo " Log $f has been cleared";
done

정리를 마쳤으면 시스템을 끈다.

sudo shutdown -h now

Zeroing Free Blocks

zerofree 명령으로 빈 블럭을 zeroing 하기 위해서는 Root Filesystem을 Readonly Mode로 마운팅 해야 하지만 부팅 상태에서는 잘 되지 않는다.

$ sudo mount -o remount,ro /
mount: /: mount point is busy.

여러 방법이 있지만 가장 간단한 Ubuntu 설치 이미지로 부팅한 한 후 zerofree 명령으로 Free Block을 Zeroing 하자.

Ubuntu 18.04.2 Server Live 이미지를 이용하였다. (이미지에 zerofree 명령이 포함되어 있다.)

부팅이 완료된후 다음 과 같은 화면이 나오면

뜨면 ALT+F2 키를 눌러 터미널을 실행 시킨다.

zerofree 명령을 사용하여 빈 블럭을 제로잉 한다.

sudo zerofree /dev/sda2

완료되면 시스템 종료한다.

sudo shutdown -h now

Compact the VDI file.

vboxmanage modifymedium --compact 명령을 이용하여 VDI 이미지 사이즈를 줄인다.

디스크 파일의 위치를 확인하자

vboxmanage showvminfo ubuntu-bionic-server |grep vdi

아래와 같은 결과를 얻을 수 있다.

SATA (0, 0): /home/oneuon/VMs/ubuntu-bionic-server.vdi (UUID: ********-****-****-****-************)

--compact 옵션으로 VDI 파일의 사이즈를 줄인다.

vboxmanage modifymedium "/home/oneuon/VMs/ubuntu-bionic-server.vdi" --compact

Export Virtual Machine

Using export wizard.

Using Command Line Interface

vboxmanage list vms 명령으로 내보낼 가상머신의 이미지를 확인한다.

vboxmanage list vms

vboxmanage export 명령으로 VM 을 내 보낸다.

vboxmanage export $VM_NAME -o $IMG_NAME
  • $VM_NAME 은 내보내고자 하는 가상머신의 이름으로 대체 한다. (예: ubuntu-bionic-server)

  • $IMG_NAME 은 생성될 이미지의 이름으로 대체한다. (예: ubuntu-bionic-server.ova)

vboxmanage export 의 자세한 사용법은 아래 명령을 참고하자

vboxmanage export --help

다음과 같이 생성될 이미지 파일에 메타데이터를 추가 할수도 있다.

vboxmanage export ubuntu-bionic-server \
                  --output ubuntu-bionic-server.ova \
                  --vsys 0 \
                  --product "Ubuntu Clean Image" \
                  --producturl "https://oneuon.com/posts/" \
                  --vendor "oneuon.com" \
                  --vendorurl "https://oneuon.com" \
                  --version "1.0.0" \
                  --description "Ubuntu Bionic Server Clean Installation"

System Level Linux DNS over TLS on Arch Linux

System Level Linux DNS over TLS on Arch Linux

Prerequisite

  • stubby
  • dnsmasq

Installation

stubby

sudo pacmas -S stubby

Start and endable stubby

sudo systemctl enable stubby
sudo systemctl start stubby

Configuration

Open and edit /etc/stubby/stubby.yml

listen_addresses:
  - 127.0.0.1@53000
  - 0::1@53000
upstream_recursive_servers:
  - address_data: 9.9.9.9
    tls_auth_name: "dns.quad9.net"
  - address_data: 9.9.9.10
    tls_auth_name: "dns.quad9.net"
  - address_data: 1.1.1.1
    tls_auth_name: "cloudflare-dns.com"
  - address_data: 1.0.0.1
    tls_auth_name: "cloudflare-dns.com"

dnsmasq

Arch Linux based distribution

sudo pacmas -S dnsmasq

Start and endable stubby

sudo systemctl enable dnsmasq
sudo systemctl start dnsmasq

Configurations

Open and edit /etc/dnsmasq.conf

no-resolv
proxy-dnssec
server=::1#53000
server=127.0.0.1#53000
listen-address=::1,127.0.0.1

Use dnsmasq as default DNS

Common Usages

Open and edit /etc/resolv./conf

nameserver 127.0.0.1

With NetworkManager

[main]
dns=dnsmasq

System Level Linux DNS over TLS on Ubuntu 20.04

System Level Linux DNS over TLS on Ubuntu 20.04

Prerequisite

  • stubby
  • dnsmasq

Installation

stubby

sudo apt install stubby

Start and endable stubby

sudo systemctl enable stubby
sudo systemctl start stubby

Configuration

Open and edit /etc/stubby/stubby.yml

listen_addresses:
  - 127.0.0.1@53000
  - 0::1@53000
upstream_recursive_servers:
  - address_data: 9.9.9.9
    tls_auth_name: "dns.quad9.net"
  - address_data: 9.9.9.10
    tls_auth_name: "dns.quad9.net"
  - address_data: 1.1.1.1
    tls_auth_name: "cloudflare-dns.com"
  - address_data: 1.0.0.1
    tls_auth_name: "cloudflare-dns.com"

dnsmasq

sudo apt install dnsmasq

Start and endable stubby

sudo systemctl enable dnsmasq
sudo systemctl start dnsmasq

Configurations

Open and edit /etc/dnsmasq.conf

no-resolv
proxy-dnssec
server=::1#53000
server=127.0.0.1#53000
listen-address=::1,127.0.0.1

Use dnsmasq as default DNS

Common Usages

/etc/resolv./conf

nameserver 127.0.0.1

With Network Manager

[main]
dns=dnsmasq

systemd-resolv

Arch Linix Installation Guide

Arch Linix Installation Guide

현재 가지고 있는 시스템 위주로 설명한다.

부트 디스크 만들기

ISO 파일을 다운로드 한다. 다운로드 후 필요한 경우 gpg 명령으로 파일을 검증한다.

gpg --keyserver-options auto-key-retrieve --verify archlinux-2020.11.01-x86_64.iso.sig

아래와 같이 Can't check signature: No public key 에러가 발생하면

gpg --keyserver-options auto-key-retrieve --verify archlinux-2020.11.01-x86_64.iso.sig
gpg: assuming signed data in 'archlinux-2020.11.01-x86_64.iso'
gpg: Signature made Sun 01 Nov 2020 03:42:16 PM KST
gpg:                using RSA key 4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
gpg: Can't check signature: No public key

아래와 같이 키서버를 지정해 준다.

gpg --keyserver-options auto-key-retrieve --keyserver=hkp://pool.sks-keyservers.net --verify archlinux-2020.11.01-x86_64.iso.sig

부트 디스크 생성

dd bs=4M if=~/Downloads/archlinux-2020.11.01-x86_64.iso of=/dev/sdb status=progress oflag=sync

부트 디스크로 부팅한다.

Prerequisite

부트 디스크로 부팅 후 쉘이 뜨면 부팅이 완려 된것이다. 설치를 위한 사전 준비 작업을 시작한다.

네트워크 연결 확인

아래 명령으로 네트워크 연결을 확인한다.

ip link 
ping -c 3 google.co.kr 

아래와 같이 ping이 성공 하면 네트워크 연결이 성공한것이다.

ping -c 3 google.co.kr
PING google.co.kr (172.217.161.67) 56(84) bytes of data.
64 bytes from nrt20s09-in-f3.1e100.net (172.217.161.67): icmp_seq=1 ttl=116 time=46.8 ms
64 bytes from nrt20s09-in-f3.1e100.net (172.217.161.67): icmp_seq=2 ttl=116 time=39.2 ms
64 bytes from nrt20s09-in-f3.1e100.net (172.217.161.67): icmp_seq=3 ttl=116 time=39.2 ms

--- google.co.kr ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 39.260/41.786/46.802/3.546 ms

Update system clock (optional)

timedatectl set-ntp true

Bootstrapping

Partition the disk

fdisk -l /dev/nvme0n1
Mount PointPartitionPartition TypeSizeNotes
/mnt/boot/dev/nvme0n1p1EFI system partition512MiB
/mnt/dev/nvme0n1p2Linux filesystem64GB
/mnt/home/dev/nvme0n1p3Linux filesystemRemainder of the device

별도의 SWAP 파티션을 생성하지 않는다. SWAP 파티션이 필요할 경우 swap file을 사용한다.

가용 디스크 용량이 충분하기 때문에 시스템이 설치될 파티션(/)과 /home 파티션을 분리 한다. OS 재설시 /home 파티션을 유지하면서 OS를 설치 할 수 있기 때문에 OS 재설치 시 유리한다.

fdisk, cfdisk, gfdisk 명령 중 원하는 파티셔닝 프로그램으로 파티션을 진행한다.

cfdisk /dev/nvme0n1

Format the partitions

mkfs.vfat -F32 /dev/nvme0n1p1
mkfs.ext4 -j /dev/nvme0n1p2
mkfs.ext4 -j /dev/nvme0n1p3

Mount filesystem

mount /dev/nvme0n1p2 /mnt
mkdir -p /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot
mkdir -o /mnt/home
mount /dev/nvme0n1p3 /mnt/home

Update Mirror List

vi /etc/pacman.d/mirrorlist

아래 라인을 서버리스트 가장 위에 추가한다.

Server = http://mirror.premi.st/archlinux/$repo/os/$arch
Server = http://ftp.lanet.kr/pub/archlinux/$repo/os/$arch
Server = https://ftp.lanet.kr/pub/archlinux/$repo/os/$arch
Server = http://ftp.harukasan.org/archlinux/$repo/os/$arch
Server = https://ftp.harukasan.org/archlinux/$repo/os/$arch

pacstrap

pacstrap /mnt base linux linux-firmware vim networkmanager base-devel man-db man-pages texinfo dosfstools e2fsprogs

Generate /etc/fstab

genfstab -U /mnt >> /mnt/etc/fstab

chrooting

arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime

Generating locales

Edit /etc/locale.gen and uncomment en_US.UTF-8 UTF-8. Generate the locales by running

locake-gen

Create locale.conf

echo "LANG=en_US.UTF-8" >> /etc/locale.conf
echo "LC_ALL=en_US.UTF-8" >> /etc/locale.conf

Network Configuration

Set Hostname

echo Coconut > /etc/hostname 

add to hosts

127.0.0.1	localhost
::1			localhost
127.0.1.1	coconut.localdomain coconut

Enable NetworkManager service

systemctl enable NetworkManager.service

initramfs

mkinitcpio -P
passwd

Create primary user

useradd -m -G users,wheel -s /bin/bash euikook

Set password to euikook

passwd euikook

Enable sudo command to wheel groups

Run visudo command and uncomment %wheel ALL=(ALL:ALL) ALL

%wheel ALL=(ALL:ALL) ALL

Install bootloader (GRUB)

pacman -Syu
pacman -S grub efibootmgt
grub-install --target=x86_64-efi --eif-directory=/boot --bootloader-id=arch --recheck

Edit /etc/default/grub

grub-mkconfig -o /boot/grub/grub.cfg

Finish bootstrapping

Exit from chroot

exit

Un-Mount mounted directories

umount -R /mnt
shutdown -r now

Post bootstrapping

Intel Microcode

sudo pacman -S intel-ucode
grub-mkconfig -o /boot/grub/grub.cfg

GUI 설치

패키지 리스트 업데이트

sudo pacman -Syu

Gnome 설치

sudo pacman -S xorg-server gnome
sudo systemctl enable gdb

그래픽 카드 드라이버 설치

sudo pacman -S xf86-video-intel
sudo pacman -S nvidia xf86-video-intel

기타 어플리케이션 설치

pacman -S firefox
sudo shutdown -r now

Package from AUR

cd ~/Downloads
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -sic

Fonts

 sudo yay -S ttf-nanum

Google Chrome

sydo yay -S google-chrome

한글 입력 설정

sudo pacman -S ibus ibus-hangul

Terminal에서 ibus-setup 을 실행한다.

ibus-setup
  • Input Method에 다른 언어들은 모두 삭제 하고 Korean - Hangul을 추가 한다.
  • Korean - Hangul을 선택한 상태에서 Preferences를 클릭하여 ibus-hangul 설정을 진행한다.
    • 한영 전환 키 등

Settings > Region & Language > Input Sources

Korean(Hangul)을 추가한다.

한/영 전환키가 없는 키보드에서 Right RALT한/영 전환키로 사용하기

몇가지 방법이 있지만 가장 쉬운 방법은 Gnome Tweak 툴에서 다음과 같이 설정한다.

Tweak > Keyboard @ Mouse > Additional Layout Options > Korean Hangul/Hanja Keys > Make right Alt a Hangul key 선택

이유를 확인 해보지는 않았지만 xev 등의 명령으로 확인해보면 RALT 키가 ISO_Level3_shift로 설정 된 경우가 있다. 이 경우 Tweak > Keyboard @ Mouse > Additional Layout Options > Key to choose the 3rd level > Right Alt 선택을 해제한다.

Auto completion for sudo command

~/.bashrc

complate -cf sudo

Logitech Mouse 설정

Install Logiops logiops-git^AUR^

yay -S logiops-git

Create /etc/logid.cfg file as following:

devices: ({
  name: "Logitech Wireless Mouse MX Master 3";

  // A lower threshold number makes the wheel switch to free-spin mode
  // quicker when scrolling fast.
  smartshift: { on: true; threshold: 20; };

  hiresscroll: { hires: true; invert: false; target: false; };

  // Higher numbers make the mouse more sensitive (cursor moves faster),
  // 4000 max for MX Master 3.
  dpi: 3000;

  buttons: (

    // Make thumb button 10.
    { cid: 0xc3; action = { type: "Keypress"; keys: ["BTN_FORWARD"]; }; },

    // Make top button 11.
    { cid: 0xc4; action = { type: "Keypress"; keys: ["BTN_BACK"];    }; }

  );
});

Insync 3.x

Install Insync^AUR^

yay -S insync

재설치 이고 이전 데이터를 모두 가지고 있다면 실행전 이전 머신의 ~/.config/Insync 디렉터리를 복사 하여 덮어 쓰면 이전 설정을 그대로 사용할 수 있음.

rsync -avz -e ssh ${OLDBOX}:/home/${USER}/.config/Insync ~/.config

Autostart with Login

~/.config/autostart/insync.desktop

[Desktop Entry]
Version=1.0
Type=Application
Name=Insync
GenericName=Insync
Comment=Launch Insync
Icon=insync
Categories=Network;
Exec=insync start
TryExec=insync
Terminal=false
X-GNOME-Autostart-Delay=15

Tray Icons^Extention^ 확장을 사용한다면 X-GNOME-Autostart-Delay=15 옵션을 주어야 한다.

git fetch all branches and push it to another remote

Fix GPG Error on Ubuntu

$ sudo apt update
...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.gitlab.com/runner/gitlab-runner/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
W: Failed to fetch https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu/dists/bionic/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
W: Failed to fetch https://packages.gitlab.com/runner/gitlab-runner/ubuntu/dists/bionic/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
W: Some index files failed to download. They have been ignored, or old ones used instead.
euikook@argentum:/etc/apt/sources.list.d$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3F01618A51312F3F
Executing: /tmp/apt-key-gpghome.SpBMyBEzT0/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 3F01618A51312F3F

Import GPG key from key server

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3F01618A51312F3F
Executing: /tmp/apt-key-gpghome.SpBMyBEzT0/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 3F01618A51312F3F
gpg: key 3F01618A51312F3F: public key "GitLab B.V. (package repository signing key) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
$ sudo apt update
Hit:3 https://download.docker.com/linux/ubuntu bionic InRelease                                                                                                                                                                   
Hit:5 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease                                                                            
Hit:6 http://archive.ubuntu.com/ubuntu bionic InRelease                                                                                
Hit:1 http://mirror.kakao.com/ubuntu bionic InRelease                                                                                  
Get:2 http://mirror.kakao.com/ubuntu bionic-security InRelease [88.7 kB]        
Get:4 http://mirror.kakao.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                                             
Get:7 https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu bionic InRelease [23.3 kB]                                                               
Get:8 https://packages.gitlab.com/runner/gitlab-runner/ubuntu bionic InRelease [23.4 kB]

Python3 ad default python interpreter on ubuntu

Python 기본 인터프리터 설정 하기

sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10

sudo update-alternatives --config pip
sudo update-alternatives --config python

아래와 같이 직접 --set 옵션을 사용하여 설정 한다.

sudo update-alternatives --set python /usr/bin/python3
sudo update-alternatives --set pip /usr/bin/pip3