1.安装jdk
apt-get install openjdk-7-jdk
错误一:
failed to fetch http //cn.archive.ubuntu.com
解决办法:
将下列文本添加到/etc/apt/sources.list文件里
deb http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multivers
但是执行sudo apt-get update仍然报错,问题在于DNS没有配置好。
解决方法:
sudovi /etc/resolv.conf
添加
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver127.0.1.1
#这里用的是阿里云的DNS服务器
nameserver223.5.5.5
nameserver223.6.6.
之后执行sudo apt-get update就正常了。
网友评论