Why does apt-get keep waiting for headers on Oracle repository?

I have this at the end of my /etc/apt/sources.list to retrieve Oracle code:

deb http://oss.oracle.com/debian unstable main non-free

When I run sudo apt-get update, the app gets stuck displaying this message:

100% [Waiting for headers]

If I remove this, apt-get update runs without error.

Is there a new, recommended URL for Oracle products and, generally, how do you fix this problem?

I am pretty sure this did not happen on 11.10 and has only started with the move to 12.04.

I have seen these answers and they do not help:

  • apt-get update stuck on "Waiting for Headers" when using Windows XP ICS
  • http://ubuntuforums.org/showthread.php?t=1689579
  • http://muffinresearch.co.uk/archives/2010/03/30/linux-fix-for-apt-get-update-waiting-for-headers/
  • http://www.kubuntuforums.net/showthread.php?57567-Ubuntu-problems-on-update

Solution 1:

What I think is causing the problem:
The problem is that oss.oracle.com enforces use of HTTPS which is a good thing. The bad thing about it is that the certificate that is being used isn't considered trusted (either because it's expired or is self signed etc).

Proposed solution:
If I knew how to make apt accept all HTTPS certifiates, I'd post that here as a solution (but I'm still search myself for info on how to do this).

After some digging:
I did find out how to make APT not verify certificates: Acquire:https::Verify-Peer false; but that didn't help.

The workaround:
Regardless, I downloaded the deb files manually and installed them. It's an old version of Oracle Express and I can't get it to run on a virtual Debian Squeeze machine. I'm giving up on trying to use this deb archive.

Solution 2:

This a problem with the repository, and not 12.04. I observe this problem on both:

  • 11.10 (snipped):

    Hit http://security.ubuntu.com oneiric-security/multiverse Translation-en
    Hit http://security.ubuntu.com oneiric-security/restricted Translation-en
    Get:63 http://security.ubuntu.com oneiric-security/universe Translation-en [29.9 kB]
    99% [Waiting for headers]
    
  • 12.04 (snipped):

    Ign http://archive.canonical.com precise/partner Translation-en_US   
    Ign http://extras.ubuntu.com precise/main Translation-en
    Ign http://archive.canonical.com precise/partner Translation-en
    98% [Waiting for headers]     
    

Please remove that repository, it seems to contain a handful of packages last updated in 2007 at any rate.