installing gcc compiler

Asked by Kushagra Srivastava

how do i install gcc compiler on ubuntu...

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Open software-center or synaptic package manager, search for gcc and select install. This should download from the repositories the gcc package and all packages that it is dependent on, and install them.

If you have problems with installing any software please tell us with the exact and complete error messages that you see.

Revision history for this message
marcus aurelius (adbiz) said :
#2

go into terminal and type

sudo apt-get install build-essential

Revision history for this message
Kushagra Srivastava (sriv-kush) said :
#3

my synaptic manager shows that gcc has been installed. ive also tried

sudo apt-get install build-essential

on my terminal.the message given by the terminal was

E:Could not get lock /var/lib/dpkg/lock - open (11.Resource temporarily unavailable)

E:Unable to lock adminstrator directory(/var/lib/dpkg/lock) another process is using it

pls help

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#4

You cannot use two package management programs at the same time. Imagine that you use synaptic to install a package that is dependent on another package in one window, and at the same time you remove that other package in a second window. This would break dependencies.

To make sure that you only one package management program is running, a lock file /var/lib/dpkg/lock is created when you start a package management program (and removed when it is finished). If a package management program finds the lock file present it aborts with the error message above.

I assume that you had synaptic manager still running when you attempted to issue the command sudo apt-get install build-essential.

What to do:
Either make sure that all package management programs (synaptic, update-manager, software-center...) are closed and issue the command "sudo apt-get install build-essential" again.
or
Use synaptic to install build-essential.

++++++++++++++++++++++

Back to your original question:
Why do you think that gcc is not installed on your system?
Are there error messages when you try to compile a program?
If there are, can you show the exact text of the error messages?
Maybe the root cause is something completely different and we can help find out what is wrong when wee see the error messages?

Revision history for this message
Kushagra Srivastava (sriv-kush) said :
#5

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Kushagra Srivastava (sriv-kush) said :
#6

thanks manfred .i was running the command with my synaptic manager window on.. i again tried the command "sudo apt-get install build-essential" and it worked.