hilmarp
By:
hilmarp

Can't upgrade from Ubuntu 14.04 to 16.04

January 13, 2017 3.6k views
DigitalOcean Server Optimization Ubuntu

So I'm trying to upgrade my server from Ubuntu 14.04 to 16.04 and it fails.

I did:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Then sudo do-release-upgrade.

It starts going and then stops because it failed to fetch some packages:

W:Failed to fetch
http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu/dists/xenial/main/binary-amd64/Packages
404 Not Found
, W:Failed to fetch
http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu/dists/xenial/main/binary-i386/Packages
404 Not Found
, W:Failed to fetch
http://ppa.launchpad.net/rwky/redis/ubuntu/dists/xenial/main/binary-amd64/Packages
404 Not Found
, W:Failed to fetch
http://ppa.launchpad.net/rwky/redis/ubuntu/dists/xenial/main/binary-i386/Packages
404 Not Found
, E:Some index files failed to download. They have been ignored, or
old ones used instead.

Any ideas?

3 Answers

@hilmarp

The issue there is that you've installed a PPA for two packages that you either needed at one point, or are currently using. These repos may not have current packages for the latest release of Ubuntu that you're upgrading to, so when attempting to pull them, it fails.

When upgrading from and older version of Ubuntu to a newer release, ideally, you want to clean up your sources.list file or, given the option, simply allow the release upgrade utility to overwrite the sources.list file.

I just deployed a new Ubuntu 14.04 Droplet and started the upgrade process using:

sudo apt-get update
&& sudo apt-get upgrade -y \
&& sudo apt-get dist-upgrade -y \
&& sudo do-release-upgrade

.. and it's working as it should. When you introduce dependencies, however, you need to clear them out or make sure those dependencies have packages for the version you're upgrading to. In many cases, it's possible for some rather unexpected results when you're using one piece of software, attempt to upgrade, and then find that it may be in the latest release of Ubuntu -- or that Ubuntu decides to simply remove it (I've had it happen before).

The result could be that your existing software and configuration is overwritten with something other than what you were expecting.

  • Thanks for the answer.

    I'm not using Python 2.7 but I'm using redis.

    So maybe I should remove those packages, install redis from this PPA (which has newer stuff):

    https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server
    

    Then run the update again.

@hilmarp

I would simply remove the PPA's and make sure the sources.list file only contains the standard repos. Doing so is going to keep the errors at bay. Ubuntu 16.x has a package named redis-server in it, so unless the PPA is newer or has something you specifically need, I'd recommend using the one that's already a part of the standard repositories for Ubuntu.

When you run sudo do-release-upgrade, it should prompt you asking if it's okay to overwrite your sources.list file -- let it, but you'll need to remove those PPA's from your sources.list file first.

Ideally, sources.list should only contain the basics when you upgrade.

@hilmarp I'm running into this same issue.

W:Failed to fetch 
http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu/dists/xenial/main/binary-amd64/Packages 
404 Not Found 
, W:Failed to fetch 
http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu/dists/xenial/main/binary-i386/Packages 
404 Not Found 
, E:Some index files failed to download. They have been ignored, or 
old ones used instead. 

Did you come up with a solution?

  • I removed those packages (apt-get remove) and updated.

    fkrull/deadsnakes-python2.7 is not maintained anymore.

    Just take a snapshot before you start.

    • Thanks for the reply. I did that shortly after posting this, and just came back here to update with my solution.

      sudo apt-add-repository --remove ppa:fkrull/deadsnakes-python2.7
      

      I wasn't immediately sure, since there wasn't anything added to the sources.list, but this worked just fine. Here's to hoping that the rest of the upgrade goes smoothly.

Have another answer? Share your knowledge.