Ubuntu – 500 Internal Server Error whenever I use apt-get

aptaptitude

I'm running ubuntu 12.04

I'm getting a huge number of "500 Internal Server Error" errors whenever I try to apt-get install/upgrade. aptitude yields exactly the same errors. I know there are supposed to be "zillions" of threads about this on the web but none of them seem to work for me. Most of them seem to be related to installing a specific package, but I get the errors whenever I use apt-get or aptitude

I know this is supposed to be a generic error, but there's nothing in the /var/log/apt folder that provides any information, or even acknowledges the error. (The only two files in there are term.log and history.log).

As some have recommended, I've modified my /etc/apt/sources.list file so that the top three lines are

deb http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse

But these are giving errors as well.

Can anybody please advise based on this information, or suggest how I can get a more informative error description?

Thanks for help in advance

Here are just a few of errors I get from apt-get upgrade

Err http://archive.canonical.com precise/partner amd64 Packages 500  Internal Server Error
Err http://archive.canonical.com precise/partner i386 Packages 500  Internal Server Error
Err http://archive.canonical.com precise/partner Sources 500  Internal Server Error
Err http://dl.google.com stable/main amd64 Packages 500  Internal Server Error
Err http://dl.google.com stable/main i386 Packages 500  Internal Server Error
Err http://extras.ubuntu.com precise/main amd64 Packages 500  Internal Server Error
Err http://extras.ubuntu.com precise/main i386 Packages 500  Internal Server Error
Err http://extras.ubuntu.com precise/main Sources 500  Internal Server Error
Err http://ppa.launchpad.net precise/main amd64 Packages 500  Internal Server Error
Err http://ppa.launchpad.net precise/main i386 Packages 500  Internal Server Error
Err http://ppa.launchpad.net precise/main Sources 500  Internal Server Error
Err http://security.ubuntu.com precise-security/main amd64 Packages 500  Internal Server Error
Err http://security.ubuntu.com precise-security/main i386 Packages 500  Internal Server Error
Err http://security.ubuntu.com precise-security/main Sources 500  Internal Server Error
Err http://security.ubuntu.com precise-security/multiverse amd64 Packages 500  Internal Server Error
Err http://security.ubuntu.com precise-security/multiverse i386 Packages 500  Internal Server Error
Err http://security.ubuntu.com precise-security/multiverse Sources 500  Internal Server Error
Err http://security.ubuntu.com precise-security/restricted amd64 Packages 500  Internal Server Error
Err http://security.ubuntu.com precise-security/restricted i386 Packages 500  Internal Server Error
Err http://security.ubuntu.com precise-security/restricted Sources 500  Internal Server Error
...
Err http://us-west-1.ec2.archive.ubuntu.com precise/main amd64 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise/main i386 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise/multiverse amd64 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise/multiverse i386 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise/restricted amd64 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise/restricted i386 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise-security/main amd64 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise-security/main i386 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise-security/multiverse amd64 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise-security/multiverse i386 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise-security/restricted amd64 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise-security/restricted i386 Packages 500  Internal Server Error
Err http://us-west-1.ec2.archive.ubuntu.com precise-security/universe amd64 Packages 500  Internal Server Error

~
~

Best Answer

So my problem turned out to be that I'd set an environment variable, which was built into my login script.

setenv http_proxy http://proxy.lib.berkeley.edu:7777/proxy.pac

This was a vain attempt to connect to my library, since chrome in it's wisdom doesn't let you set a proxy connection. (It didn't work).

If apt-get provided any diagnostic output, I'd have figured this out ages ago. But it doesn't (In future releases it would be great if a verbose option were provided.)

Thanks to help from @gertfdijk, I tried the following

wget "http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg" 

which provided me with the diagnostics I needed to track down the error.