Created
July 6, 2024 06:06
-
-
Save ueponx/c7ae1b8af8210a3bdc6193e5a7942c9a to your computer and use it in GitHub Desktop.
Ubuntu22.04LTSにVisualStudioCodeをインストールする
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# エラーが発生したらスクリプトを終了 | |
set -e | |
# 必要なパッケージをインストール | |
sudo apt-get install wget gpg -y | |
# MicrosoftのGPGキーを取得して設定 | |
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg | |
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg | |
# VS Codeのリポジトリを追加 | |
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null | |
# 取得したGPGキーを削除 | |
rm -f packages.microsoft.gpg | |
# apt-transport-httpsをインストール | |
sudo apt install apt-transport-https -y | |
# パッケージリストを更新 | |
sudo apt update | |
# Visual Studio Codeをインストール | |
sudo apt install code -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
実行時にはシェルスクリプトに実行権限を与えてください