Environment Setup on Linux

1. Gitのインストール

  1. Open the terminal and run the following command.

    git --version
    
  2. If you get an error like command not found, use the OS’s standard package manager to install.

    • For Debian-based OS (e.g., Ubuntu)

      sudo apt update
      sudo apt upgrade -y
      sudo apt install git
      
    • For Red Hat-based OS (e.g., Fedora)

      sudo yum install git
      
      sudo dnf install git
      
  3. Enter the following command, and if the version is displayed, it is successful. (If not displayed, restart the terminal.)

    git --version
    

2. Pythonのインストール

  1. Open the terminal and run the following command. Also, make sure the version is 3.12 or higher.

    python --version
    
  2. If you get an error like command not found or the version is low, use the Python version management tool pyenv to install.

    Warning

    The installation method may not be up to date, so please refer to https://github.com/pyenv/pyenv.

    1. Run the following command.

      curl https://pyenv.run | bash
      
    2. Next, run the following command to check the shell you are using.

      echo $SHELL
      
    3. Follow the commands according to the displayed shell.

      If bash is displayed, run the following command.

      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 zsh is displayed, run the following command.

      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 fish is displayed, run the following command.

      set -Ux PYENV_ROOT $HOME/.pyenv
      fish_add_path $PYENV_ROOT/bin
      pyenv init - | source
      
    4. Installing necessary packages

      • For Debian-based OS (e.g., 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 OS (e.g., 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
        
    5. Installing python3.12

      exec "$SHELL"
      pyenv install 3.12
      pyenv global 3.12
      
  3. Enter the following command, and if the version is displayed, it is successful. (If not displayed, restart the terminal.)

    python --version
    

3. OpenJDKのインストール

  1. Open the terminal and run the following command. Also, make sure the version is 17.

    java --version
    
  2. If you get an error like command not found or the version is different, use the OS’s standard package manager to install.

    • For Debian-based OS (e.g., Ubuntu)

      sudo apt update
      sudo apt upgrade -y
      sudo apt install openjdk-17-jdk
      
    • For Red Hat-based OS (e.g., Fedora)

      sudo yum install java-17-openjdk-devel
      
      sudo dnf install java-17-openjdk-devel
      
  3. Enter the following command, and if the version is displayed, it is successful. (If not displayed, restart the terminal.)

    java --version