RSS
 

‘sudo’ & installing packages

20 May

So lets now understand few basics regarding software installation & user levels,cause in Linux both go hand in hand

Lets start with Terminal which is equivalent to the Command Prompt of Linux (but much more powerful than that of Windows).

It can be acessed by going to Applications —–> Accessories —–> Terminal

Since we’ll use Terminal too often , so just press Alt+F2

Type anything you wish to RUN  in terminal there & just check the “Run in Terminal“  before pressing Run.

Alt+F2

Running commands as root/administrator

There is one user ‘root’ in Linux which has access to everything in the operating system with no restrictions,so it is the root of all evil :P . It is equivalent to Administrator in Windows Vista/XP .

The user account which you created while installing or in simple words, the account which you are using does not have full access to the system. Why? The reason is simple – to improve security. Moreover, to avoid messing & unauthorised changes to the operating system.

To exec commands as ‘root’, you’ve to prefix ‘sudo’ before every command.

Open terminal and type nautilus….Nautilus will get opened, but you can’t delete/modify the system files in folders like /etc, /var..

Now close nautilus…and type ‘sudo nautilus‘ in the terminal and then enter your password. Don’t worry, you’ll not be asked for the password everytime. This time, Nautilus has been opened as root and you can make changes & delete the system files. But don’t try doing that at the moment.

Typical users just have full access to their /home directories not to the system files.

This is actually controlled by the ‘Permissions‘ which can only be changed by the ‘root’ if root is owner of the files. As ‘root’ is the ‘owner’ of the system files, it has full access to them.

Installing softwares & Packages

You might be wodering how we install softwares in Linux. So, here is a bit of theory about ‘packages’ in Linux.

In Linux, softwares are installed using files known as ‘Packages‘.

There are mainly 3 types of packages:

  • deb – Debian packages which is used by Debian linux and derivatives such as Ubuntu, Mint etc.
  • RPM – this was originally used by Red Hat, but now it is also used by distributions like Fedora, openSUSE, mandriva etc.
  • tar.gz – standard tar + gzip compressed packages, used by distributions like Slackware, Arch etc.

The packages are managed by a ‘Package manager’ which makes installing, upgrading and removing of the packages easy.

For Ubuntu, the common Package manager are ‘aptitude’, frontend for ‘dpkg’ &  Synaptic Package manager is the graphical frontend, which can be used to manage packages with a help of a GUI.

To access, Synaptic Package Manager ( go to System —–> Administration —–> Synaptic Package Manager )

To install a package, you can do either of following:

  1. Open Synaptic Package Manager —–> Tick the package you want to install after searching in the categories —–> Click Apply.
  2. Packages can also be installed by going to Applications —–> Add/Remove. This is basically a more user friendly version of Synaptic Package Manager.
  3. Directly download packages from sites like:
    http://packages.ubuntu.co and http://www.getdeb.net
  4. sudo apt-get install <package_name> in the terminal.
    Tip: You can search the Ubuntu package repository using the search box in Firefox.

And to remove you’ve can do either of following:

  1. Open Synaptic Package manager —–> Uncheck the package you want to uninstall after searching —–> Click Apply. Alternatively, you can also use Add/Remove.
  2. sudo apt-get remove <package_name> in the terminal.

Next time we’ll be talking about making your Ubuntu look really nice and will also let you practice a bit on installation procedures. Till then keep installing some really nice softwares using Add/Remove.

Digg It! Tweet It Share On facebook Share On facebook Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It! Mixx It! Buzz It Up! Post To MySpace

 

Tags: , , , , , ,

Leave a Reply

 

Powered by WP Hashcash

 
  1. Prabhjot

    June 7, 2009 at 4:39 am

    Nice Tutorial….
    It’s not preferred to use sudo with graphical applications. Use gksudo instead..
    sudo should be limited to applications running within the terminal.

     
  2. GeekG

    June 11, 2009 at 6:11 pm

    Will keep that in mind…!!!
    I think since many apps can be handled using terminal so using sudo becomes almost the same :razz:

     
  3. GaagD

    June 18, 2009 at 7:45 pm

    Yea, gksu/gksudo are to be used with Graphical applications.

    We had actually planned to tell about this later to the people.

     
  4. John S

    June 27, 2009 at 12:10 am

    this post cleared a lot of doubts in my mind about linux like ‘sudo’. thank u for this wonderful post.

     
  5. Sayan Chakrabarti

    October 9, 2009 at 6:13 pm

    The “Installing softwares & Packages” is full of incorrect and confusing information. There are certainly not just 3 types of packages in the linux world! Also, apt is NOT the short form for aptitude. Aptitude is just one of the many alternative frontends to dpkg, the most common one being called apt-get.

     
  6. GeekG

    October 10, 2009 at 1:23 am

    Thanx Mr.Sayan for suggesting the corrections. We’ve corrected those.

    BTW it takes lots of efforts to make a post and considering the arrogance you’ve shown in your remarks (couple of lines have been removed), one can easily realize how newbies are treated in Linux World.

    And secondly, you can realize from the other comments in this post that it did help many other people.

     
  7. GaagD

    October 10, 2009 at 4:10 am

    @Sayan Chakrabarti

    Sorry, we very well know that there are NOT just three types of packages in Linux. But do you want us to teach ‘rocket science’ to newly migrated Linux users? :/ I fail to understand this point of yours. And the word “mainly” is the key if you can read properly. :)

    Regarding apt and dpkg, that thing has been corrected. The mistake happened due to the flow of typing. Thanx for suggesting the corrections.

    There is no need of being arrogant. Just politely suggest the corrections. :/

    We are proud of the fact that we are making effort to spread what we know about Linux. :)