Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to install gcc on my computer. To do this, I ran the following command:

sudo apt-get install build-essential

As this runs, it connects (or tries to connect) to the server But the server is not working.

How can I fix this and get gcc installed?

Note: the Taiwan mirror is down as of 2012-06-01 0352. See thread here.

This pastebin contains the text of /etc/apt/sources.list, after changing from to the main server.

share|improve this question

Open Update Manager. Click Settings (at the lower-left corner of the Update Manager window).

This opens the Software Sources settings. In the first (leftmost) tab, called Ubuntu Software, there is a drop down menu labeled Download from:. Change the server to another one. Then click the Close button, and try again to install gcc.

Since you have changed your Software Sources, to install packages from the command-line you might need to first run sudo apt-get update, before running any sudo apt-get install ... commands (like sudo apt-get install build-essential). Thanks to izx for pointing this out!

share|improve this answer
@Eliah Kagan , Thanks for the editing . you're doing big help to me all the time . – Raja Jun 1 '12 at 2:23
I have changed the server, then try again. The following message is shown. – Chi-Ping Lee Jun 1 '12 at 2:37
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package build-essential – Chi-Ping Lee Jun 1 '12 at 2:38
I have found the file /etc/apt/source.list and its content is pasted at – Chi-Ping Lee Jun 1 '12 at 3:36
Run sudo apt-get update first!!! Then try installing build-essential. That's all you're missing. – izx Jun 1 '12 at 3:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.