自分用メモ。
Ubuntuにプログラミング開発環境を構築するときにインストールするものリスト。
わりと順不同。
環境
- Ubuntu Desktop 20.04.3 LTS
OS
Ubuntuインストール
- Ubuntu Desktop 20.04.3 LTS
- OS言語はEnglish
日本語入力
CapsLockキーをCtrlキーに変更
コンソールでもGUIでも有効にするために、/etc/default/keyboardの変更も、gnome-tweaksの設定もすべて行う。
(/etc/default/keyboardだけではなぜかGUIで有効になりませんでした)
どこでもEmacsキーバインド
gnome-tweaksでKeyboard&MouseのEmacs InputをONにする。
net-tools
ifconfigを実行するのに必要。
$ sudo apt install net-tools
ソフトウェア(非開発)
Chrome
SSHサーバー
$ sudo apt install openssh-server
fish shell
ただし、nvmなど一部アプリがfish非対応なので、ログインシェルはデフォルトのbashのままにする。
tmuxの作業用ペインでは必要に応じてfishを起動するようにする。
それでもfish shellをデフォルトのシェルに設定したい場合
以下のコマンドを実行した後に再ログインする。
$ cat /etc/shells | grep fish
/usr/bin/fish
$ chsh -s /usr/bin/fish
Powerline Font
$ git clone https://github.com/powerline/fonts.git
$ cd fonts
$ ./install.sh
fisher
$ curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
oh-my-fish
$ curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
###theme-bobthefish
$ omf install bobthefish
curl
$ sudo apt install curl
Git
$ sudo apt install git
.gitconfig
pullしたときに自動でrebaseされないようにする。
$ git config --global pull.rebase false
Python3
$ sudo apt install python3 python3-venv python3-pip
Node.js
まずnvmをインストールしてから、nvmを使って最新のLTS版をインストールする。
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
$ nvm install --lts
$ node --version
v16.13.1
Go
tar.gzファイルをダウンロードして /usr/local 以下に展開し、/usr/local/go/binにパスを通す。
ghq
$ go install github.com/x-motemen/ghq@latest
fzf
$ git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
$ ~/.fzf/install
ghqでクローンしたリポジトリを検索して移動するgコマンドを作成
config.fishに以下の内容を追記する。
function ghq_fzf_repo -d 'Repository search'
ghq list --full-path | fzf --reverse --height=100% | read select
[ -n "$select" ]; and cd "$select"
echo " $select "
commandline -f repaint
end
alias g='ghq_fzf_repo'
ソフトウェア(開発)
tmux
$ sudo apt install tmux
prefixキーを変更したい場合
例えばC-bからC-qに変更するには.tmux.confを以下のように編集する
set -g prefix C-q
unbind C-b
Vim
クリップボード連携をしたいのでvim-gtkをインストールする。
$ sudo apt install vim-gtk
クリップボード連携の設定を追加する。
set clipboard=unnamedplus
Visual Studio Code
JetBrains Toolbox
$ curl -fsSL https://raw.githubusercontent.com/nagygergo/jetbrains-toolbox-install/master/jetbrains-toolbox.sh | bash
...
Installing to /opt/jetbrains-toolbox
Done.
$ jetbrains-toolbox
PyCharm
JetBrains Toolboxからインストールする。
Docker
$ sudo apt-get update
$ sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
自分のユーザーでsudoを使わずにdockerコマンドを実行できるようにする
以下のコマンドでdockerグループに所属させてからOSを再起動する。
$ sudo usermod -a -G docker <自分のユーザー名>
Docker-Compose
$ sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
Unity
Unity Hub
ダウンロードしたtar.gzファイルを展開してINSTALL.shを実行するとアプリケーションがインストールされる。
Unity Editor
Unity Hubを実行すると自然とUnity Editorインストールする流れになるのでしたがう。
.NET 6
スクリプトからインストールして、~/.dotnetにパスを通す。
$ curl -L https://dot.net/v1/dotnet-install.sh | bash -s -- -c 6.0
Wireshark