I figured out how to get apt-get to work again.
Edit gai.conf
:
sudo vim /etc/gai.conf
change line ~54 to uncomment the following:
precedence ::ffff:0:0/96 100
write and quit:
後來強迫apt-key使用80 port才成功
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80
安裝oracle java8要照下列步驟才會成功
sudo apt-get install software-properties-common
sudo add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
sudo apt-get update
sudo apt-get install oracle-java8-installer
ubuntu使用debian版本對照