Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 tw.archive.ubuntu.com. 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 tw.archive.ubuntu.com to the main server.

share|improve this question

1 Answer 1

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 . –  AgentCool 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 paste.ubuntu.com. –  Chi-Ping Lee Jun 1 '12 at 3:36
1  
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

 
discard

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.