Linuxマシンの環境構築の自分用メモ(Ubuntu 20.04.3 LTS)
環境
- Ubuntu 20.04.3 LTS
- 日本語Remixではない
- VMware Workstation 16 Player
日本語入力
1 2 3 4 | sudo apt install ibus-mozc ibus restart gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'jp'), ('ibus', 'mozc-jp')]" |
日付と時刻の設定
忘れずにタイムゾーンを Japan, Tokyo にしておく
(忘れると後々面倒なため)
Google Chrome
.deb形式でインストール
curl
1 | sudo apt install curl |
bash
1 2 3 4 | ######## ~/.bashrc######## HISTSIZE=20000 HISTFILESIZE=20000 alias be= 'bundle exec' |
1 | source ~/.bashrc |
vim
1 | sudo apt install vim |
1 2 3 4 5 | ######## ~/.vimrc ######## filetype plugin indent on : set tabstop=2 : set shiftwidth=2 : set expandtab |
git
1 2 3 4 5 | sudo apt install git sudo apt install tig git config --global user.email "yuinore@hotmail.co.jp" git config --global user.name "yuinore" git config --global core.editor "$(which vim)" |
ssh
1 2 | mkdir ~/. ssh vim ~/. ssh /config |
1 2 3 4 5 | ######## ~/.ssh/config ######## Host http: //github .com HostName http: //github .com User git IdentityFile "/home/YOUR_USERNAME/.ssh/id_rsa" |
秘密鍵 ~/.ssh/id_rsa (と公開鍵 ~/.ssh/id_rsa.pub )を用意する。なければ新規作成。
1 | chmod 700 ~/. ssh /id_rsa |
rails
1 2 3 4 5 6 7 8 9 10 11 12 | git clone https: //github .com /rbenv/rbenv .git ~/.rbenv echo 'export PATH="~/.rbenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(rbenv init -)"' >> ~/.bashrc source ~/.bashrc rbenv - v git clone https: //github .com /rbenv/ruby-build .git "$(rbenv root)" /plugins/ruby-build sudo apt install -y build-essential libssl-dev zlib1g-dev rbenv install --list rbenv install 3.1.0 rbenv global 3.1.0 ruby - v |
1 2 3 | gem update gem install bundler bundle - v |
RMagick
1 | sudo apt install libmagickcore-dev |
mysql
1 2 3 4 | sudo apt install -y libmysqlclient-dev sudo apt install mysql-server sudo mysql_secure_installation # ←ローカル開発環境では不要らしい? sudo vim /etc/mysql/my .cnf |
1 2 3 | ######## /etc/mysql/my.cnf ######## [mysqld] skip-grant-tables |
1 2 | sudo systemctl restart mysql # ←あってるよね? mysql -u root # 確認 |
※for ruby 2.6.6
1 2 | sudo apt install -y libreadline-dev rbenv install 2.6.6 |
(この後プロジェクトディレクトリで gem install bundler:2.1.2
もした(なにこれ???))
(別のプロジェクトでは be rails assets:precompile
もした(なにこれ????))
node
1 2 3 4 5 | git clone https: //github .com /nodenv/nodenv .git ~/.nodenv echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(nodenv init -)"' >> ~/.bashrc source ~/.bashrc nodenv - v |
1 2 3 4 5 6 7 8 9 | git clone https: //github .com /nodenv/node-build .git $(nodenv root) /plugins/node-build git clone https: //github .com /pine/nodenv-yarn-install .git "$(nodenv root)/plugins/nodenv-yarn-install" nodenv install --list nodenv install 16.14.0 nodenv global 16.14.0 curl -fsSL https: //github .com /nodenv/nodenv-installer/raw/master/bin/nodenv-doctor | bash nodenv versions nodenv version yarn - v |
1 2 3 | # ※アップデート?? yarn install --check-files (なにこれ?????) yarn upgrade --latest (なにこれ?????) |
java
1 2 | sudo apt install openjdk-17-jdk java --version |
2022/5/7追記:
pyonpyon
1 2 3 4 5 6 7 8 9 | cd ~ /projects/ git clone https: //github .com /sgymtic/sl .git pyonpyon cd pyonpyon/ git checkout pyonpyon make . /pyonpyon # 確認 sudo cp pyonpyon /usr/local/bin echo 'alias sl="pyonpyon"' >> ~/.bashrc source ~/.bashrc |
Python3 (使わないけど一応)
1 2 | python3 --version # デフォルトでインストールされているはずなので確認 sudo apt install python3-pip |