LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   apt-get not working (https://www.linuxquestions.org/questions/linux-general-1/apt-get-not-working-435880/)

johngrinham 04-17-2006 02:57 AM

apt-get not working
 
I know there has got to be a simple solution to this.
apt-get is not working, example follows

root@0[knoppix]# apt-get update
Err http://security.debian.org stable/updates/main Packages
Could not connect to security.debian.org:80 (1.0.0.0), connection timed out
Err http://ndiswrapper.sourceforge.net ./ Packages
Could not connect to ndiswrapper.sourceforge.net:80 (1.0.0.0), connection timed out
Err http://ftp.de.debian.org stable/main Packages
Could not connect to ftp.de.debian.org:80 (1.0.0.0), connection timed out
Err http://kanotix.com ./ Packages
Could not connect to kanotix.com:80 (1.0.0.0), connection timed out
Err http://security.debian.org stable/updates/main Release
Could not connect to security.debian.org:80 (1.0.0.0), connection timed out
Err http://ndiswrapper.sourceforge.net ./ Release
Could not connect to ndiswrapper.sourceforge.net:80 (1.0.0.0), connection timed out
Err http://ftp.de.debian.org stable/main Release
Could not connect to ftp.de.debian.org:80 (1.0.0.0), connection timed out
Err http://kanotix.com ./ Release
Could not connect to kanotix.com:80 (1.0.0.0), connection timed out

I have two main linux installs, Studio to go, and knoppix 4. They both do it so it can't be the install. More likely it's my network which is roughly as follows.

ADSL-> netcomm router 192.168.1.1 (dhcp server)
-> Netway 8 port switch
1. Router
2. knoppix/studio to go (dhcp)
3. XP laptop-1 (dhcp)
4. XP Desktop (dhcp)
5. ASUS wap 192.168.1.110 -> XP laptop (2)
6. Asterisk server on 192.168.1.111

Any ideas ???

demian 04-17-2006 05:36 AM

All addresses are being resolved to 1.0.0.0. Your DNS setup is borked

johngrinham 04-17-2006 06:35 AM

Yes, well and truly borked, but how do I un-bork it. :-)

demian 04-17-2006 06:47 AM

Do you have your own dns server or use one from your ISP? If the former: which one? Can you resolve names in the local zone? Can your dns server reach the forwarder (if any)? Does the dhcp server send info about the dns server when giving out leases or do you need to manually setup the clients? If the former does that work (how's your /etc/resolv.conf looking)?

Why am I asking the questions?

johngrinham 04-17-2006 07:41 AM

Quote:

Originally Posted by demian
Do you have your own dns server or use one from your ISP?

My router has a primary and secondary DNS server setting (203.8.183.1 and 192.189.54.33) so I assume DNS is done at the ISP.

Quote:

Originally Posted by demian
(how's your /etc/resolv.conf looking)?

resolv.conf has a one line entry pointing to my router, 192.168.1.1

demian 04-17-2006 07:52 AM

Then your linux box thinks 192.168.1.1 is your dns server. Which obviously it isn't. Either find a way to make your router's dhcp server tell it's clients the IPs of the dns server or you add them manually in /etc/network/interfaces:

eth0 inet dhcp
dns-nameservers 203.8.183.1 192.189.54.33

You will need to restart the network interface after changing the interfaces file: ifdown eth0 && ifup eth0 or /etc/init.d/networking restart

johngrinham 04-17-2006 08:56 AM

Quote:

Originally Posted by demian
Then your linux box thinks 192.168.1.1 is your dns server. Which obviously it isn't. Either find a way to make your router's dhcp server tell it's clients the IPs of the dns server or you add them manually in /etc/network/interfaces: eth0 inet dhcp dns-nameservers 203.8.183.1 192.189.54.33 You will need to restart the network interface after changing the interfaces file: ifdown eth0 && ifup eth0 or /etc/init.d/networking restart

This is the interfaces file:

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback
iface eth0 inet dhcp
name Ethernet LAN card
auto eth0

If I add dns-nameservers 203.8.183.1 192.189.54.33 here, the restart gives an error reading file, as follows

root@0[/]# /etc/init.d/networking restart Setting up IP spoofing protection: rp_filter. Reconfiguring network interfaces.../etc/network/interfaces:17: misplaced option ifdown: couldn't read interfaces file "/etc/network/interfaces" /etc/network/interfaces:17: misplaced option ifup: couldn't read interfaces file "/etc/network/interfaces" done.

demian 04-17-2006 08:58 AM

Code:

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

This is the interfaces file:

# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback

iface eth0 inet dhcp
name Ethernet LAN card
dns-nameservers 203.8.183.1 192.189.54.33

auto eth0


johngrinham 04-17-2006 09:19 AM

Quote:

Originally Posted by demian
Code:

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

This is the interfaces file:

# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback

iface eth0 inet dhcp
name Ethernet LAN card
dns-nameservers 203.8.183.1 192.189.54.33

auto eth0


OK, no error reading on restart, but apt-get update still wants to resolve to 1.0.0.0

Could this be a router problem, should I try a different router?

demian 04-17-2006 09:55 AM

Post the full output of

dig security.debian.org

and

dig security.debian.org @203.8.183.1

farslayer 04-17-2006 10:55 AM

All other references I have found to this problem indicate that the Users DNS was not configured properly, and editing the entry in /etc/resolv.conf fixed their issues..

Quote:

Repository Connection Problem - Solved
Submitted by homebody on Fri, 10/08/2004 - 08:44.

Having wrestled with this same problem for some time myself, I can sure understand the frustration. And, while I realize this answer comes quite late, perhaps it will help others nonetheless.

My problem was resolved by editing the /etc/resolve.conf file to show the DNS server addresses for my ISP, in my case the addresses appearing in the status window for my ActionTec DSL modem/gateway. Immediately all the apt-get update connection errors vanished.

Still would like to know how Mepis or any other distro sets that file up in the first place though, getting it right in most cases and wrong in others. The problem is by no means unique to Mepis.

Bob


--------

WOW!!!
Submitted by LanceHaverkamp on Fri, 10/08/2004 - 14:58.

That worked! THANK YOU, THANK YOU, THANK YOU!!!

My resolv.conf said:

search Belkin
nameserver 192.168.2.1
----
My router is a belkin, and Yes, the network was live when I installed MEPIS.

Rather than change a conf setting, which will get written over, I set a static primary & secondary DNS into both my dsl modem AND router (yes it had to be both, not just one).


johngrinham 04-18-2006 07:48 AM

Quote:

Originally Posted by demian
Post the full output of

dig security.debian.org

and

dig security.debian.org @203.8.183.1

root@0[knoppix]# dig security.debian.org

; <<>> DiG 9.3.1 <<>> security.debian.org
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14191
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;security.debian.org. IN A

;; ANSWER SECTION:
security.debian.org. 690 IN A 194.109.137.218
security.debian.org. 690 IN A 128.101.240.212

;; Query time: 72 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Apr 18 22:46:47 2006
;; MSG SIZE rcvd: 69

root@0[knoppix]# dig security.debian.org @203.8.183.1

; <<>> DiG 9.3.1 <<>> security.debian.org @203.8.183.1
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60764
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;security.debian.org. IN A

;; ANSWER SECTION:
security.debian.org. 3600 IN A 194.109.137.218
security.debian.org. 3600 IN A 128.101.240.212

;; Query time: 907 msec
;; SERVER: 203.8.183.1#53(203.8.183.1)
;; WHEN: Tue Apr 18 22:47:31 2006
;; MSG SIZE rcvd: 69

root@0[knoppix]#


All times are GMT -5. The time now is 12:06 AM.