Find the answer to your Linux question:
Results 1 to 8 of 8
Anyone know what port apt get uses. It won't connect out through my router/firewall thingy. cheers kris...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    apt get


    Anyone know what port apt get uses. It won't connect out through my router/firewall thingy.

    cheers

    kris
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  2. #2
    Just Joined!
    Join Date
    Jan 2003
    Location
    Vancouver B.C.
    Posts
    24
    off the top of my head I beleive apt just tries to connect through ftp:// so port 21.....maybe
    give it try. Though I could be wrong

  3. #3
    Linux Engineer
    Join Date
    Nov 2002
    Location
    Queens, NY
    Posts
    1,319
    Are client programs subject to ports? I thought only servers strictly dealt with ports.
    The best things in life are free.

  4. #4
    Linux Newbie
    Join Date
    Apr 2003
    Location
    UK, Manchester
    Posts
    147
    Http (port 80) is the most commonly used but you can use ftp, rsh, ssh.

    If you look in the /etc/apt/sources.list you can set the URI, read the sources.list man page.

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    bpark: Ports are used in all parts of UDP and TCP traffic. It's the only way for programs to know which program on the remote machine to talk with. As you are probably aware, many ports are standardized, like 21 for FTP and 80 for HTTP. That means that well known programs, like a HTTP server, by default listen to a specific port, and the client connects to that port in expectation of finding such a server there. Of course, the client also allocates a port to talk to the server, since the server needs a port to respond to, but that port is dynamically allocated and doesn't need to have a specific value. However, telnet to a server of your choice, and run netstat on your local computer, and you'll see that the telnet process has a local port as well.
    Commonly, only clients connect to servers, but that is not always true, as in FTP. Also, in P2P applications you cannot always really define which part is the server and which is the client.

    However, if apt-get uses FTP, is the problem really connecting out? Isn't the problem that the server can't connect back, since the firewall is in the way? Is there a way to make apt-get operate in passive mode, or does it so by default?

  6. #6
    Linux Newbie
    Join Date
    Apr 2003
    Location
    UK, Manchester
    Posts
    147
    It uses passive mode by default, check the man page for apt.conf.

    Just about all apt-get sources use http, check your /etc/apt/sources.list.
    I would check the ruleset of iptables or ipchains to see if there is a rule that affects apt-gets usage.

  7. #7
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    just to clarify

    i downloaded and installed apt get on rh8. when i run apt get update it just hangs the hashs / percentage bar thing never moves.
    have waited a long time!

    my router in external and allows most default ports straight through. It does however differ from many in some respects. It has an ADSL modem connected to it and uses NAT.

    I can connect to the internet via a web browser, telnet to other machines, ftp to and from my box. But i cannot apt get. So i did wonder if apt did anything clever or unusual in its connection process.

    It is possible however, that the default sources in my list are incorrect or maybe the entire file has problems. So I'll download a new copy and install it again. Not terribly urgent at the minute as I broke my rh installation forcing a gnome upgrade and am currently using the new mandrake. my office pc has just died during an fresh install of RH 9. Apparently there are bad blocks on my HD but mandrake doesn't seem to mind so back to that. As mandrake has a pretty good package updater I don't need apt. But thanks for all your help and comments

    Cheers
    Kris
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

  8. #8
    Just Joined!
    Join Date
    Jun 2011
    Posts
    1

    Cool Solved ..

    Guys,

    I had the same problem and tracked it down from my border firewall logs.

    Granted, you are making a connection to the repositories via whatever protocol/port (e.g. 80, 21, 22 ...etc) you are using, but your responses do not come back to you on the same port - this is normal TCP/IP client/server behaviour. Replies from the repositories chooses a port on your machine pretty much randomly, where port is > 1023. These are the client ports.

    If your firewall does not allow access to ports > 1023, or, at the very minimum, does not allow the repository archives access to the same, then all your apt utilities will pretty much failed.

    What I did is to allow access to the world to TCP ports greater than 1023, and block commonly mischievous ones like X-server and the Micro$oft junk. Works a treat .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •