Archive for the 'Ubuntu How To' Category

How to open .rar files in Ubuntu

You need to install unrar to open .rar files in Ubuntu. It’s pretty easy, just open a terminal and type:


sudo apt-get install unrar

Now either double click the .rar file in GUI or right click -> Extract here. You can also type the following command in terminal:


unrar x /path_to_file/file_name.rar

How to update ati drivers on Ubuntu

Yes, you can go to hardware center and just pick the drivers ubuntu finds for you. I just tend to like manually installing Catalyst from ati. To do so, go to http://support.amd.com/us/gpudownload/Pages/index.aspx and download the drivers for your graphic card. Then save it, go to the folder in terminal and type:

sudo sh ati<tab>

<tab> meaning press the tab key to autocomplete the file name since I am not sure which version you got. 🙂 Now you should have the latest version of Catalyst and drivers running on your system. Got to love ATI for Ubuntu. Worked perfectly for my radeon hd 4870.

Now if you want to configure it, open terminal window and type:

aticonfig

Good luck.

 

 

 

 

How to use apt-get

apt-get (apt stands for advanced packaging tool) is used to install the packages on your system.

To install a package use (in terminal):

sudo apt-get install <packagename>

To remove:

sudo apt-get remove <packagename>

where <packagename> is the name of the package you need to install.

Once I install the new Ubuntu, I usually do:

sudo apt-get update

and

sudo apt-get upgrade

which updates the local package list and upgrades to the latest versions from Ubuntu repositories.

You can also upgrade the entire distribution of your Ubuntu by typing:

sudo apt-get dist-upgrade

if you need more information, type

sudo apt-get help

 

Ubuntu 11.04 Screen Flickering During Installation

Tried to install Ubuntu 11.04 on my other computer today and ran into a ton of problems.  Once I inserted a CD and started to install, I couldn’t even get to the main menu. The purple screen just kept on flickering so much that I couldn’t see anything. I am still battling with it, but I got it to install. Right now I am trying to update the drivers for nvidia geforce 8200 which seem to be the problem.

Anyway,I was able to get the flickering down to the extent where I could at least see the installation screen and progress. It still flickered a little, but not as much. Here is what I had to do:

1) Press “Shift button” while it loads from the cd – it should give you configuration screen.

2) Press F6 for additional options and select “nomodeset” option.

3) Pick Install Ubuntu and you should be good to go.

As far as I can tell, your graphic card drivers are not supported if you run into this problem. Hope this will help you to install Ubuntu and get into the next phase of configuration. 🙂

How to find out Ubuntu system information

There are a few ways to figure out which version of Ubuntu and kernel you are using.

First, lets try GUI. Just go to System > About Ubuntu. It will shows you a lot of information, including the version you are using.

You can use the Terminal to find out more. Open it up and type:

uname -a

It will print all the information, -a stands for all. You can try other flags, such as -r, -o or -v.

uname -r

will show only the kernel information

uname -o

shows only your operating system, and

uname -v

displays the version of your kernel.

 

There are other ways to find the version of your linux. Type:

lsb_release -a

-a shows all information once again. You can alternatively use:

cat /etc/lsb-release

or try

cat /etc/issue

 

Don’t you just feel better now, knowing more about what exactly is under the hood of your PC case? 🙂

How to check disk space in Ubuntu

Ubuntu Disk Usage Analyzer

Ubuntu Disk Usage Analyzer

There are quite a few ways to check the hard drive disk space in Ubuntu. Lets look at the most popular ones.

1) Using GUI in Gnome – Just go to Applications > Accessories > Disk Usage Analyzer. Open it and it will show you used and free disk space. Easy, huh? Well, here is what else you can do – click filesystem scan and it will show you the usage of each individual directory and display it in a pretty graph.

2) Using command line. Now this is where it gets fun. There quite a few ways to check the disk space using the Terminal. One of the most popular is:

df

Now df by itself as you can see is confusing. Let’s try it with a flag:

df -h

A lot better, huh? -h flag stands for human readable format.

There are a lot of other tools you can add to make the command line look prettier and more user friendly. One such tool is discus (disc usage). Type:

sudo apt-get install discus

After installation you can just type in:

discus

and it will show you the stats in very friendly format. It is configurable, so check out

man discus

 

We can also use du command (disc usage) to show the size of the current directories. Type in Terminal:

du

and it will show you not too friendly output, try again using some flags

du -sh *

or

du -s -m *

-s stands for summary, -m to show it in megabytes, or you can once again use -h for human readable.

 

Check total free space in the system – use free CLI command. Open terminal and just type:

free

or

free -m

Once again, -m flag to show it in a nice format in Mb.

 

Do you need it to take one step further and check the CPU load and Memory Usage?

Use top command. Type in Terminal:

top

as you can see, it shows you the computer load and usage in real time. You can sort it while watching by pressing m key by memory, l by load, t by process time.

 

This is about it. You should now know how to check you system status, free and used space, cpu and memory usage.

It takes time to memorize these commands, but once you do it will be easy. Just remember that each command in Ubuntu is well documented and you can also do

man <command>

or try

<command> --help

to refresh the memory.

How to add a new user in Ubuntu

You create your first user during the initial Ubuntu installation. This user has special privileges, such as create new users and performing a lot of administrative tasks. There is also a root user account which is the main administrative account and has pretty much all the priveleges the user can get. Now we can get a lower level of user with just basic privileges.

Adding new user in Ubuntu is pretty easy. There are two ways – using GUI and Terminal CLI.

 

Lets take a look at GUI first (just in case, GUI stands for Graphical User Interface). Go to System > Administration and  pick Users and Groups menu option, it will prompt you for your main user password.

You are now in Users and Groups section. Now click “Add User”. Check out the “Advanced” options and “User Privileges”. Obviously, you would want to modify some privileges, such as “Connect to Internet”. Now press OK, get back to the previous screen that now lists the new user and press OK again. You have just created a new user and the new home folder for the user.

Try playing around in Users and Groups section. Create new groups and try placing users into different ones. This would allow users to share their files and folders, and you can set permissions on other folders in the system (will need to make another post on this) to use by certain groups.

 

Now lets create a user using a terminal window, open a Terminal and type:

sudo adduser newuser

or

sudo useradd -d /home/newuser -m newuser

where -d flag helps creating the home directory for the user and -m forces the directory creation. You can also specify the password right away with useradd function by using -p flag and typing password after it.

Also, you can just specify the password for the newuser as:

sudo passwd newuser

These commands are almost identical but adduser is a bit easier because it will prompt you for every piece of information after you press enter. Try it out.

How to install Guake in Ubuntu

  [ad#1]

Guake is a cool Quake style drop-down terminal for Gnome used in Ubuntu by default. If you use Kubuntu, which uses KDE instead of Gnome, you would need Yakuake, video for Yakuake is below:

 

 

By default, you can show and hide the terminal with button F12.

To install it, just type in Terminal:

sudo apt-get install guake

Now go to System > Preferences > Startup Applications and click add, in the new window type “Guake Terminal” for name, /usr/bin/guake/ for command and “Guake Terminal” in the comment. It will now launch Guake on startup. Now go through some Guake settings in System > Preferences > Guake Preferences, change as needed and start – Applications > Accessories > Guake Terminal.

Hope you like it, it does speed some things up a bit.

How to use syntax highlighting in gedit

Here we will continue the gedit tutorials and explain syntax highlighting. If you want to see previous gedit posts – you may find How to open a file with gedit on right-click and How to use gedit helpful.

Syntax highlighting is built into gedit on Ubuntu. It shows the programming or markup code in different colors, which is a very handy feature when you try to edit html, php or other programming files.

Open gedit and go to View > Highlight Mode > Scripts. Here you can see all the languages it supports by default.

Don’t see the language you need? Add or find one. All you need is a .lang file for the needed language. There are a ton of them online, just google or bing “ActionScript lang file for gedit” or start making your own. .lang files are located in /usr/share/gtksourceview-2.0/language-specs/ folder. Just place a file there or create a new one. This is also where you go to edit the file. For example, if you don’t like the default color scheme for php, open up php.lang and stat making the changes.

Pretty easy, eh?

How to open file with gedit with right mouse click in Ubuntu

new gedit window

new gedit window

It may be pretty convenient to open a file in gedit when right-clicking any file, kind of like “open with notepad” option in Windows. You would need to make a new nautilus script, so lets type in this command in the terminal:

gedit ~/.gnome2/nautilus-scripts/Open\ with\ gedit

Basically, this script creates a new file called “Open with gedit” in the the nautilus scripts folder for your user. If it is not working, try gksudo in front of the command, but should be fine as is.

The new gedit file opens up, insert this script code:

 

#!/bin/bash
#
# Nautilus script -> open gedit
#
# Owner : Largey Patrick from Switzerland
#   	  patrick.largey@nazeman.org
#	  www.nazeman.org
#
# Licence : GNU GPL
#
# Copyright (C) Nazeman
#
# Encoding UTF-8
#
# Ver. 0.9-1 Date: 04.04.2003
# Add compatibilty with Nautilus 2.x
#
# Ver. 0.9-1 Date: 16.02.2002
# Add multiple file open in the same windows
#
# Ver: 0.9  Date: 27.10.2001
# Initial release
#
# Dependence : Nautilus (of course)
#	       Gnome-utils (gdialog)
#
curpath=`echo $NAUTILUS_SCRIPT_CURRENT_URI | sed 's/file\:\/\///'`
cd $curpath
filesall=""
while [ $# -gt 0 ]
	do
		files=`echo "$1" | sed 's/ /\?/g'`
		filesall="$files $filesall"
		shift
	done
gedit $filesall&

 

and save the file. Please note, if it will not work, get the code in plain text from here as html may not copy characters correctly.

Now make the script executable. Open terminal window and type:

chmod u+x ~/.gnome2/nautilus-scripts/Open\ with\ gedit

Done. Now lets take a look at your new nautilus script. Right click any file on your desktop and go over “Scripts” menu options. You should now see “Open with gedit”. Click it and you should now be able to open any file in gedit with easy.

Please let us know if you liked the script and if it works well for you.