Emergency Repair Kit For Linux

Like anything, PC's are great until something unexpected happens and you have to find a way to fix it. A simple application crash or power cut will lose your unsaved data. Sometimes applying an update will change something your particular setup wasn't prepared for and it will cause a crash. Most user level interaction with the PC will be done in a GUI (Graphical User Interface), regardless of which OS (Operating System) you run.

In Windows when your graphical environment crashes, the whole system crashes; they are interconnected. This means that everything you were running, any services etc will be interrupted until you reboot. This is fine assuming the issue fixes itself when you reboot. If not, then you have a problem, in addition to losing any unsaved work before the crash and the downtime of any services.

Linux by comparison has a separate graphical and text mode. If your GUI crashes, that's all that's gone. You are dumped out to a command line, where you are still logged in, all your services, unsaved work etc are all still there. You are faced with having to type commands to fix it. At this point it's worth trying:

startx

You never know, it may work. The command startx as you may have guessed starts X (the graphical engine). It may have been some little blip that has fixed itself and your GUI comes back. In all likelihood startx won't work if X has crashed, as there has to be a reason why X crashed, and that needs to be discovered and fixed. If it was a kernel update which broke the GUI ie you got a new kernel, rebooted and X tried and failed to start, you can simply reboot and select an older kernel from the menu and come back into your regular GUI to find a fix. New kernels add themselves to the top of the boot list and will boot into them by default unless you manually select an older one. It may be that your combination of hardware or software needs some line uncommented in a config file to make the new kernel work for you. It may be a known issue which they are trying to fix. Sometimes you're trying to reconfigure some monitor or display settings and a change you make to a file crashes X. This can easily be fixed by editing the file and reversing your changes.

All of this means you need some sort of emergency repair kit able to run from the terminal, remember that's all you're gonna have to work with. Think of it like a cupboard where you keep things like a torch, blankets, candles etc for the odd time when you need to use them for 10 minutes until everything is back to normal again. Of course, having a toolkit is useless unless you know how to actually use the tools at least to a basic level. Installing these 3 applications and making an effort to spend a little time in them, playing with them in a terminal is more of a peace of mind issue than anything else. It removes the fear of being dropped to the command line and having no ability to get out of it. It's stressful when you don't know commands and all you know is GUI based. All of these applications are CLI (Command Line Applications) and run inside a terminal.

Nano

Nano in a semi transparent XFCE4 TerminalNano is a plain text editor similar to Vim or Emacs. In a GUI you'd most likely use something like gEdit, or kEdit. While old school *nix users will argue over Vim or Emacs, I found both of these to be overkill as an emergency text editor.

With Nano, it's easy to create, open, edit, save and close a file. It also has an onscreen help section at the bottom of the screen for the keyboard shortcuts to use. CTRL+O saves, CTRL+X exits. Nano has an online command manual here. In Ubuntu Nano is already installed by default, and the other 2 are a simple sudo apt-get install away.

ELinks

ELinks in a semi transparent XFCE4 TerminalELinks is a web browser, allowing you to search Google (or your search engine of choice) for forum posts, blog posts etc with possible fixes to your issue, or error messages.

Setting it up beforehand with bookmarks to your distro's forums and hardware manufacturers support sites etc is a good idea. Practice navigating forums in particular, and downloading files from links, as well as copying and pasting text as most solutions to Linux issues will be in the form of text commands.

ELinks can work partially with the mouse to point and click, but I urge you to play with all 3 of these applications without touching the mouse.

IRSSI

IRSSI in a semi transparent XFCE4 TerminalIRSSI is an IRC client, allowing you to go into the support channels for most FOSS projects. This allows you to ask for help from other users. Just like the advice for ELinks, it's worth taking the time to set IRSSI up beforehand to let you save you time and hassle trying to find the correct channels. It may be that they can't help directly but they can at least point you to other locations where you may find help.

Try to remember that as much as it's an emergency to you, they will most likely be volunteers, so be patient and polite and most FOSS support channels will happily try to help you if they can. It goes without saying, unless you spend some time playing with these applications in a safe environment, they will be no use to you when you need them. In your GUI environment you can use gEdit, Firefox and XChat (a combo I am rather fond of) but make an effort to get to know these 3 applications.

Remember this is your emergency kit, you will not have the use of a mouse when you need to use these skills. Many applications have either man and / or help pages built into them, but with ELinks and IRSSI your range of help options just became the whole of the internet, instead of just your own abilities.

Practicing where you can easily just close the terminal if you get frustrated allows you a safety net you won't have when you need these tools for real. Remember to practice on blank files in your home directory too, that way you won't accidentally cause any problems on your PC. Copy a config file from somewhere and call it "nano-practice" or something. Open it, make some changes and save it. Open it again in gEdit and see your changes. You get the idea. All of these applications are mature enough to be found in most Linux distro's repositories. 

Tags: 

If you liked this post, buy me a coffee

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <p> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer