学习ROS第三天,准备在ubuntu上装ROS。
Ubuntu:32位、版本号:12.04。
问题一:
百度啊百度,-》http://blog.csdn.net/xiaocainiaoshangxiao/article/details/13288515 根据博主的建议又来到了ubuntu软件源的文章http://blog.csdn.net/xiaocainiaoshangxiao/article/details/13289495。我根据博主的方法,本以为就两行命令so easy的事情,却搞得各种错,技术菜。鄙视一下自己。
过程如下:
1、在终端输入命令:
[html] view plaincopy
sudo gedit /etc/apt/sources.list
2、然后将打开的文件中的内容全部都清空,如果您不放心的话,可以先将这个文件备份一下。然后挑选如下的一个或者几个源复制进去就可以了。(后来接收大神的意见,在使用GUI图形界面时候选了中科大的源)
#中国科技大学
[html] view plaincopy
deb http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-backports restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
3、关闭文件,在终端输入[html] view plaincopy
sudo apt-get update
悲剧了悲剧了,
[html] view plaincopy
-
<span style="font-family: 'Microsoft YaHei'; font-size: 14px;">W: Failed to fetch http://mirrors.sohu.com/ubuntu/dists/precise/universe/i18n/Index No Hash entry in Release file /var/lib/apt/lists/partial/mirrors.sohu.com_ubuntu_dists_precise_universe_i18n_Index W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.sohu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages Hash Sum mismatch W: Failed to fetch bzip2:/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages Hash Sum mismatch E: Some index files failed to download. They have been ignored, or old ones used instead.</span>
解决办法:类似于http://www.cnblogs.com/arrongao/archive/2012/12/15/Hash_Sum_mismatch_key.html http://www.cnblogs.com/arrongao/archive/2012/12/15/Hash_Sum_mismatch_key.html。
将/var/lib/apt/lists/partial/下的所有文件删除,但是这可以解决大部分问题,个别源不能解决,如"/var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages",无耐进入/var/lib/apt/lists/将对应的文件删除
sudo rm /var/lib/apt/lists/partial/* -vRf
此博主注:经过长时间的实践,这个解决方法不是万能的,最终解决方法还是FQ吧。 But why?不过对于我这种情况还是蛮有用的。
问题二:
在我还没找大神帮忙的时候,我仔细研读了ROS WIKI提供的资料,主要还是看了命令界面的操作。
https://help.ubuntu.com/community/Repositories/CommandLine。其中
<span style="font-family:Microsoft YaHei;font-size:14px;"><strong>Other Versions</strong>
IconsPage/note.png For other Ubuntu releases you would replace the '<strong>saucy</strong>' with the current version you have installed ('precise', 'quantal', 'raring', 'saucy', 'trusty', ...) Type <strong>lsb_release -sc</strong> to find out your release.
<strong>Adding Repositories</strong>
Adding the Universe and Multiverse Repositories
Additional software repositories such as Universe and Multiverse can be enabled by uncommenting the corresponding apt lines (i.e. delete the '#' at the beginning of the line). For Universe, uncomment those lines:
<em>deb http://us.archive.ubuntu.com/ubuntu/ saucy universe
deb-src http://us.archive.ubuntu.com/ubuntu/ saucy universe
deb http://us.archive.ubuntu.com/ubuntu/ saucy-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ saucy-updates universe</em>
There are four similar lines for 'multiverse'.
OR you may use the add-apt-repository command. If your release is 'saucy':
<em>sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ saucy universe multiverse"
sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ saucy-updates universe multiverse"</em></span>
<span style="font-family:Microsoft YaHei;font-size:14px;"><strong>lsb_release -sc</strong></span>
结果为precise。具体啥意思,我也不太懂。先放一下。
我将所有的precise改为saucy
<span style="font-family: 'Microsoft YaHei'; font-size: 14px;"><strong>lsb_release -sc</strong></span>
结果依然为precise。无爱。最终.......