Today I wasted several hours configuring a Ubuntu machine for development. The major problem I had involves getting a wifi USB adapter to work properly. It uses Realtek 8192cu chipset, and apparently the driver that comes with the kernel is really outdated. If you don't upgrade the driver, it'll appear to work (you get connected but you'd get disconnected later) and then stops and no matter how you configure the routes it just won't work. You must blacklist the old drivers and install this one.
First, check if you are using the old drivers with
lsmod | grep ^rt. If you are, use
modprobe -r xxx to unload them. Unplug the wifi adapter now.
Then add these 3 lines to
blacklist rtl8192cu blacklist rtl8192c_common blacklist rtlwifi
Now unfortunately you still need internet connection to proceed, just use cable.
rtl8192cu-tjp-dkms_1.6_all.deb. Note that may take a few minutes.
8192cu on a new line to
/etc/modules. Reboot (
reboot -h now) and your wifi should be working.