1

I trying to install openjdk-11-jdk-headless But the same error (connection failed) occurs repeatedly as below. How could I solve this problem ?

Ign:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 openjdk-11-jdk-headless amd64 11.0.16+8-0ubuntu1~22.04
Ign:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 openjdk-11-jdk-headless amd64 11.0.16+8-0ubuntu1~22.04
Ign:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 openjdk-11-jdk-headless amd64 11.0.16+8-0ubuntu1~22.04
Ign:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 openjdk-11-jdk-headless amd64 11.0.16+8-0ubuntu1~22.04
Err:1 http://security.ubuntu.com/ubuntu jammy-updates/main amd64 openjdk-11-jdk-headless amd64 11.0.16+8-0ubuntu1~22.04
  Connection failed [IP: 91.189.91.39 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-lts/openjdk-11-jdk-headless_11.0.16%2b8-0ubuntu1%7e22.04_amd64.deb  Connection failed [IP: 91.189.91.39 80]
Artur Meinild
  • 26,018

1 Answers1

0

Lots of reasons as to why this could be happening... if networking is all good, check the length of time it takes to download the file by manually trying to acquire the failing resources thru a curl or wget command. If such commands do not work, you will need to search the various answers here for potential solutions on networking settings to configure.

In my case, the reason for the apt upgrade failure was because it was taking too long to download the files. Regardless of the reason why it's taking so long to download, the solution in my case was to increase the apt timeout. See this answer for more about how to do this: How to extend APT connection timeout?

I increased my /etc/apt/apt.conf timeout settings to 300 seconds and everything worked fine.

  Acquire::http::Timeout "300";
  Acquire::ftp::Timeout "300";
Jon
  • 127
  • 2