30 tips and tweaks for Ubuntu and Linux Mint - PART 1


Back to the home page



30 useful tips and tweaks for your Ubuntu or Linux Mint (PART 1, 1-20):


This is part one of the Tips and tweaks. You can find part two here.

Make Windows the default option in the Grub boot menu

1. At the beginning of their Linux adventure, many people want Windows to be the operating system that's booted by default, instead of Ubuntu. So that Windows will boot automatically when you make no choice in the boot menu (you'll get over it after a while!).

This is how you do it:


a. First determine on which line in the boot menu of Grub, the Windows boot line currently is (often on line number 5, but not always). This line number is important to know.


b. Now make sure that you have installed the applications gksu and leafpad:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Type (or copy/paste):
sudo apt-get install gksu leafpad

Press Enter and submit your password. Please note that the password will remain invisible, not even asterisks will show, which is normal.


c. Then type in the terminal (use copy/paste):
gksudo leafpad /etc/default/grub

Press Enter


d. Now you can change some things, among others the default boot line.

Find the following line (nearly at the beginning):
GRUB_DEFAULT=0

This is the default boot line. It's set at 0, because..... Grub starts counting with 0 and not with 1. Don't ask me why; probably because nerds derive a deep satisfaction from counting differently from ordinary people....

You have to keep this in mind when making a change. For example: if Windows is at line 5 in your Grub menu, you have to change the 0 into 4:
GRUB_DEFAULT=4


e. Save and close the configuration file. Note: please read on, you're not done yet!


f. Apply the change, by regenerating the Grub menu. Copy/paste the following line into the terminal:
sudo update-grub

Press Enter. Fill out your password: your password remains entirely invisible, not even dots will show, this is normal. Press Enter again.

Now you're done! When you reboot, the Windows boot line should be activated by default.

Forgotten password: what to do

2. You can't retrieve a forgotten password, but you can set a new one like this.

Increase the interval for the file system check

3. A file system check approximately once every 30 system boots, is tedious and unnecessary for most computers. With tune2fs you can change that. For example, if you want to increase the interval to 100, for partition sda2:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Type (or copy/paste):

sudo tune2fs -c 100 /dev/sda2

Press Enter and submit your password. Please note that the password will remain invisible, not even asterisks will show, which is normal.

Note: this is only applicable for EXT2, EXT3 and EXT4 file systems.

Make your system faster and quieter

4. There's an important thing you can do, in order to improve the performance of Ubuntu: turn off the three-dimensional visual effects.

You can do that like this.

Force a locked-up application to close

5. It won't happen often, but now and then this trick comes in handy:

a. Launch a terminal window.
(You can launch a terminal window like this: *Click*)

b. Type: xkill

c. And press Enter. Now the cursor changes into a cross.

d. Click on the application window that you want to kill forcibly.

Avoid some fatal mistakes!

6. There are some mistakes that you definitely will want to avoid.

Generate a nice hardware list

7. It's useful to have a hardware list. There are two ways to generate one:

A limited list of the most important hardware

7.1. You can easily create an overview of the most important hardware in your computer, by means of the application inxi.

inxi is present by default in Linux Mint but not in Ubuntu. So in Ubuntu you have to install it first, for example by means of the following terminal command (copy/paste it into a terminal window):

sudo apt-get install inxi


press Enter

Your password will remain invisible, not even asterisks will show, this is normal.

You can use inxi like this:

Open a terminal window. Make it fullscreen, so that there will be no breaks in the generated lines.
(You can launch a terminal window like this: *Click*)

Copy/paste the following command into the terminal:

inxi -Fxz

Press Enter.

Now you see a handy list. You can use copy/paste to transfer it, for example to put it in a support forum message in which you request help for a problem. That makes life easier for those who are willing to help you.

A complete list of all the hardware in your computer

7.2. For a complete list of every bit of hardware in your computer, do the following:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Copy/paste this line into the terminal:

sudo lshw -html > hardware.html

press Enter

Your password will remain invisible, not even asterisks will show, this is normal.

Now you'll have a nice document in your personal folder, named hardware.html. Double-click it to view it in your web browser.

Note: do you want to attach this file to a forum message, so that others can help you better to solve your computer problem?

Many internet fora, like the English Ubuntu Forums, don't accept attachments with the extension .html.

So in that case, compress the file first to hardware.html.tar.gz, using archive manager File-roller. The forum helper can then simply download the file and unpack it.


Optimize your Solid State Drive (SSD)

8. Do you have a Solid State Drive (SSD)? Then optimize it for Ubuntu and Linux Mint.

Improve the looks of image editor GIMP

9. GIMP is a fine tool for editing pictures. But its user interface is horrendously awful, particularly because of its three separate windows (what were the developers smoking?).

You can improve GIMP's user interface vastly by merging those three windows into one:

Panel of GIMP - Windows - tick: Single-Window Mode

Create an installer package for an application which is already installed

10. Do you have installed an application manually, which isn't in the software repositories of Ubuntu or Linux Mint, and have you lost the installer package (x.deb) of it? Then you can "magically" recreate the installer package on the system that contains this manually installed application, by means of dpkg-repack.

An example is easiest. Suppose you have manually installed 'Nero for Linux' some time ago in your Ubuntu or Linux Mint, and you wish to do a clean re-install of your entire operating system. Then you can do this first, in order to get an installer package for Nero:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Copy/paste this line into the terminal:

sudo dpkg-repack nerolinux

Press Enter

Your password will remain invisible, not even asterisks will show, this is normal.

When dpkg-repack has finished its job, there'll be a new .deb package in your home folder, called nerolinux_xxx.deb. You can use that to re-install 'Nero for Linux' (simply double-click it, like a Windows .exe installer), after you've done a clean re-install of your entire Ubuntu or Linux Mint.

(continued in the column on the right)



This website is being sponsored by Google Ads.

Are you using an ad blocker? Then you're also blocking my earnings from advertisements....

If you wish to support my website, you can configure your ad blocker to make an exception for this website.

Thanks in advance....


Cleanse a text from hidden layout code

11. You'll probably know the problem: you want to copy a piece of text from a certain source, but it's chock-full of hidden layout codes like fonts, bold, colours and all that.

Nasty and bad for your blood pressure, because those codes may easily mess up the layout of your target document.

By means of a small detour you can easily cleanse copied text from all hidden layout codes. Namely by means of a simple text editor like Leafpad or Gedit.

This is how you use Leafpad as "washing machine":

- Copy (with the mouse) the text block that you want to purify of all code, and paste it into an empty text file in Leafpad;

- Now copy the text in the Leafpad file (a new copy operation also);

- Finally, paste the text into the target document. Now it's entirely clean.

Improve Firefox

12. You can improve and optimize Firefox like this.

Manage the memory of the terminal

13. All terminal commands are being stored in a "memory file", so that you can recall them in the terminal by pressing the "up" arrow key on your keyboard.

They're in the file .bash_history in your home folder. It's a hidden file, so first unhide it:

Click in the Ubuntu sidebar on the icon of your home folder (called Files).

Use the shortcut (key combination) Ctrl h to make the hidden files visible, or do it like this:

In the task bar of the file manager: Files - Preferences - check:
Show hidden and backup files

Now close the file manager and open it again.

The hidden files (with a dot before their names) should be visible now. You can view and edit the contents of .bash_history in a text editor like Gedit or Leafpad.

Should you wish to clear all items in the "terminal memory", then you can use this terminal command:
history -c -w ~/.bash_history

Activate the numeric section of your keyboard

14. Note: only apply this tweak on a system that has been configured for automatic login. Otherwise a system malfunction might occur.

Note 2: this instruction is not meant for laptops without a separate numeric keyboard section, as it's not desirable to have the NumLock on by default on those laptops.

In some cases it's useful for NumLock to be switched on automatically when you start Ubuntu or Linux Mint. You can achieve that as follows:

Start Ubuntu Software Center or Software Manager (Mint).
Search word: numlockx

Install numlockx ("enable NumLock in X11 sessions").

Reboot your computer.

After logging in, Numlock should be activated.

In case activation failed, do this:
Click on the grey Ubuntu logo (Dash home). Query: startup.
Click on Startup Applications.

Click Add

Give the new addition the name Numlockx and the command:
sleep 10 && numlockx

Click Add.

Reboot your computer.

Disable the keyring password on your computer

15. The keyring password can be especially annoying when you use automatic login. It's better to disable it. This is how to do that:

a. First delete the current keyrings. Not your root password or your user password, but only your personal keyrings:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Use copy/paste to transfer the following command line to the terminal:

rm -v ~/.local/share/keyrings/*.keyring

Press Enter.

b. The next time when you're being prompted for a keyring password, leave the password field blank (simply click Continue and then again Continue, thus agreeing to "unsafe" storage).

The warning you get, is exaggerated: there is little risk involved. Only people with physical access to your computer could see the stored keys. Provided that they know where to look for them....

Disable the touchpad while typing and adapt the delay

16. It's pretty useful to disable the touchpad (trackpad) of your laptop during typing, and tweak the delay. Especially on small laptops.

In Ubuntu, that's easy to configure:

First, the disabling with the default delay: click on the grey Ubuntu logo (Dash home). Query: touchpad.

Click on Mouse & Touchpad

The following option should be ticked:
Disable while typing

Note: in Ubuntu, this only disables the touchpad functions of tapping and scrolling. Mouse pointer movements are still allowed.
In Xubuntu, not even mouse pointer movements are allowed then.

Now the delay. When the touchpad has been configured like this, the default delay is two whole seconds. That's too long and interferes with productivity. When you wish to shorten the delay to one second, you can do this:

First entirely undo the current disabling: remove the tick for Disable touchpad while typing. Close the mouse and touchpad settings window.

Now create an adapted startup application:
Click on the grey Ubuntu logo (Dash home). Query: startup.
Click Startup Applications - Add
Fill out the fields as follows (use copy/paste, that's easiest):

Name:
Syndaemon

Command:
syndaemon -i 1.0 -K -R -t

Comment:
Disable touchpad while typing, with a reasonable delay and only for tapping and scrolling

Click Add and then Close.

Reboot your computer.

Finally, check whether it's working, with the help of the following terminal command (copy/paste the line below in a terminal and press Enter):
ps aux|grep syndaemon

Note: this is a user preference, so repeat this in every user account.

Inadvertently set the system time to UTC (GMT) during install?

17. It's usually a bad idea to set the system time to UTC (formerly known as Greenwich Mean Time), because then the BIOS time may differ from the time of the operating system. Especially on dual boot machines, this may cause trouble.

This is how you can correct this:

a. First make sure that you have installed the applications gksu and leafpad:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Type (or copy/paste):
sudo apt-get install gksu leafpad

Press Enter and submit your password. Please note that the password will remain invisible, not even asterisks will show, which is normal.

b. Then type in the terminal (use copy/paste):
gksudo leafpad /etc/default/rcS

Press Enter.

In this text file, find the line for UTC and change the "yes" into "no".

c. Save the file and reboot your computer.

Copy entire websites to your hard drive

18. You can easily copy an entire website to your hard disk by means of the application httrack. Although httrack is a terminal application without graphical user interface, it's user-friendly and easy.

Note: there's also a graphical frontend called WebHTTrack, but strangely enough this is harder to operate than httrack(!) and even more importantly: it's unstable and unreliable. So I strongly advise against WebHTTrack!

You can install httrack by means of the Ubuntu Softwarecenter or Software Manager (Linux Mint).

After installation, just type httrack in a terminal window and press Enter. The rest is self-evident, because then a helpful wizard asks you a few simple questions.

When httrack has done its job, you can find the saved website in the folder "websites" in your home folder. Starting point for viewing is the file index.html, which you can simply double-click, and then it'll be opened by your web browser.

Note: by default, httrack copies an entire website with all its contents, like movies and such. So be careful what you copy, for you can easily flood your hard drive....

Use Xfburn to burn your CD's and DVD's

19. Unfortunately, Brasero is the default DVD burning application in Ubuntu. It's, let's put it mildly, often full of nasty surprises.

Luckily, there's a vastly superior alternative: Xfburn. There's a new version of Xfburn for Ubuntu 14.04 and Linux Mint 17, which contains many bugfixes and improved disc support. I strongly advise you to install it, because it's simple, stable and won't let you down!

Installing is easy: use the Ubuntu Software Center or Mints Software Manager. Or this magical invocation for the terminal:

sudo apt-get install xfburn

Press Enter and submit your password. Please note that the password will remain invisible, not even asterisks will show, which is normal.

Configure Ubuntu or Linux Mint for a FIDO U2F Security Key

20. There are several manufacturers that produce a USB key for two-factor authentication, like for example Yubico. Such a key is handy and secure.

You can configure Ubuntu and Linux Mint for the use of a FIDO U2F Security Key like this:

a. Install the latest Google Chrome, because that's the only web browser in which you can use such a key. The installation package voor Ubuntu and Mint is a .deb file, so you can simply double-click it in order to install Chrome.

b. Download the following rules file, and leave it in the folder Downloads. It's a simple text file, so if you want to, you can have a look at the text inside.

c. Add the rules file to your system like this:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Use copy/paste to transfer the following command line to the terminal:

sudo cp -v ~/Downloads/70-u2f-generic.rules /etc/udev/rules.d/

Press Enter and submit your password. Please note that your password will remain invisible, not even asterisks will show, which is normal.

d. Reboot your computer.

e. Launch Google Chrome and install the key, for example for your Gmail account.

Want more tips?

Do you want more tips and tweaks for Ubuntu or Linux Mint? Part two of the Tips and tweaks is here.


To the content of this website applies a Creative Commons license.


Comments