I am assuming you are using iso downloaded from Ubuntu.com. When you boot with this ISO does everything work when you select the try Ubuntu option? Using the try Ubuntu will allow you to do some basic troubleshooting. If you boot into this mode you could open a web browser and see if you can communicate with anything. You can also open a terminal window to check network interface and network services. If all of that works and the installation is still failing It may be a firewall issue. For example I installed a pfsense firewall and surricata. To allow for updates I had to white list all of the repo addresses. One last thought could you let us know what version of Ubuntu you are trying to resolve?