# Cannot upgrade to Ubuntu 20 due to broken packages

## post by skeydan on Nov 13, 2020

Hi,

when trying to upgrade to Ubuntu 20 the process aborts because of broken packages.

Grepping for “broken” I see

```
 var/log/dist-upgrade/apt.log:Broken python-dev:amd64 Depends on python:amd64 < 2.7.15~rc1-1 @ii gR > (= 2.7.15~rc1-1)
/var/log/dist-upgrade/apt.log:Broken python2:amd64 Breaks on python:amd64 < 2.7.15~rc1-1 @ii gK Ib > (< 2.7.15-2)
/var/log/dist-upgrade/apt.log:Broken python-all-dev:amd64 Depends on libpython-all-dev:amd64 < 2.7.15~rc1-1 | 2.7.17-2ubuntu4 @ii umH > (= 2.7.17-2ubuntu4)
/var/log/dist-upgrade/apt.log:Broken python2-dev:amd64 Breaks on python-dev:amd64 < 2.7.15~rc1-1 @ii mK Ib > (< 2.7.15-2)
/var/log/dist-upgrade/apt.log:Broken libpython2-dev:amd64 Breaks on libpython-dev:amd64 < 2.7.15~rc1-1 @ii gK > (< 2.7.15-2)
/var/log/dist-upgrade/apt.log:Broken python-dev:amd64 Depends on python:amd64 < 2.7.15~rc1-1 @ii gR > (= 2.7.15~rc1-1)
/var/log/dist-upgrade/apt.log:Broken python2:amd64 Breaks on python:amd64 < 2.7.15~rc1-1 @ii gK Ib > (< 2.7.15-2)
/var/log/dist-upgrade/apt.log:Broken python-all-dev:amd64 Depends on python2-dev:amd64 < none | 2.7.17-2ubuntu4 @un uH > (= 2.7.17-2ubuntu4)
/var/log/dist-upgrade/apt.log:Broken libpython-all-dev:amd64 Depends on libpython2-dev:amd64 < none | 2.7.17-2ubuntu4 @un uH > (= 2.7.17-2ubuntu4)
/var/log/dist-upgrade/apt.log:Broken python-dev:amd64 Depends on python:amd64 < 2.7.15~rc1-1 @ii gR > (= 2.7.15~rc1-1)
/var/log/dist-upgrade/apt.log:Broken python2:amd64 Breaks on python:amd64 < 2.7.15~rc1-1 @ii gK Ib > (< 2.7.15-2)
/var/log/dist-upgrade/apt.log:Broken python-all:amd64 Depends on python2:amd64 < none | 2.7.17-2ubuntu4 @un umH > (= 2.7.17-2ubuntu4)
/var/log/dist-upgrade/apt.log:Broken python:amd64 PreDepends on python-minimal:amd64 < 2.7.15~rc1-1 @ii gR > (= 2.7.15~rc1-1)
/var/log/dist-upgrade/apt.log:Broken python:amd64 Depends on libpython-stdlib:amd64 < 2.7.15~rc1-1 @ii gR > (= 2.7.15~rc1-1)
/var/log/dist-upgrade/apt.log:Broken python-is-python2:amd64 Depends on python2:amd64 < none | 2.7.17-2ubuntu4 @un umH >
/var/log/dist-upgrade/apt.log:Broken python-is-python2:amd64 Breaks on python:amd64 < 2.7.15~rc1-1 @ii gK >
/var/log/dist-upgrade/apt.log:Broken python-dev:amd64 Depends on python:amd64 < 2.7.15~rc1-1 @ii gR > (= 2.7.15~rc1-1)
/var/log/dist-upgrade/apt.log:Broken python2-minimal:amd64 Breaks on python-minimal:amd64 < 2.7.15~rc1-1 @ii gK > (< 2.7.15-2)
/var/log/dist-upgrade/apt.log:Broken libpython2-stdlib:amd64 Breaks on libpython-stdlib:amd64 < 2.7.15~rc1-1 @ii gK > (< 2.7.15-2)
/var/log/dist-upgrade/apt.log:Broken python2:amd64 PreDepends on python2-minimal:amd64 < none | 2.7.17-2ubuntu4 @un umH > (= 2.7.17-2ubuntu4)
/var/log/dist-upgrade/apt.log:Broken python-all:amd64 Depends on python2:amd64 < none | 2.7.17-2ubuntu4 @un umH > (= 2.7.17-2ubuntu4)
/var/log/dist-upgrade/apt.log:Broken lambda-desktop:amd64 Depends on python-all:amd64 < 2.7.15~rc1-1 | 2.7.17-2ubuntu4 @ii umR >
/var/log/dist-upgrade/apt.log:Broken python-is-python2:amd64 Depends on python2:amd64 < none | 2.7.17-2ubuntu4 @un umH >
```

Would anyone have an idea what to do here? Many thanks!!

## post by sabalaba on Nov 13, 2020

Try this:

```bash

sudo apt-get update --fix-missing
sudo apt-get install -f
```

Let me know if that works.

## post by skeydan on Nov 13, 2020

Thanks for the quick answer! Unfortunately no, didn’t help …

I now tried something pretty drastic - uninstalled python2, as all of the things above involved python2 …

upgrade is running now

I’ll probably have to reinstall lambda stack … actually i hope it won’t reinstall python2, as i’d rather not have that on the system at all … (unless for possible internal use by linux or the distro) …

## post by porthole on Apr 15, 2021

Thank you! I was in the same boat, trying to upgrade my workstation to Ubuntu 20.04. Received:

> This was likely caused by: Unofficial software packages not provided by Ubuntu. Please use the tool ‘ppa-purge’ from the ppa-purge package to remove software from a Launchpad PPA and try the upgrade again.

Removing python2 allowed the update scripts to work:

`sudo apt purge python2.7-minimal`

## post by ronneely on Jun 26, 2023

Does this help: [How do I upgrade Ubuntu and Lambda Stack? | Lambda Docs](https://docs.lambdalabs.com/linux/upgrade-ubuntu-and-lambda-stack/) ?
