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 have recently installed Ubuntu 12.04 LTS and I wanted to upgrade the Python version to 3.3, but I am having some problems doing it.

Whenever I run this command,

sudo apt-get install build-essential

I get the following errors:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package build-essential

Can anyone tell me what is happening?

share|improve this question
    
Maybe there are some package sources missing... Can you post the content of your /etc/apt/sources.list? –  chaos Oct 16 '13 at 5:46
    
By the way, it's 'Ubuntu 12.04' (not Linux). Ubuntu is not the only distribution of Linux and Linux does not necessarily mean 'Ubuntu'. Linux is merely the underlying kernel from which Ubuntu uses. –  minerz029 Oct 16 '13 at 6:15
    
@chaos it say's no such file or directory found –  Akash Oct 16 '13 at 7:56
add comment

2 Answers 2

You accidentally deleted your sources.list. To regenerate this file go to this website and choose the country and your os release. check all Ununtu Banches and Ubuntu Updates and if you want Ubuntu Partner Repos and Ubuntu Extras Repos and then generate the new file.

Now you have to copy the content into your /etc/apt/sources.list, create the file if its not existing yet, and then run:

sudo apt-get update
sudo apt-get upgrade

Your system should be up-to-date again now. And you should now be able to run your installation again:

sudo apt-get install build-essential
share|improve this answer
    
can you tell me how to create those directory and where –  Akash Oct 16 '13 at 8:32
    
Create folder if not exist: sudo mkdir -p /etc/apt open the file with editor sudo nano /etc/apt/sources.list copy the contents type "Ctrl-o" to save "enter" and "Ctrl-x" to exit. –  chaos Oct 16 '13 at 8:43
    
still not working now it say's Unable to lock directory /var/lib/apt/lists/ –  Akash Oct 17 '13 at 2:05
    
Then you have to delete the lock files sudo rm /var/lib/apt/lists/lock and sudo rm /var/cache/apt/archives/lock first. –  chaos Oct 17 '13 at 5:47
add comment

Try sudo apt-get update first. Make sure you have an internet connection.

share|improve this answer
    
nope didn't worked instead got following errors >E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ –  Akash Oct 16 '13 at 7:53
    
Are you sure you have root privileges? You need to be root or issue sudo and get the password right (it's the password you use to login). –  Alex Oct 16 '13 at 16:51
    
yeas it asks for password and i provide it –  Akash Oct 17 '13 at 1:55
add comment

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.