title | tags | description |
---|---|---|
Troubleshooting Linux |
Templates, Talk |
View the slide with "Slide Mode". |
This document was created by the North GA LUG Group.
If your system or an app locks up it can be a frustrating experience. Here are some tips and tricks to get you back on your feet.
- System Lock: If your entire system is locked hit Ctrl + Alt + F2 to get to a command line. This will let you do some further analysis on your system such as htop to see if a process is hung.
xkill
: thexkill
command turns your mouse cursor into a weapon. Once you typexkill
in the terminal you will see your mouse change to an x. Anything you click it will kill that process.pkill
: thepkill
command is similar to thexkill
command except that you can terminate all instances of an application. iesudo pkill -9 -f steam
- Kill terminal or commands that are hung using
ctrl+c
orctrl+z
- To get a terminal window without leaving your desktop GUI - Use
ctrl+alt+t
orctrl+shift+t
top
&htop
:top
andhtop
will both provide you a list of running processes.htop
is little more graphical and provides shortcut keys to kill processes by hitting F9.- To list all files open on the system use
lsof
- You can use
watch
to keep an eye on processes as they are running. Examplewatch lsusb
to monitor if USB devices are plugged in.
- Check permissions if you're having trouble executing an app or a file.
$ ls -la
is an easy way to see permissions. - You can find kernel version using
$ uname -a
which can be helpful for troubleshooting and filling out bug reports inxi
is an insanely valuable tool for collecting system information. There are many cli switches to get you the information you need. iesudo inxi -b
for short form basic info.sudo inxi -M
for the machine info (such as motherboard, serial, manufacturer, model, etc). Highly suggest circling out all of the options by runningman inxi
. A useful full system dump (think about opening an issue) can be done withsudo inxi -b -v 8
ncdu
is a super helpful command to figure out where all of your speak space had been consumed.- Purge old kernels! otherwise your
/boot
will fill up. iesudo apt autoremove -y
. - Find path to software installed using
which
as an examplewhich chromium
will tell you the program is located in /usr/bin/chromium
- List all PCI devices on your system with
lspci -v
this is great for getting model of PCI devices such as Ethernet Controller, Wifi, GPU, etc. - List all USB devices
lsusb
great tool for determining if usb devices are detected and what usb devices are connected. - Check what hard drives are detected
fdisk -l
- To check hard drive space use
df-h
Especially Nvidia users - Hit 'e' at the GRUB screen to edit the settings - add 'nomodeset' before 'quiet splash' in the entry - What does this do? Instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded.
- Rescatux is a great tool to have around to help repair common issues with Grub.
- Rescatux is a Debian based live cd that lets you fix your GRUB1 and GRUB2 installations (as per Super Grub2 Disk lacks) but does much more including:
- Check and fix filesystems
- Blank Windows passwords
- Change Gnu/Linux password
- Regenerate sudoers file
- Rescatux is a Debian based live cd that lets you fix your GRUB1 and GRUB2 installations (as per Super Grub2 Disk lacks) but does much more including:
- Most systems are using Systemd so you can get your logs with the following commands:
$ less /var/log/messages (System logs) $`dmesg | less` (Kernel logs)
$ `journalctl -b` (-b switch shows all messages since last reboot)
$ `journalctl -b -p err` (shows messages marked as an error)
- For situations where you're getting a console login vs. desktop GUI
$ grep EE /var/log/Xorg.0.log
- List logs in order of when they were written
$ ls -lrt /var/log
- Look for errors only in dmesg using
dmesg | grep 'error'
*Note some distros utilize a different general log. Some Debian based distros uses /var/log/syslog vs. /var/log/messages as it's main log. If you don't have messages just change the end of the command to syslog in place of any of the commands above or below.
- You can search keywords in the logs by using 'grep'
- Navigate to /var/log
$ sudo grep "error" messages
- This will return all messages that contain the word error in the logs
- Use ‘tail’ to monitor logs real-time for bug reporting or system analysis. This will provide you updates that occur and could be invaluable for bug reports or monitoring of user activity or changes on your system.
As an example:
For openSUSE, Rhel you can use:
sudo tail -f -n 6 /var/log/messages
For Debian based distros
sudo tail -f -n 6 /var/log/syslog
The ‘f’ switch tells it to follow The ‘n’ switch tells it to display last N’th number of lines
ip addr
Shows addresses assigned to all network interfacesip route
Show table routes.ip link
ping
the ping command is useful to test connectivity between two sourcesifup
using this in combination with your specific interface ex: eth0 (which could be obtained usingip addr
) will bring the interface up.ifdown
-ifup
using this in combination with your specific interface ex: eth0 (which could be obtained usingip addr
) will bring the interface down.traceroute
is a network tool to tell you the hops in-between destinations. ex:traceroute google.com
host
orhost -t
this command lets you find IP or IP to name along with DNS info. ex:host www.google.com
- Another command you can use is
nslookup
and example would benslookup google.com
which will provide you DNS info.
- Another command you can use is
iwconfig
configure wireless network from terminal.
- Having a solid backup in place can help you to overcome issues easily and without losing your valuable data.
- DejaDup is a simple to use back-up tool
- Clonezilla will let you make entire clones of your existing drives and restore them if things go awry.
- Mega.nz is a nice tool for syncing and storing files on the cloud.
- All the above can be researched further using
man
command. An exampleman ifconfig
will provide information and options for that command.