A collection of useful Linux commands and notes for various tasks.
Package Management #
Uninstalling Packages #
To remove packages and their configuration files from your system.
> `apt clean` removes downloaded package files, while `apt autoremove` removes packages that were automatically installed to satisfy dependencies but are now no longer needed.
# Clean up the local repository of retrieved package files
sudo apt clean && sudo apt autoremove
# Remove a package and its configuration files
sudo apt purge <package_name>Nvidia GPU #
Monitoring #
To monitor the status and usage of your Nvidia GPU in real-time.
# Watch nvidia-smi, refreshing every 1 second
watch -n 1 nvidia-smiConfidential Computing #
To check the confidential computing status of your Nvidia GPU.
# Check confidential computing feature status
nvidia-smi conf-compute -f
# Check if the nvidia-persistenced daemon is running
ps aux | grep nvidia-persistencedKernel Management #
Listing Kernels #
To see all installed kernel images on your system.
dpkg --list | grep linux-imageRemoving a Kernel #
Warning
Be careful when removing kernels. Make sure you have a working kernel to boot into.
# Remove a specific kernel image and its configuration
sudo apt remove --purge linux-image-5.19.0-rc6-snp-host-c4daeffce56e
# Update the GRUB bootloader
sudo update-grub
# Remove any unused packages
sudo apt autoremove --purgeSwitching Kernels #
To change the default kernel used for booting.
- Edit the GRUB configuration file:
sudo vim /etc/default/grub - Update the
GRUB_DEFAULTentry to point to the desired kernel. - Update the GRUB bootloader:
sudo update-grub
TEE (Trusted Execution Environment) #
Commands related to AMD SEV and trusted execution.
# Enable the vfio-pci module
sudo modprobe vfio-pci
# Check for AMD SEV in kernel messages
sudo dmesg | grep -i sev
Windows Network Drive #
For information on mapping a network drive in Windows, refer to this guide: