Hello xiemei,
You are not saying which distribution you have, so I will assume it is Fedora, because you are on a Fedora site xD. You have 2 queries in there. I will answer them 1 by 1.
- How to install a package like "gcc".
Using yum you can install gcc from the commandline as follows:
yum install gcc
However, gcc has lots of different packages so you may want to select the right package, like this:
yum search gcc
An easier route is to do yumex (from the commandline (CLI) or from the menu).
If you haven't got yumex installed, look at the package called Software that is listed under the menu probably under System or System tools.
If you are using Ubuntu, then just type system when looking for a program.
[It is really much easier to answer your question if you give more info from the start :) ]
- How to log on to root without knowing its password.
Especially Ubuntu does not assign any password to root, to protect you from doing dangerous stuff without knowing exactly what you are doing. However, from Fedora you can do the same (I do).
So, how to install stuff?
You use sudo, like this:
sudo yum install <packagename> (without the brackets)
or, if you want to do a lot using root, do sudo -s and you will be logged on as root.
No password needed.
However, be careful what you do as root: it is all powerful and you can easily destroy a working system.
Hope this helps.