Linux Mint 22 is a well-known operating system celebrated for its user-friendly interface and reliable performance. This guide provides a step-by-step overview of the essential configurations and software installations needed to set up a development and productivity environment after installing Linux Mint 22.
Contents:
- Basic Environment Settings:
- Configuring and customizing the vi editor for development tasks.
- NVIDIA Driver Installation:
- Installing NVIDIA graphics drivers on Linux Mint to prepare for GPU-accelerated workflows like CUDA.
- Chrome Installation:
- Installing the Chrome web browser using the apt repository for easy future upgrades.
- Docker and Docker Compose Installation:
- Installing Docker for containerized application development and management.
- Setting up Docker Compose to manage multi-container applications.
- NVIDIA Docker Installation:
- Installing NVIDIA Docker to facilitate machine learning systems utilizing GPU.
- Visual Studio Code Installation:
- Installing the popular code editor VS Code and configuring plugins for programming and project management.
- Miniconda Installation:
- Setting up a Python development and execution environment on localhost.
- VirtualBox Installation:
- Installing VirtualBox on Linux Mint 22 to work in various environments using virtual machines.
* Basic Environment Settings
* Install additional essential libraries:
user:~$ sudo apt install -y apt-transport-https git openssh-server software-properties-common ca-certificates curl wget gnupg2 vim git
* Configure the vi editor for all users by editing /etc/vim/vimrc:
# change to root
user:~$ sudo su -
# vi setting
root:~$ cat > /etc/vim/vimrc << EOF
set number
set tabstop=4
set shiftwidth=4
set showmatch
set title
set hlsearch
set fileencodings=utf-8,euc-kr
set ruler
set title
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F
set laststatus=2
syntax on
EOF
* NVIDIA Driver Installation
* Check the list of available drivers and install the necessary version:
# Check driver list
user:~$ ubuntu-drivers devices
# Install driver
user:~$ sudo apt install -y nvidia-driver-550-server
* Chrome Installation
1. Download and save the public key.
user:~$ wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmour -o /usr/share/keyrings/google_linux_signing_key.gpg
2. Register the repository and update the package list.
# Register the repository information in the /etc/apt/source.list.d directory
user:~$ sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google_linux_signing_key.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
# Update list
user:~$ sudo apt update
3. Install Chrome.
user:~$ sudo apt install -y google-chrome-stable
* Docker Installation
1. Download and save the public key.
user:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
2. Register the repository and update the package list.
# Register the repository information in the /etc/apt/source.list.d directory
user:~$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update list
user:~$ sudo apt update
3. Install Docker and Docker Compose.
user:~$ sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
4. Add the current user to the Docker group to execute Docker commands.
user:~$ sudo usermod -aG docker $USER
* NVIDIA Docker Installation
1. Download and save the public key.
user:~$ curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
2. Register the repository and update the package list.
# Register the repository information in the /etc/apt/source.list.d directory
user:~$ distribution=ubuntu22.04 \
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
# update list
user:~$ sudo apt update
3. Install the NVIDIA Container Toolkit package.
# Install nvidia container toolkit package
user:~$ sudo apt-get install -y nvidia-container-toolkit
4. Configure the container runtime.
# Configure the container runtime
user:~$ sudo nvidia-ctk runtime configure --runtime=docker
user:~$ sudo systemctl restart docker
# Configure the container runtime "containerd"
user:~$ sudo nvidia-ctk runtime configure --runtime=containerd
user:~$ sudo systemctl restart containerd
5. Modify Docker’s runtime to NVIDIA. If you want to store Docker and containers in a different volume due to space constraints, add the “data-root” setting. This allows you to change Docker’s default path from “/var/lib/docker” to another location.
# Change runtime
user:~$ sudo vi /etc/docker/daemon.json
{
"default-runtime": "nvidia",
"data-root": "/path/to/location",
"runtimes": {
"nvidia": {
"args": [],
"path": "nvidia-container-runtime"
}
}
}
# Restart docker
user:~$ sudo systemctl daemon-reload
user:~$ sudo service docker restart
# Check docker root path
user:~$ docker info | grep Root
* Installing Visual Studio Code
1. Download and save the public key.
user:~$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
user:~$ sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
2. Register the repository and update the package list.
# Register the repository information in the /etc/apt/source.list.d directory
user:~$ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
# Update list
user:~$ sudo apt update
3. Installing Visual Studio Code.
user:~$ sudo apt install -y code
* Installing Miniconda
1. Download the installer and grant it execution permissions.
# Download
user:~$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
# Add execution permission
user:~$ chmod +x Miniconda3-latest-Linux-x86_64.sh
2. Run the installer, agree to the license, and specify the installation path to proceed with the installation. At the end of the installation, when asked whether to initialize Conda in the shell, answering “yes” will make it more convenient to use later.
# Run for install
user:~$ ./Miniconda3-latest-Linux-x86_64.sh
# The last question
You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> yes <-- recommend
3. If you selected “yes” for Conda initialization, Conda will automatically activate upon opening a new shell, which can be inconvenient. To disable auto-activation and activate it manually when needed, use the following steps.
# Reconnect shell
user:~$ exit # try logout and login
# Auto active off
(base) user:~$ conda config --set auto_activate_base false
(base) user:~$ exit # try logout and login
# Control conda env
user:~$ conda env list # Listing envs
user:~$ conda activate base # Activating conda env
(base) user:~$ conda deactivate # Deactivating conda env
user:~$
* Installing VirtualBox
If you register the VirtualBox repository and install version 7.1 using the method below, an error may occur when running VirtualBox after taking a snapshot. Therefore, the recommended approach is to avoid this method and instead install VirtualBox 7.0 from the default Linux Mint 22 repository. (This recommendation is based on the current writing. The issue may be resolved in future updates, so the content is left as is.)
user:~$ sudo apt install -y virtualbox virtualbox-dkms virtualbox-ext-pack virtualbox-guest-additions-iso
1. Download and save the public key.
user:~$ wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor
2. Register the repository and update the package list.
# Register the repository information in the /etc/apt/source.list.d directory
user:~$ echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian noble contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
# Update list
user:~$ sudo apt update
3. Installing VirtualBox 7.x Version.
user:~$ sudo apt install virtualbox-7.1