Linux Common commands,errors and their : Solutions
Section 1: Package Management Errors
-
- Error: E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
- Solution:
sudo rm /var/lib/dpkg/lock and then sudo dpkg --configure -a
-
- Error: E: Package 'package-name' has no installation candidate
- Solution:
sudo apt update and then sudo apt install package-name
Section 2: Networking Errors
-
- Error: Failed to connect to wifi network
- Solution:
sudo service network-manager restart or sudo systemctl restart NetworkManager
-
- Error: No network interfaces found
- Solution:
sudo ip link set eth0 up (replace eth0 with your network interface)
-
- Error: DNS re: Solution failed
- Solution:
sudo service bind9 restart or sudo systemctl restart systemd-resolved
Section 3: File System Errors
-
- Error: Disk full, cannot write - clean up unneeded files
- Solution:
sudo apt autoremove and sudo apt clean to free up disk space
-
- Error: File system corrupted
- Solution:
sudo fsck -y /dev/sda1 (replace /dev/sda1 with the affected partition)
-
- Error: Permission denied
- Solution:
sudo chmod 755 /path/to/file to change file permissions
Section 4: Boot Errors
-
- Error: Failed to boot, kernel panic
- Solution:
sudo update-initramfs -u and then sudo update-grub
-
- Error: GRUB error, unknown filesystem`
- Solution:
sudo grub-install /dev/sda (replace /dev/sda with the boot disk)
-
- Error: Failed to load kernel modules
- Solution:
sudo depmod and then sudo update-initramfs -u
-
- Error: Boot loader not found
- Solution:
sudo update-grub and then sudo grub-install /dev/sda
-
- Error: gave up waiting for suspend/resume device
- Solution:
add correct swap partition uuid in /etc/initramfs-tools/conf.d/resume, run sudo update-initramfs -u and reboot
Section 5: User Account Errors
-
- Error: Login failed, incorrect password
- Solution:
sudo passwd username to reset the password
-
- Error: User account locked
- Solution:
sudo usermod -U username to unlock the account
-
- Error: Failed to create new user account
- Solution:
sudo useradd -m username to create a new user account
Section 6: Graphics Errors
-
- Error: Failed to start X server
- Solution:
sudo service lightdm restart or sudo systemctl restart gdm
-
- Error: Graphics driver not found
- Solution:
sudo apt install nvidia-driver (or the relevant graphics driver)
-
- Error: Screen re: Solution not detected
- Solution:
sudo xrandr --auto to auto-detect screen re: Solution
Section 7: System Errors
-
- Error: System crash, kernel oops
- Solution:
sudo apt install linux-crashdump and then sudo reboot
-
- Error: Failed to start system service
- Solution:
sudo systemctl start service-name (replace service-name with the affected service)