0

I'm trying to install software-center but for that it depends on python-lxml. I tried to install python-lxml using

apt-get install python-lxml

But got

It depends on python>= 2.7 but it is not going to be installed
Python<2.8 but it is not going to be installed
Python : any (>= 2.7.1- 0Ubuntu 2) 
Unable to correct problems , you have held broken packages
wjandrea
  • 14,236
  • 4
  • 48
  • 98
sam
  • 1,333
  • does adding this ppa: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa and running sudo apt update && sudo apt upgrade --fix-missing solve it? – Joshua Besneatte Aug 19 '18 at 19:02
  • Software Center is already installed on Ubuntu 14.04. How did you get to this situation? Edit: Is this related to your last question, where you uninstalled Python 2.7? Cause this would be a side-effect of that. – wjandrea Aug 20 '18 at 00:11

1 Answers1

1

There is a PPA available to get you the latest python:

IF you are in recovery mode

If you are in recovery mode you will need to do some things to make sure you can write to your drives, and any partitions are mounted. Per this question:

You can install software in the recovery mode, but there are a couple of things to keep in mind:

  • Only / is mounted, so if you have a separate /var, /usr, /home, you need to mount then yourself

  • Filesystems are mounted read-only, so you need to remount them using sudo mount -o remount,rw /

  • Drivers for your network card or wireless interface may not be loaded

Be sure to run:

sudo mount -o remount,rw /

Before proceeding.

Make sure your system is up to date

sudo apt-get update
sudo apt-get upgrade --fix-missing
sudo apt-get dist-upgrade

Add the PPA

MANUALLY, by adding the following lines to /etc/apt/sources.list

deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu trusty main 
deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu trusty main 

OR AUTOMATICALLY, if the following software is available, add it automatically:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa

Now reload your repos and upgrade:

sudo apt-get update
sudo apt-get upgrade --fix-missing

Reinstall Python

sudo apt-get remove --purge python
sudo ap-get autoremove autoclean
sudo apt-get install python 

Install Updated Python(s)

sudo apt-get install python2.7

This will get you the latest python and should solve your problem!

You might also want to install python 3 and/or the dev packages:

sudo apt-get install python3
sudo apt-get install python-dev python2.7-dev python3-dev
Joshua Besneatte
  • 4,773
  • 5
  • 23
  • 42