There might be a day that your python is totally messed up and you won't be able to do any
apt-get install. The situation is even worse if you haven't updated the server for a year or two and you are running Ubuntu Server 12.04. What would you do ? You will have a lot of chrome tabs open ! :)
- Recreate your
vi /etc/apt/sources.listand replace the content with the list from this generator. Make sure to make a backup first from the
- Compile Python 2.7 from source so the system uses that. Use this guide.
- Then try
apt-get install python-dev. Then if it tells you there are unmet dependencies, look at the first dependency and do
apt-get installon it.
- Then if you get an error message like:
Could not perform immediate configuration on 'python-minimal'.Please see man 5 apt.conf under APT::Immediate-Configure for details
apt-get install libglib2.0-dev # or the name of the package apt-get upgrade apt-get install -o APT::Immediate-Configure=false -f apt python-minimal
If everything went well, install pip, quick and dirty with
easy_install pip(Use virtual python or something else if you prefer)
which pipto see if pip is in path. After that do
pip install pycurl. That is the package that is necessary for system's package manager to work properly.
Now test it for example by updating your php:
sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php5-oldstable sudo apt-get update sudo apt-get upgrade sudo apt-get install php5
Now you can close all the tabs that you have open on chrome :)
1: Tytus Kurek's blog: Could not perform immediate configuration of 'python-minimal' -
2: Compiling Python
3: Upgrading php from 5.3 to 5.4