Environment Setup on Linux#
1. Gitのインストール#
Open a terminal and run the following command.
git --versionIf you get an error such as
command not found, install it using your OS’s standard package manager.For Debian-based OSes (such as Ubuntu)
sudo apt update sudo apt upgrade -y sudo apt install git
For Red Hat-based OSes (such as Fedora)
sudo yum install git
sudo dnf install git
Enter the following command. If the version is displayed, the installation was successful. (If it does not appear, restart the terminal.)
git --version
2. Pythonのインストール#
Open a terminal and run the following command. Also make sure the version is 3.13 or later.
python --versionIf you get an error such as
command not foundor the version is too low, install Python using pyenv, a Python version management tool.Warning
The installation instructions may not always be up to date, so refer to pyenv/pyenv.
Run the following command.
curl https://pyenv.run | bash
Next, run the following command to check which shell you are using.
echo $SHELL
Run the commands according to the shell that is displayed.
If
bashis displayed, run the following commands.echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc echo 'eval "$(pyenv init -)"' >> ~/.bashrc echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
If
zshis displayed, run the following commands.echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc echo 'eval "$(pyenv init -)"' >> ~/.zshrc
If
fishis displayed, run the following commands.set -Ux PYENV_ROOT $HOME/.pyenv fish_add_path $PYENV_ROOT/bin pyenv init - | source
Installing Required Packages
For Debian-based OSes (such as Ubuntu)
sudo apt update sudo apt upgrade -y sudo apt install make libssl-dev build-essential zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
For Red Hat-based OSes (such as Fedora)
sudo yum install gcc bzip2 bzip2-devel openssl openssl-devel readline readline-devel sqlite-devel tk-devel
sudo dnf install gcc bzip2 bzip2-devel openssl openssl-devel readline readline-devel sqlite-devel tk-devel
Installing python3.13
exec "$SHELL" pyenv install 3.13 pyenv global 3.13
Enter the following command. If the version is displayed, the installation was successful. (If it does not appear, restart the terminal.)
python --version
3. OpenJDKのインストール#
Open a terminal and run the following command. Also make sure the version is 21.
java --versionIf you get an error such as
command not foundor the version is different, install it using your OS’s standard package manager.For Debian-based OSes (such as Ubuntu)
sudo apt update sudo apt upgrade -y sudo apt install openjdk-21-jdk
For Red Hat-based OSes (such as Fedora)
sudo yum install java-21-openjdk-devel
sudo dnf install java-21-openjdk-devel
Enter the following command. If the version is displayed, the installation was successful. (If it does not appear, restart the terminal.)
java --version sudo apt update sudo apt upgrade -y sudo apt install openjdk-21-jdk ``` - Red HatベースのOSの場合(Fedoraなど) ```bash sudo yum install java-21-openjdk-devel ``` ```bash sudo dnf install java-21-openjdk-devel ```
Enter the following command. If the version is displayed, the installation was successful. (If it does not appear, restart the terminal.)
java --version