Cannot connect to server has no relationship to your having a connection. It is trying and failing to connect to the avast update server/s or being blocked (see below).
I presume that it is still telling you that your license has expired.
If you installed avast 5 over 4.8 then that converts your license information (which has expired), why it isn't letting you re-register is beyond me, but until you manage to re-register and your license is expired it will block updates, so we now have a chicken and egg scenario.
So I would suggest a clean reinstall:
Download the latest version of avast
http://www.avast.com/free-antivirus-download and save it to your HDD, somewhere you can find it again. Use that when you reinstall.
Download the avast! Uninstall Utility,
find it here ensure you get the version5 one (it has uninstall tools for both 4.8 and 5.0), aswClear5.exe and save it to your HDD.
- 1. Now uninstall (using add remove programs, if you can't do that start from the next step), reboot.
- 2. run the avast! Uninstall Utility from safe mode, first for 4.8 if previously installed and then for 5.0, once complete reboot into normal mode.
- 3. install the latest version, reboot.