Notes
Please note that this guide is recommended to be used together with the previous Part 2.
Last updated: 2025-11-06
General Development
Clang
Ubuntu
Install Clang with the following command:
sudo apt install clang
Fedora
Install Clang with the following command:
sudo dnf install clang
VS Code
Ubuntu
Installing with the VS Code Package
Go to:
https://code.visualstudio.com/Download
Download the .deb package.
Then run:
sudo apt install ./<file>.deb
# If you're on an older Linux distribution, you will need to run this instead:
# sudo dpkg -i <file>.deb
# sudo apt-get install -f # Install dependencies
Manually Adding the APT Repository to Install VS Code
# Install the required tools and add the signing key
sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -D -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/microsoft.gpg
rm -f microsoft.gpg
Create a file at the following path:
/etc/apt/sources.list.d/vscode.sources
Add the following content:
Types: deb
URIs: https://packages.microsoft.com/repos/code
Suites: stable
Components: main
Architectures: amd64,arm64,armhf
Signed-By: /usr/share/keyrings/microsoft.gpg
Finally, run the following commands to complete the installation:
sudo apt install apt-transport-https
sudo apt update
sudo apt install code
# or code-insiders
Fedora
Installing with the .rpm Package
Notice:
When using this method, VS Code will not be updated automatically.
Go to:
https://code.visualstudio.com/Download
Download the .rpm package.
Then run:
# file is the name of the downloaded file
sudo dnf install <file>.rpm
Manual Installation (Recommended)
Notice:
Because Microsoft uses manual signing and a specific release process, updates to the YUM repository may occasionally be delayed by up to three hours.
This means that a newly released version of VS Code may not appear in the repository immediately.
Import the signing key and configure the DNF repository:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
Update the package cache and install VS Code:
dnf check-update
sudo dnf install code
# or code-insiders
If you are using YUM, use the following commands instead to update the package cache and install VS Code:
yum check-update
sudo yum install code
# or code-insiders
pyenv
First, install the required dependencies:
sudo dnf install make gcc patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk8-devel libffi-devel xz-devel libuuid-devel gdbm-libs libnsl2
Then install pyenv automatically with:
curl -fsSL https://pyenv.run | bash
The following configuration must be performed for each user.
P.S. This can be automated, but I was too lazy to write a script and was also concerned about possible permission issues.
2025-10-09: Fine, I ended up writing one anyway. It is basically based on someone else’s work and modified for my needs.
Bash
The following procedure installs and configures pyenv for a single user.
Run the following commands to add the required configuration to ~/.bashrc:
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc
If any of the following files exist on the system:
~/.profile
~/.bash_profile
~/.bash_login
add the same three lines to those files as well.
If none of them exist, create a new ~/.profile.
# ~/.profile
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
echo 'eval "$(pyenv init - bash)"' >> ~/.profile
# ~/.bash_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)"' >> ~/.bash_profile
Finally, apply the configuration with:
exec "$SHELL"
Zsh
The following procedure installs and configures pyenv for a single user.
Run the following commands to add the required configuration to ~/.zshrc:
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
Finally, apply the configuration with:
exec "$SHELL"
Installation for All Users (System-wide Installation)
There are two approaches here.
One is a more brute-force approach, while the other uses a shared environment.
Strictly speaking, the shared environment approach can cause problems when you start using virtualenv. Normal Python usage works fine, but overall this method is not recommended.
Installation for All Users (Automatically Installing a Separate pyenv for Each User)
This is the brute-force approach mentioned earlier.
The idea is simply to prepare a pyenv installation that will be copied automatically to every newly created user.
Remember: follow the steps below in order, otherwise problems may occur.
Remember: follow the steps below in order, otherwise problems may occur.
Remember: follow the steps below in order, otherwise problems may occur.
First, install the required dependencies:
sudo dnf install make gcc patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk8-devel libffi-devel xz-devel libuuid-devel gdbm-libs libnsl2
Then perform a normal pyenv installation:
curl -fsSL https://pyenv.run | bash
This installs pyenv into:
~/.pyenv
Check this directory first and confirm whether a shim directory exists.
If it does not exist, that is ideal for the following steps.
Now copy the directory into /etc/skel/:
sudo cp -r .pyenv/ /etc/skel/
Check the contents:
cd /etc/skel
ls -la
Make sure .pyenv exists.
Now, while inside /etc/skel, add the following content to .zshrc.
This file will be used as a template for newly created users.
cd /etc/skel
sudo nano .zshrc
# Add the following content
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - zsh)"
Save the file and exit.
After that, configure the environment variables for your current user as well:
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
This adds the required variables to your own shell configuration.
Restart your shell and run:
pyenv --version
The installed version should be displayed.
Newly created users should now also receive their own pyenv installation by default.
Installation complete.
Installation for All Users (Using One Shared Environment)
This method is strongly discouraged unless you do not plan to use virtualenv.
This method is strongly discouraged unless you do not plan to use virtualenv.
This method is strongly discouraged unless you do not plan to use virtualenv.
This method installs pyenv for all newly created users. Existing users require additional configuration.
First, install the required dependencies:
sudo dnf install make gcc patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk8-devel libffi-devel xz-devel libuuid-devel gdbm-libs libnsl2
Then install pyenv using the following command.
This command uses a modified version of pyenv’s pyenv-installer. I have uploaded the modified version to GitHub, so it can be downloaded directly with curl.
I changed several things, including the installation path. See the following repository for details:
https://github.com/JoeYang1412/pyenv-installer-systemwide/tree/global-install
Install it with:
curl -L https://raw.githubusercontent.com/JoeYang1412/pyenv-installer-systemwide/refs/heads/global-install/bin/pyenv-installer | sudo bash
Next, configure the permissions.
Because pyenv is installed in a system directory, permission issues may occur.
Therefore, configure the directory so that only members of a designated group can modify it, and configure the required permissions for newly created files.
Use the following commands:
It is better to configure the permissions now to avoid encountering permission problems later.
# Create a new group named pyenv_group
sudo groupadd pyenv_group
# Add an existing user to the specified group
sudo usermod -aG <group_name> <username>
# Create a new user and add them to the specified group at the same time
# sudo useradd -m -G <group_name> <username>
# Apply the group immediately
newgrp pyenv_group
# Create ACL rules
sudo setfacl -R -m g:pyenv_group:rwx /usr/local/share/pyenv
sudo setfacl -R -m d:g:pyenv_group:rwx /usr/local/share/pyenv
Next, configure newly created users to be added to this group automatically:
sudo nano /etc/default/useradd
# Find the following option in the existing file and modify it.
# Do not change the other settings.
GROUPS=pyenv_group
If an existing user wants to use the system-wide installation, add the following configuration to .zshrc:
echo 'export PYENV_ROOT="/usr/local/share/pyenv"' >> ~/.zshrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
Finally, run:
exec $SHELL
Then restart the terminal and pyenv should be ready to use.
Next, configure pyenv as the default for newly created users.
The installer above places pyenv under:
/usr/local/share/pyenv
After installation, go to:
/etc/skel/
Create a .zshrc file and add the following variables:
export PYENV_ROOT="/usr/local/share/pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - zsh)"
Newly created users will then be able to use pyenv directly.