Environment Setup on Linux#

1. Gitのインストール#

  1. Open a terminal and run the following command.

    git --version
    
  2. If 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
      
  3. 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のインストール#

  1. Open a terminal and run the following command. Also make sure the version is 3.13 or later.

    python --version
    
  2. If you get an error such as command not found or 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.

    1. Run the following command.

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

      echo $SHELL
      
    3. Run the commands according to the shell that is displayed.

      If bash is 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 zsh is 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 fish is displayed, run the following commands.

      set -Ux PYENV_ROOT $HOME/.pyenv
      fish_add_path $PYENV_ROOT/bin
      pyenv init - | source
      
    4. 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
        
    5. Installing python3.13

      exec "$SHELL"
      pyenv install 3.13
      pyenv global 3.13
      
  3. 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のインストール#

  1. Open a terminal and run the following command. Also make sure the version is 21.

    java --version
    
  2. If you get an error such as command not found or 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
      
  3. 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
         ```
    
  4. Enter the following command. If the version is displayed, the installation was successful. (If it does not appear, restart the terminal.)

    java --version