apt-get packages all unavailable

Asked by Clark Williams

apt-get tells me packages are not available. I try "apt-get update" but that times out trying to connect to the servers. I'm behind a proxy, but have http_proxy correctly set; the command wget can retrieve web pages successfully.

richardw@ubuntu:~$ sshd
The program 'sshd' is currently not installed. You can install it by typing:
sudo apt-get install openssh-server
richardw@ubuntu:~$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package openssh-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'openssh-server' has no installation candidate
richardw@ubuntu:~$ sudo apt-get install aptitude
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package aptitude is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'aptitude' has no installation candidate
richardw@ubuntu:~$ sudo apt-get update
Ign cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012) oneiric InRelease
Ign cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012) oneiric/main TranslationIndex
Ign cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012) oneiric/restricted TranslationIndex
Ign cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012) oneiric/main Translation-en_US
Ign cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012) oneiric/main Translation-en
Ign cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012) oneiric/restricted Translation-en_US
Ign cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012) oneiric/restricted Translation-en
64% [Connecting to us.archive.ubuntu.com (91.189.92.176)] [Connecting to security.ubuntu.com (91.189.92.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
Clark Williams
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Run:

gksudo gedit /etc/apt/sources.list

and add a hash character to the start of the lines referencing the install CD and save the new file and close gedit. Then run:

sudo dpkg --clear-avail; sudo apt-get update

It should be smooth, is the CD mentioned

Revision history for this message
Clark Williams (rich-dick-clark) said :
#2

Commented out the first line in /etc/apt/sources.list

     # deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)]/ oneiric main restricted

Didn't recognize any other references to the CD.

apt-get update still fails to connect to the servers:

richardw@ubuntu:~$ sudo apt-get update
Err http://extras.ubuntu.com oneiric InRelease

Err http://extras.ubuntu.com oneiric Release.gpg
  Unable to connect to extras.ubuntu.com:http:
Err http://security.ubuntu.com oneiric-security InRelease

Err http://security.ubuntu.com oneiric-security Release.gpg
  Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.166 80]
0% [Connecting to us.archive.ubuntu.com (91.189.92.183)]

Revision history for this message
Clark Williams (rich-dick-clark) said :
#3

Showing that wget works:

richardw@ubuntu:~$ wget http://extras.ubuntu.com/ubuntu/dists/oneiric/Release.gpg
--2011-11-23 11:27:58-- http://extras.ubuntu.com/ubuntu/dists/oneiric/Release.gpg
Connecting to 155.34.234.20:8080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 72 [text/plain]
Saving to: `Release.gpg'

100%[===============================================================>] 72 --.-K/s in 0s

2011-11-23 11:27:59 (12.7 MB/s) - `Release.gpg' saved [72/72]

Revision history for this message
Clark Williams (rich-dick-clark) said :
#4

Had to create a /etc/apt/apt.conf file containing the single line

Acquire::http::Proxy "http://proxyhostname::port";

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

Cool glad you got the gold