0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

WSLでUbuntu22.04を入れたら最初にすること

Last updated at Posted at 2023-06-16

はじめに

1年ほど使用していたUbuntu20.04の環境がカオスになってきたので、リセットついでにUbuntu22.04に移行した。そのときに行った各種セットアップの内容をまとめる。

やったこと

  • Python 3.9.16 のインストール
  • Git の初期設定
  • nvm のインストール
  • aws cli のインストール
  • serverless framework のインストール
  • terraform のインストール(2023/06/21 追記)

解説

実際のセットアップ手順をまとめていく。

Python 3.9.16 のインストール

Ubuntu 22.04 はデフォルトで 3.10.6 がインストールされている。しかし、このPythonはOS側でも使用するアプリケーションのため、迂闊にバージョンを上げたりパッケージをいじったりするのは少々危険。そのため、別途/usr配下にPythonをインストールする。
こちらのサイトを参考にインストールを行った。

ちなみに、3.9.16 を選んだ理由は使い慣れていたことと、Lambdaで使用したかったから。深い理由はない

Git の初期設定

Gitの設定は以下のサイトを参考に行った。
プロキシと認証情報のキャッシュ以外は設定した。

プロンプトにブランチ名を表示させたかったので、以下の記事を参考に設定を行った。

設定すると、git配下のページに移動したときに現在のbranchが表示されるようになる。

image.png

nvm のインストール

node.jsを使用するなら必須級のアイテム。
導入後、最新の安定化バージョンをインストールした。

$ nvm install --lts
$ node -v
v18.16.0
$ npm -v
9.5.1

aws cli のインストール

毎度おなじみ公式ページ。
ただし、デフォルトだとunzipが入っていないので、apt installで入れている。

serverless framework のインストール

lambdaにデプロイする際に使用するのでインストールする。

npm install -g serverless

terraform のインストール(2023/06/21 追記)

こちらの公式サイトを参考にインストールしていく

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
--fingerprint
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update
sudo apt-get install terraform

まとめ

今回ディストリビューションをリセットしたときの手順を備忘録としてまとめた。
今までディストリビューションをリセットするたびにやり方を1から調べ直していたので、今後はだいぶ楽できる…はず。
現在はコンテナ上での開発が普及してきたので、ディストリビューション上での開発が行われること少ないかもしれない。しかし、ディストリビューションなどのローカル開発環境はコンテナにはない安心感がある。どちらが優れているとかはないので、双方いい感じの距離感を見つけて今後も付き合っていきたい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?