Check battery status
Open Windows Powershell with Administrator rights and run:
powercfg /batteryreport /output "C:\battery-report.html"
See the report at C:\battery-report.html
.
Open Windows Powershell with Administrator rights and run:
powercfg /batteryreport /output "C:\battery-report.html"
See the report at C:\battery-report.html
.
Things to do after Windows install.
See also The Ultimate Windows Development Environment Guide
The Chris Titus Tech's Windows Utility provides APP installs, fixes and tweaks.
irm christitus.com/win | iex
Run the following command and ignore the error. MS store will be installed.
wsreset -i
Click Microsoft.DesktopAppInstaller to install winget.
Install Chocolatey 🍫, a command-line interface (CLI) package manager for Windows.
Open the powershell prompt with admin privilege (e.g. via the Windows + X
menu):
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Install packages
choco feature enable -n=useRememberedArgumentsForUpgrades
choco install -y git.install --params "'/NoShellIntegration'"
choco install -y vscode qbittorrent firefox brave telegram bandizip nanazip honeyview potplayer lavfilters yt-dlp ffmpeg crystaldiskinfo crystaldiskmark directx vcredist-all sudo starship obsidian nerd-fonts-firacode nerd-fonts-hack github-desktop
choco uninstall -n --skipautouninstaller vscode qbittorrent telegram github-desktop brave
See also the 🍫 Chocolatey package list for more packages.
Disabling hibernation saves a lot of disk space (No more C:\hiberfile.sys
). Run this in powershell with admin rights:
powercfg -h off
Compact.exe /CompactOS:always
You can use nvcleaninstall to install Nvidia driver without bloat.
Things to do after installing
Info
How to fix locale:
Uncomment the zh_TW
line in /etc/locale.gen
. And then run:
sudo locale-gen
Language Support
and then set locale to Taiwan
.
You can replace archive.ubuntu.com
with a closer mirror, e.g., tw.archive.ubuntu.com
or free.nchc.org.tw
in /etc/apt/sources.list.d/ubuntu.sources
. After you are done, run:
sudo apt clean && sudo apt update && sudo apt full-upgrade -y
List snap packages
snap list
Uninstall each Snap package
sudo snap remove $PKG
Stop the snapd service and uninstall it
sudo systemctl stop snapd
sudo apt remove --autoremove --purge snapd
sudo apt-mark hold snapd
Adding 3rd party repositories for latest packages not available in xUbuntu's official repositories.
First, install required package
sudo apt update && sudo apt install -y apt-transport-https ca-certificates curl git gnupg-agent software-properties-common
Setup Brave browser
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list > /dev/null
sudo apt update && sudo apt install -y brave-browser
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt update && sudo apt install -y git git-lfs
sudo add-apt-repository -y ppa:qbittorrent-team/qbittorrent-stable
sudo apt update && sudo apt install -y qbittorrent
Download and run the official binaries.
Xanmod is a general-purpose Linux kernel distribution with custom settings and new features.
curl -fsSL https://dl.xanmod.org/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/xanmod-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/xanmod-keyring.gpg] http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list > /dev/null
sudo apt update && sudo apt install -y linux-xanmod
The following section works for Ubuntu 24.04 LTS.
Install nvidia CUDA runtime and compatible GPU driver.
For Ubuntu 24.04:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-ubuntu2404.pin
sudo mv cuda-ubuntu2404.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda-repo-ubuntu2404-12-6-local_12.6.0-560.28.03-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2404-12-6-local_12.6.0-560.28.03-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2404-12-6-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda
Add the CUDA compiler (nvcc
) to the system PATH
:
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
For WSL2, install Window NVIDIA GPU driver first; then install the CUDA toolkit in the WSL
# remove the old GPG key
sudo apt-key del 7fa2af80
# Install Linux CUDA toolkit
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update && sudo apt install -y cuda
Install the latest Mesa open source GPU drivers from the kisak PPA
sudo add-apt-repository -y ppa:kisak/kisak-mesa
sudo apt update && sudo apt full-upgrade -y
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
sudo apt update && sudo apt install wine
Kubuntu backports: Latest versions of KDE framework and APPs
sudo add-apt-repository -y ppa:kubuntu-ppa/backports
sudo apt-get update && sudo apt full-upgrade -y
sudo apt update && sudo apt full-upgrade -y
Ubuntu:
sudo apt install -y git git-lfs cifs-utils ssh nala gnome-shell-extension-manager parallel baobab ncdu synaptic apt-xapian-index ppa-purge ubuntu-restricted-extras ffmpeg vlc mcomix fonts-wqy-microhei fonts-wqy-zenhei fonts-open-sans ttf-mscorefonts-installer zsh btrfs-compsize
Kubuntu:
sudo apt install -y git git-lfs cifs-utils ssh nala parallel ncdu kio-extras gnome-keyring ppa-purge kubuntu-restricted-extras ffmpeg vlc fonts-wqy-microhei fonts-wqy-zenhei fonts-open-sans ttf-mscorefonts-installer zsh btrfs-compsize synaptic apt-xapian-index
Setting tmpfs
(RAM disk) for /tmp
folder:
sudo cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/
sudo systemctl enable tmp.mount
sudo mv /etc/apt/apt.conf.d/20apt-esm-hook.conf /etc/apt/apt.conf.d/20apt-esm-hook.conf.disabled
sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
YOu can also search and install extensions via gnome-shell-extension-manager
Workspace behavior
=> General behavior
=> click behavior
.Desktop session
.Copy the fonts files to ~/.local/share/fonts/
. Then, run fc-cache
to rebuild fonts cache.
fc-cache -fv
To display frequencies of all CPU cores every second:
watch -n1 lscpu --all --extended
When dual-booting Linux and Windows,it might be better to set the clock to the local time zone in Linux1 to in sync with Windows settings.
timedatectl set-local-rtc 1
How to recover Nautilus (File manager in Gnome) places folders.
Arch Wiki: environment variables
/etc/profile
is sourced by all POSIX-compatible shells upon login./etc/profile.d/
directory will also be read.~/.profile
or ~/.bash_profile
for login bash instances.~/.bashrc
for every interactive bash instance.~/.zshenv
for environment variables in all zsh instances.~/.zprofile
for every login zsh instance.~/.zshrc
for every interactive zsh instance.Note
zsh does not source ~/.profile
by default because of the difference between bash and zsh syntaxes. You can add this line to ~/.zprofile
or ~/.zshenv
to make zsh shells read `~/.profile correctly.
skip_global_compinit=1
test -r ${HOME}/.profile && emulate sh -c 'source ${HOME}/.profile'
~/.xinitrc
is sourced by startx
.~/.xprofile
is sourced by display managers (e.g., GDM, SDDM)~/.config/environment.d/*.conf
: sourced by systemd
. Also, they are used in Wayland sessions where xinitrc
and xprofile
files are not available.Environment variables in Powershell
Variables created by set
are bound to the current session and not persistent.
$Env:FOO = "example"
$Env:FOO
[Environment]::SetEnvironmentVariable('KEY', 'VAL', 'Machine')
SETX KEY VAL
You can make GPUs consume less (or more) power by setting the power limit.
Source: Puget systems