-3

I have to install jdk in my Ubuntu 17.04v it will display the error like unable to locate package default -jdk

  • 4
    Ubuntu 17.04 is not supported; it reached EOL on 13-Jan-2018 (2017-April + 9 months). The repos have already been moved to `old-releases.ubuntu.com` which will mean package errors. Upgrade to 17.10 as it should have been prompting you to do for some time. – guiverc Jan 23 '18 at 09:16
  • 2
    Possible duplicate of [How to install software or upgrade from an old unsupported release?](https://askubuntu.com/questions/91815/how-to-install-software-or-upgrade-from-an-old-unsupported-release) – Chai T. Rex Jan 23 '18 at 09:20

1 Answers1

1

Either update to a newer ubuntu release, or you can do this :

sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

then :

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

thus your /etc/apt/sources.list should look like this :

deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main

deb http://old-releases.ubuntu.com/ubuntu/ zesty-backports main

deb http://old-releases.ubuntu.com/ubuntu zesty-security main

deb http://old-releases.ubuntu.com/ubuntu zesty main universe restricted multiverse

You should then be able to install the package. If you are still having trouble then make sure you have the correct package name. Do a search on :

https://packages.ubuntu.com/