嵌入式成长轨迹31 【嵌入式学习阶段】【ARM环境调试】【Ubuntu-Win7 NAT联网】
嵌入式成长轨迹31 【嵌入式学习阶段】【ARM环境调试】【Ubuntu-Win7 NAT联网】
图片在博客园上要一张张上传比较麻烦,需要看图的同学可以移步QQ空间,传送门:
http://user.qzone.qq.com/312677150/blog/1344684194
最近在弄虚拟机下弄linux,无论是移植还是开发,linux都要安装各种库和软件,最好能联网安装比较方便。
PS:后来发现直接用ubuntu12.04(当时最新版),安装完就能直接上网了(大概因为我之前以前设置过宽带共享等一系列,这个可以省下。而且是最新版,虚拟机系统里边的调试也可以省下了),而且很多更新包也会支持!所以强烈建议先找最新版的iso安装而不是按下面一项一项调试。
首先罗列下我的硬件环境:
虚拟机vm8.0.2 build-591240 ,
ubuntu9.10,
win7 家庭版。
罗列下本机一些地址:
本机宽带ip地址 192.168.0.2
Vm net8 ip地址 192.168.138.1 (ipconfig 得知)
Vm net8 网关 192.168.138.2 (在vm network editor中设置)
Ubuntu ip地址 192.168.138.127 (在Ubuntu network interface文件中设置)
Ubuntu 网关及默认网关、dns服务器 192.168.138.2(同vm net8 网关)
然后按照网上教程来设置:
http://www.cnblogs.com/sophine/archive/2012/04/26/2471227.html
http://tompig.iteye.com/blog/1113023
http://blog.csdn.net/guo__qiu/article/details/7420621
共享问题【已解决】
win7系统 设置宽带连接网络共享 出现错误 无法启用共享访问 错误代码:0x80004005:未指定错误
发生该错误的主要原因是因为网络共享需要防火墙的支持,而很多人会将防火墙关闭,此时即使防火墙服务是手动的,但是防火墙是关闭,防火墙服务也不会自动启动
你在“控制面板”中找到管理工具,双击服务,把Windows Firewall服务启动并设置为自动启动即可,以后开机都要实现共享的话,在控制面板中将防火墙设置为打开即可。
不能启动网卡【已解决】 http://rainbird.blog.51cto.com/211214/200024
症状:
sudo /etc/init.d/networking restart
* Reconfiguring network interfaces...
eth0: ERROR while getting interface flags: No such device
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
eth0: ERROR while getting interface flags: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.
解决办法:
sudo rm -rf etc/udev/rules.d/70-persistent-net.rules&&reboot
但还是不行
偶然执行了一下ifconfig -a,发现有个eth1..它还有物理地址在
于是修改interfaces文件中的eth0为eth1
重启网络,故障done...
Network unreachable【已解决】http://linux.ctocio.com.cn/335/8718335.shtml
设置好几个文件
/etc/resolv.conf文件:
# Generated by NetworkManager
domain localdomain
search localdomain
nameserver 192.168.138.2
nameserver 127.0.0.1
/etc/network/interfaces文件:
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 192.168.138.127
netmask 255.255.255.0
gateway 192.168.138.2
然后:
root@picy-desktop:~# ifconfig
eth1 Link encap:Ethernet HWaddr 00:0c:29:7e:5a:db
inet addr:192.168.138.127 Bcast:192.168.138.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:19 Base address:0x2024
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:49 errors:0 dropped:0 overruns:0 frame:0
TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3872 (3.8 KB) TX bytes:3872 (3.8 KB)
添加默认网关route add default gw 192.168.138.2后,得到:
root@picy-desktop:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.138.0 * 255.255.255.0 U 0 0 0 eth1
link-local * 255.255.0.0 U 1000 0 0 eth1
default 192.168.138.2 0.0.0.0 UG 100 0 0 eth1
请问点开机的时候出现:the vmware authorization service is not running 是什么问题,该怎样解决?【已解决】
以管理员身份运行就OK了
(我是重新启动一下电脑就好了、、、)
按以上设置完毕后网关无法ping通
解决:表示我重启一下突然就通了、、、
root@picy-desktop:~# ping 192.168.138.2
PING 192.168.138.2 (192.168.138.2) 56(84) bytes of data.
64 bytes from 192.168.138.2: icmp_seq=1 ttl=128 time=1.72 ms
64 bytes from 192.168.138.2: icmp_seq=2 ttl=128 time=0.367 ms
64 bytes from 192.168.138.2: icmp_seq=3 ttl=128 time=0.235 ms
64 bytes from 192.168.138.2: icmp_seq=4 ttl=128 time=0.232 ms
64 bytes from 192.168.138.2: icmp_seq=5 ttl=128 time=0.220 ms
64 bytes from 192.168.138.2: icmp_seq=6 ttl=128 time=0.225 ms
^C
--- 192.168.138.2 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5002ms
rtt min/avg/max/mdev = 0.220/0.501/1.729/0.551 ms
root@picy-desktop:~# ping 192.168.138.1
PING 192.168.138.1 (192.168.138.1) 56(84) bytes of data.
64 bytes from 192.168.138.1: icmp_seq=1 ttl=64 time=4.15 ms
64 bytes from 192.168.138.1: icmp_seq=2 ttl=64 time=0.418 ms
64 bytes from 192.168.138.1: icmp_seq=3 ttl=64 time=0.358 ms
64 bytes from 192.168.138.1: icmp_seq=4 ttl=64 time=0.297 ms
64 bytes from 192.168.138.1: icmp_seq=5 ttl=64 time=0.238 ms
^C
--- 192.168.138.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4013ms
rtt min/avg/max/mdev = 0.238/1.092/4.153/1.531 ms
试着百度一下,也能开起来了~
出现:0% [Connecting to 192.168.240.248 (192.168.240.248)]......
等一段时间结果是出现failed to fetch http://...... 【已解决】
解决方法:
【ubuntu 12.04】
在右上角菜单中找找,最后选择software souces,里边有server一项,点进去全是美国服务器(在中国连美国不慢就奇怪了),选other server,找china,里边又有一堆,我用着是mirror.163那个源最快,可以点开几个试下。测试的方式就是ping,看看哪个速度快。如果不知道该选哪几个源先,可以参考下边的源列表。
【ubuntu9.10】http://jinguo.iteye.com/blog/718617
在终端输入并运行
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (备份当前的源列表,以便日後需要时恢复)
sudo gedit /etc/apt/sources.list (修改sources.list文件中源的列表)
然后在sources.list文件中尾部添加(小贴士:只需下面几个源当中保留一个你测试出来下载速度最快的源就可以了,不用把所有源添加.测试就在虚拟机外的本机ping就可以了)
保存编辑好的文件,终端执行以下命令进行软件升级。
sudo apt-get update #这一步是更新你的源列表,换源後必须执行
(如果更新速度非常慢请更换源
sudo gedit /etc/apt/sources.list )
sudo apt-get upgrade #这一步是更新软件
更新完软件后,再继续设置吧。
有时你可能需要使用:sudo apt-get -f install 来修复安装
http://jinguo.iteye.com/blog/718617
http://jetyi.blog.51cto.com/1460128/676983
http://www.xker.com/page/e2009/0108/67820.html
【参考源列表】
#网易163更新服务器(广东广州电信/联通千兆双线接入),包含其他开源镜像:
deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
#Mirror.lupaworld.com 源更新服务器(浙江省杭州市双线服务器,网通同电信都可以用,亚洲地区官方更新服务器):
deb http://mirror.lupaworld.com/ubuntu hardy main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu hardy-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu hardy-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu hardy-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy-backports main restricted universe multiverse
#搜狐更新服务器(山东联通千兆接入,官方中国大陆地区镜像跳转至此) ,包含其他开源镜像:
deb http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
#Ubuntu 官方源 推荐北方网通用户添加
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
#台湾的官方源速度也相当不错,有时甚至快于内地的:
deb http://tw.archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu hardy-proposed main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu hardy-proposed main restricted universe multiverse
以下为有教育网接入的服务器(推荐教育网用户使用,部分非教育网用户也有可观的速度。教育网用户请优先使用IPv6地址。
中国科学技术大学更新服务器(位于合肥,千兆教育网接入,百兆电信/联通线路智能路由),由中科大 Linux 用户协会和中科大学网络信息中心维护,包含其他开源镜像,Deepin 官方服务器 实际亦指向此处:
deb http://debian.ustc.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
IPv6-Only 地址
deb http://mirrors6.ustc.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://mirrors6.ustc.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://mirrors6.ustc.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://mirrors6.ustc.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://mirrors6.ustc.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://mirrors6.ustc.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://mirrors6.ustc.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://mirrors6.ustc.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://mirrors6.ustc.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://mirrors6.ustc.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
清华大学更新服务器,(教育网核心节点百兆接入,已计划提高到千兆)由清华大学学生网管会维护。包含其他开源镜像:
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
IPv4-Only 地址
deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
IPv6-Only 地址
deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://mirrors.6.tuna.tsinghua.edu.cn//ubuntu/ precise-security main multiverse restricted universe deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
北京交通大学更新服务器(教育网/电信百兆接入),由北京交通大学信息中心赞助,包含其他开源镜像。
(域名中的 bjtu 可以替换为 njtu ,即北交旧名“北方交通大学”对应域名) :
deb http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
IPv6-Only 地址
deb http://mirror6.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://mirror6.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://mirror6.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://mirror6.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://mirror6.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://mirror6.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://mirror6.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://mirror6.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://mirror6.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://mirror6.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
北京理工大学更新服务器(仅教育网可以访问),包含其他开源镜像:
deb http://mirror.bit.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://mirror.bit.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://mirror.bit.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb http://mirror.bit.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb http://mirror.bit.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://mirror.bit.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://mirror.bit.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://mirror.bit.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://mirror.bit.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirror.bit.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
IPv6-Only 地址
deb http://mirror.bit6.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://mirror.bit6.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://mirror.bit6.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb http://mirror.bit6.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb http://mirror.bit6.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://mirror.bit6.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://mirror.bit6.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://mirror.bit6.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://mirror.bit6.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirror.bit6.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
天津大学更新服务器,由天津大学信息与网络协会和天津大学自由软件联盟维护,包含其他开源镜像 (校外限 IPv6 访问)
(域名可以替换为 jx.tju.zyrj.org 或 jx6.tju.zyrj.org)
deb http://mirror.tju.edu.cn/ubuntu/ oneiric main restricted universe multiverse deb http://mirror.tju.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse deb http://mirror.tju.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse deb http://mirror.tju.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse deb http://mirror.tju.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse deb-src http://mirror.tju.edu.cn/ubuntu/ oneiric main restricted universe multiverse deb-src http://mirror.tju.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse deb-src http://mirror.tju.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse deb-src http://mirror.tju.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse deb-src http://mirror.tju.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
青岛大学更新服务器(教育网/山东青岛移动专线双线服务器),由 OSQDU维护,位于青岛大学。包含开源镜像和Opera、马克思主义文库等其他镜像。:
deb http://mirror.qdu.edu.cn/ubuntu precise main restricted universe multiverse deb http://mirror.qdu.edu.cn/ubuntu precise-security main restricted universe multiverse deb http://mirror.qdu.edu.cn/ubuntu precise-updates main restricted universe multiverse deb http://mirror.qdu.edu.cn/ubuntu precise-backports main restricted universe multiverse deb http://mirror.qdu.edu.cn/ubuntu precise-proposed main restricted universe multiverse deb-src http://mirror.qdu.edu.cn/ubuntu precise main restricted universe multiverse deb-src http://mirror.qdu.edu.cn/ubuntu precise-security main restricted universe multiverse deb-src http://mirror.qdu.edu.cn/ubuntu precise-updates main restricted universe multiverse deb-src http://mirror.qdu.edu.cn/ubuntu precise-backports main restricted universe multiverse deb-src http://mirror.qdu.edu.cn/ubuntu precise-proposed main restricted universe multiverse
东北大学更新服务器,包含其他开源镜像:
deb http://ftp.neu.edu.cn/mirrors/ubuntu/ precise main multiverse restricted universe deb http://ftp.neu.edu.cn/mirrors/ubuntu/ precise-backports main multiverse restricted universe deb http://ftp.neu.edu.cn/mirrors/ubuntu/ precise-proposed main multiverse restricted universe deb http://ftp.neu.edu.cn/mirrors/ubuntu/ precise-security main multiverse restricted universe deb http://ftp.neu.edu.cn/mirrors/ubuntu/ precise-updates main multiverse restricted universe deb-src http://ftp.neu.edu.cn/mirrors/ubuntu/ precise main multiverse restricted universe deb-src http://ftp.neu.edu.cn/mirrors/ubuntu/ precise-backports main multiverse restricted universe deb-src http://ftp.neu.edu.cn/mirrors/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://ftp.neu.edu.cn/mirrors/ubuntu/ precise-security main multiverse restricted universe deb-src http://ftp.neu.edu.cn/mirrors/ubuntu/ precise-updates main multiverse restricted universe
IPv6-Only 地址
deb http://ftp.neu6.edu.cn/mirrors/ precise main multiverse restricted universe deb http://ftp.neu6.edu.cn/mirrors/ precise-backports main multiverse restricted universe deb http://ftp.neu6.edu.cn/mirrors/ precise-proposed main multiverse restricted universe deb http://ftp.neu6.edu.cn/mirrors/ precise-security main multiverse restricted universe deb http://ftp.neu6.edu.cn/mirrors/ precise-updates main multiverse restricted universe deb-src http://ftp.neu6.edu.cn/mirrors/ precise main multiverse restricted universe deb-src http://ftp.neu6.edu.cn/mirrors/ precise-backports main multiverse restricted universe deb-src http://ftp.neu6.edu.cn/mirrors/ precise-proposed main multiverse restricted universe deb-src http://ftp.neu6.edu.cn/mirrors/ precise-security main multiverse restricted universe deb-src http://ftp.neu6.edu.cn/mirrors/ precise-updates main multiverse restricted universe
哈尔滨工业大学更新服务器,包含其他开源镜像:
deb http://run.hit.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://run.hit.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://run.hit.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb http://run.hit.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb http://run.hit.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://run.hit.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
IPv6-Only地址
deb http://run6.hit.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://run6.hit.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://run6.hit.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb http://run6.hit.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb http://run6.hit.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://run6.hit.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://run6.hit.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://run6.hit.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://run6.hit.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://run6.hit.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
大连理工大学更新服务器,包含其他开源镜像:
( IPv4/v6 Both )
deb http://mirror.dlut.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://mirror.dlut.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb http://mirror.dlut.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb http://mirror.dlut.edu.cn/ubuntu/ubuntu precise-backports main restricted universe multiverse deb http://mirror.dlut.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse deb-src http://mirror.dlut.edu.cn/ubuntu/ precise main restricted universe multiverse deb-src http://mirror.dlut.edu.cn/ubuntu/ precise-security main restricted universe multiverse deb-src http://mirror.dlut.edu.cn/ubuntu/ precise-updates main restricted universe multiverse deb-src http://mirror.dlut.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb-src http://mirror.dlut.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
上海交通大学更新服务器(教育网千兆接入,联通/电信线路情况不详),包含其他开源镜像:
deb http://ftp.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
IPv6-Only 地址
deb http://ftp6.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://ftp6.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://ftp6.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://ftp6.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://ftp6.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://ftp6.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://ftp6.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://ftp6.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://ftp6.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://ftp6.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
厦门大学更新服务器,由厦门大学信息与网络中心维护,包含其他开源镜像:
( IPv4/v6 Both )
deb http://mirrors.xmu.edu.cn/ubuntu/archive/ precise main restricted universe multiverse deb http://mirrors.xmu.edu.cn/ubuntu/archive/ precise-backports restricted universe multiverse deb http://mirrors.xmu.edu.cn/ubuntu/archive/ precise-proposed main restricted universe multiverse deb http://mirrors.xmu.edu.cn/ubuntu/archive/ precise-security main restricted universe multiverse deb http://mirrors.xmu.edu.cn/ubuntu/archive/ precise-updates main restricted universe multiverse deb-src http://mirrors.xmu.edu.cn/ubuntu/archive/ precise main restricted universe multiverse deb-src http://mirrors.xmu.edu.cn/ubuntu/archive/ precise-backports main restricted universe multiverse deb-src http://mirrors.xmu.edu.cn/ubuntu/archive/ precise-proposed main restricted universe multiverse deb-src http://mirrors.xmu.edu.cn/ubuntu/archive/ precise-security main restricted universe multiverse deb-src http://mirrors.xmu.edu.cn/ubuntu/archive/ precise-updates main restricted universe multiverse
成都市电子科技大学更新服务器,由电子科大学生宿舍网管会维护。仅包括 Ubuntu 镜像:
( IPv4-Only )
(如下列地址不通,可换用 uestc.edu.cn 域名尝试)
deb http://ubuntu.dormforce.net/ubuntu/ precise main multiverse restricted universe deb http://ubuntu.dormforce.net/ubuntu/ precise-backports main multiverse restricted universe deb http://ubuntu.dormforce.net/ubuntu/ precise-proposed main multiverse restricted universe deb http://ubuntu.dormforce.net/ubuntu/ precise-security main multiverse restricted universe deb http://ubuntu.dormforce.net/ubuntu/ precise-updates main multiverse restricted universe deb-src http://ubuntu.dormforce.net/ubuntu/ precise main multiverse restricted universe deb-src http://ubuntu.dormforce.net/ubuntu/ precise-backports main multiverse restricted universe deb-src http://ubuntu.dormforce.net/ubuntu/ precise-proposed main multiverse restricted universe deb-src http://ubuntu.dormforce.net/ubuntu/ precise-security main multiverse restricted universe deb-src http://ubuntu.dormforce.net/ubuntu/ precise-updates main multiverse restricted universe
西南林业大学更新服务器,只包括当前稳定版和开发版,不包括 LTS 镜像。由西南林业大学计信学院维护。包括 Debian 镜像:
deb http://cs3.swfu.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://cs3.swfu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb http://cs3.swfu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe deb http://cs3.swfu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb http://cs3.swfu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe deb-src http://cs3.swfu.edu.cn/ubuntu/ precise main multiverse restricted universe deb-src http://cs3.swfu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe deb-src http://cs3.swfu.edu.cnubuntu/ precise-proposed main multiverse restricted universe deb-src http://cs3.swfu.edu.cn/ubuntu/ precise-security main multiverse restricted universe deb-src http://cs3.swfu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
添加完国内源之后,当然最好还是在国内源后面再添加一个官方的源了:
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
Fetched 374MB in 19min 56s (313kB/s)
E: Internal Error, Could not perform immediate configuration (2) on upstart【已解决】
解决方法:
http://wiki.ubuntu.com.cn/index.php?title=UbuntuManual:Ubuntu_%E8%BD%AF%E4%BB%B6%E5%8C%85%E7%AE%A1%E7%90%86&variant=zh-hans#.E8.BD.AC.E6.8D.A2.E6.88.96.E5.AE.89.E8.A3.85.E5.A4.96.E6.9D.A5.E7.9A.84.E4.BA.8C.E8.BF.9B.E5.88.B6.E8.BD.AF.E4.BB.B6.E5.8C.85
从 edgy/dapper 进行升级时可能出现 升级, 第 5.3 节 中提到的软件包关联问题。多数情况下,是因为升级的软件包所需的新增的关联包没有安装。可使用如下方法解决:
# aptitude dist-upgrade
如果这招无效,可以重复下面的方法至到问题解决:
# aptitude -f upgrade # 即使遇到错误也继续 upgrade
... 或
# aptitude -f dist-upgrade # 即使遇到错误也继续 dist-upgrade
一些的确存在问题的升级脚本会引起持续出错。最好的解决方法是检查该软件包的安装脚本 /var/lib/dpkg/info/packagename.{post-,pre-}{install,removal} 然后运行:
# dpkg --configure -a # 配置所有安装的软件包
如果脚本报告缺少配置文件,查看一下 /etc 中相关的配置文件。如果配置文件有 .dpkg-new 扩展名(或其它类似的扩展名),去掉(mv)它的扩展名。
从 edgy/dapper 进行升级时可能出现软件包关联问题。可用这个方法智取:
# aptitude -f install package # 重载坏关联
还可以用 equivs 包来解决此类问题。参阅 /usr/share/doc/equivs/README.Debian 和 equivs 软件包, 第 6.5.2 节。
E:Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) 【已解决】
解决方法:
出现这个问题的原因可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因,可能是上次安装时没正常完成,而导致出现此状况。
解决方法:
1、
输入以下命令
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
之后再安装想装的包,即可解决
2、
今天玩ubuntu的时候,在弄更新源的时候,突然出现以下错误:
[1]+ Stopped sudo apt-get update
haiquan@haiquan-desktop:~$ sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the list directory
开始以为是权限不够,就是用 sudo apt-get update,发现还是报错,问题没有解决。于是上网搜索了一下,答案如下:
问题应该是之前那个更新被强制取消的问题,进程仍然还在。用这个命令查看一下:
ps -e | grep apt
显示结果如下:
6362 ? 00:00:00 apt
6934 ? 00:00:00 apt-get
7368 ? 00:00:00 synaptic
然后就执行
sudo killall apt
sudo killall apt-get
sudo killall synaptic
再次在终端里查看ps -e | grep apt 没有任何结果了
继续执行sudo apt-get update
OK!