Tag Archives: Firewalls

Update/install fail: Server cannot access software repositories

If you are trying to install something and the server waits forever after you answer yes to the update and it accesses the software repository… something like…

apt-get update
...
details of packages
...
Need to get 83.7 MB of archives.
After this operation, 237 kB disk space will be freed.
Do you want to continue [Y/n]?
0% [Connecting to archive.ubuntu.com]

And then nothing. It fails.

Do you have UFW installed? UFW can block outgoing connections from your server, so it becomes unable to access the software repositories. Rather than make exceptions, it is easier to disable the firewall and enable again when update or install is done.
??
If you have UFW (Uncomplicated Firewall) installed, disable it and try again.

ufw disable

Now your upgrades should work. Once you are done, re-enable your firewall.

ufw enable
Enhanced by Zemanta

Installing UFW – Uncomplicated Firewall on Ubuntu 12.04

If you are one of those nerdy types and use iptables, ignore this. If you are like the rest of us Ubuntu users (nerdy in denial), UFW (Uncomplicated Firewall) provides a handy tool to configure your firewall.

Here’s how to install. As root, type:

apt-get install ufw

If this can’t find the package, run

apt-get update

before running the command again. You’ll get it.

Next, add your exceptions. For example, on my server, I allow ssh (Secure Shell) and http (Hypertext Transfer Protocol).

# ufw allow ssh
# ufw allow http

Then start the firewall

# ufw enable

It will ask

Command may disrupt existing ssh connections. Proceed with operation (y|n)?

Reply “y”. Simply hitting enter will abort.

This should return:

Firewall is active and enabled on system startup

If you get an error like

ERROR: problem running ufw-init

Edit the file /etc/default/ufw and change IPv6=yes to IPv6=no

Enhanced by Zemanta