Ad Space — Top Banner

Connection Timed Out

Linux Linux

Severity: Moderate

What Does This Error Mean?

A 'Connection timed out' error on Linux means your system tried to connect to a server or service and waited too long with no response. The connection attempt was abandoned after the timeout limit. This can happen when downloading packages with apt or dnf, connecting via SSH, accessing web services, or trying to reach a network resource that is slow, blocked, or unreachable.

Affected Models

  • Ubuntu
  • Debian
  • Fedora
  • CentOS
  • Arch Linux
  • Linux Mint
  • openSUSE

Common Causes

  • The remote server is down or overloaded and not responding within the timeout window
  • A firewall on the local machine or network is silently dropping packets to that destination
  • DNS is resolving the hostname correctly but the IP address is not reachable
  • A VPN or proxy is routing traffic through an unavailable gateway
  • The package manager mirror being used is offline or heavily loaded

How to Fix It

  1. Test basic connectivity first. Open a terminal and type: ping 8.8.8.8 — if you get replies, your basic internet connection is working. Then type: ping google.com — if this fails, DNS is not resolving.

    Pinging 8.8.8.8 (Google's DNS server) bypasses DNS entirely. If that works but domain names do not, your DNS is the problem.

  2. Check your DNS settings. Type: cat /etc/resolv.conf to see your current DNS servers. If they are missing or incorrect, add a working one: echo 'nameserver 8.8.8.8' | sudo tee /etc/resolv.conf

    On systems using NetworkManager or systemd-resolved, DNS is managed differently. Verify using: systemd-resolve --status on newer systems.

  3. Switch to a different package mirror if apt or dnf is timing out. For Ubuntu: sudo nano /etc/apt/sources.list and replace the mirror URL with a different regional mirror from the Ubuntu mirror list.

    Package manager timeouts are often caused by a slow or offline mirror. Switching to a closer mirror dramatically speeds things up.

  4. Check your firewall rules. Type: sudo iptables -L -n to list active firewall rules. Look for rules that DROP packets to the destination you are trying to reach.

    On systems using ufw, type: sudo ufw status to see the current rules. An overly restrictive rule may be dropping your outbound connections.

  5. Flush and renew your network configuration. Type: sudo systemctl restart NetworkManager — or on older systems: sudo service networking restart — then retry the connection.

    A network manager restart refreshes DHCP leases, DNS, and routing tables, which can resolve transient timeout issues.

When to Call a Professional

Connection timeout errors are rarely a professional service issue for home users. If you are on a business network and cannot reach internal resources, contact your network administrator. A firewall rule may need to be updated to allow your connection.

Frequently Asked Questions

What is the difference between Connection Refused and Connection Timed Out?

Connection Refused means the server received your connection attempt and actively rejected it — often because no service is listening on that port. Connection Timed Out means the server never responded at all — either because it is down, the packets are being dropped by a firewall, or the network path is broken. Timed out is generally harder to diagnose because the silence gives you less information.

My apt update keeps timing out on specific mirrors. What should I do?

Run: sudo apt-get update with the -o option to increase the timeout: sudo apt-get -o Acquire::http::Timeout=60 update Or switch to a different mirror. On Ubuntu, you can select the closest mirror by going to Software and Updates (a graphical tool) and clicking 'Download from' > 'Other' > 'Select Best Server.'

SSH to my server keeps timing out. Is my server down?

Not necessarily. SSH uses port 22 by default, and many firewalls block port 22 to prevent brute-force attacks. Try: telnet [server-ip] 22 or: nc -zv [server-ip] 22 to test if port 22 is reachable. If the port is blocked, contact your hosting provider or check the server firewall rules. Also confirm the server is online by pinging it.