This guide walks you through setting up a Debian-based personal PC with various system configurations and applications. It covers everything from configuring vi to enabling hibernate, setting DNS resolvers, preserving your Bash history, and installing useful applications.
- Enable INSERT in vi
- Configure Sudo Access
- System Update
- Disable IPv6
- Setup SSH Keys
- Enable Hibernate
- Install Applications
- Additional Configuration
- Clean Up
To improve your vi experience, switch to the root user and install vim-gui-common which provides better support for input modes.
su
sudo apt-get install vim-gui-common -yAdd your user to the sudoers file to allow administrative commands without switching users. Open /etc/sudoers with your favorite editor (using visudo is recommended) and add:
my_username ALL=(ALL:ALL) ALL
Note: Replace
my_usernamewith your actual username.
Update the package lists and upgrade installed packages:
sudo apt update -y && sudo apt full-upgrade -yInstructions for disabling IPv6 are not detailed here. Please consult your system documentation or online resources for the correct steps.
If you need to manage SSH keys:
-
Edit or create your private key (if necessary):
vi ~/.ssh/id_rsa -
Set the correct permissions:
chmod 600 ~/.ssh/id_rsa -
Generate the public key from your private key:
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
To enable hibernate functionality on your system, follow these steps:
Set the swappiness to a low value (1) to favor hibernation over swap usage:
sudo sysctl -w vm.swappiness=1To make this change permanent, edit (or create) the local sysctl configuration file:
sudo vi /etc/sysctl.d/local.confAdd the following line:
vm.swappiness=1
Create a 15G swapfile, set the appropriate permissions, and initialize it:
sudo fallocate -l 15G /swapfile
sudo chmod 600 /swapfile
mkswap /swapfile
sudo swapon /swapfileMake the swapfile persistent by adding it to /etc/fstab:
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabYou will need to determine your system’s root UUID and the swapfile offset:
-
Find the UUID:
findmnt / -o UUID -n
-
Find the swapfile offset:
sudo filefrag -v /swapfile | awk 'NR==4{gsub(/\./,""); print $4;}'
With your UUID and swapfile offset in hand, update the bootloader and initramfs configurations:
-
Update GRUB:
Edit
/etc/default/grub:sudo vi /etc/default/grub
Append or modify the
GRUB_CMDLINE_LINUX_DEFAULTline to include the resume parameters (replace the example UUID and offset with your actual values):GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=178f7336-5875-40bc-be93-58dca79a49dc resume_offset=58673152" -
Configure initramfs resume settings:
Edit (or create) the resume configuration file:
sudo vi /etc/initramfs-tools/conf.d/resume
Add the following line (replace the example UUID with your actual UUID):
RESUME=UUID=178f7336-5875-40bc-be93-58dca79a49dc
Apply the changes by updating GRUB and the initramfs:
sudo update-grub
sudo update-initramfs -k all -uTest the hibernate function with:
systemctl hibernateNote: Replace the example UUID (
178f7336-5875-40bc-be93-58dca79a49dc) and offset (58673152) with the values obtained from your system.
Add the Sublime Text repository and install the editor:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg > /dev/null
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update -y && sudo apt install sublime-text -yInstall PHP without extra recommended packages:
sudo apt install php --no-install-recommends -yInstall a collection of useful tools and applications:
sudo apt install curl vlc gimp ffmpeg nodejs npm apt-transport-https filezilla python3-pip python3-venv -yInstall the Heroku Command Line Interface:
curl https://cli-assets.heroku.com/install-ubuntu.sh | shFollow these steps to install Visual Studio Code:
-
Install prerequisites:
sudo apt-get install wget gpg -y
-
Add Microsoft's GPG key:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
-
Add the VSCode repository:
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
-
Clean up the temporary key file:
rm -f packages.microsoft.gpg
-
Update and install VSCode:
sudo apt update -y && sudo apt install code -y
For additional software, refer to the following resources or their official installation guides:
- 1Password: Install 1Password for Linux
- Docker
- Studio 3T
- Android Studio
Note: Installation steps for Docker, Studio 3T, and Android Studio are not included here. Please consult their official documentation for setup instructions.
This section covers extra configuration steps for setting DNS resolvers and preserving your Bash history.
Reset your DNS configuration and add preferred nameservers:
sed -i '/nameserver/d' /etc/resolv.conf
echo "nameserver 1.1.1.1" | sudo tee -a /etc/resolv.conf
echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.confNote: This removes existing nameserver entries in
/etc/resolv.confand adds Cloudflare (1.1.1.1) and Google (8.8.8.8) DNS servers. Adjust as necessary.
Ensure that your Bash history is preserved across sessions by appending the following lines to your ~/.bashrc:
echo 'shopt -s histappend' >> ~/.bashrc
echo 'PROMPT_COMMAND="history -a; $PROMPT_COMMAND"' >> ~/.bashrc
source ~/.bashrcThe source ~/.bashrc command reloads your Bash configuration immediately. The final exit command (if desired) will end your current session:
exitNote: Use
exitonly when you are finished configuring your shell or if you wish to log out.
Remove any unnecessary packages to keep your system tidy:
sudo apt autoremove -y