最近刚开始接触Linux,在虚拟机中装了个Ubuntu,当前的版本是Ubuntu 11.10,装好后自然少不了安装一些软件,在设置了软件的源后,就开始了 sudo apt-get install,结果出现了下面的Unable to locate package错误:
- letuknowit@ubuntu:~$ sudo apt-get install mysql-server mysql-client
- [sudo] password for letuknowit:
- Reading package lists… Done
- Building dependency tree
- Reading state information… Done
- E: Unable to locate package mysql-server
- E: Unable to locate package mysql-client
- letuknowit@ubuntu:~$
这叫一个郁闷啊,出师不利,不带这么吓唬刚玩Ubuntu的小朋友吧~于是赶紧找资料,又回顾下前面的操作,最后发现问题出在执行sudo apt-get install之前更换了软件源,但是却忘了update下了,于是执行下面的命令:
- sudo apt-get update
等上面命令执行完后,再执行sudo apt-get install就可以了!其实错误信息已经很明确了,Unable to locate packet就是无法找到包嘛,那还不赶紧sudo apt-get update下!
转载请注明:Coding Ants » Linux新手入门:Unable to locate package错误解决办法
看不懂,学习了!!!
Warning: copy(http://0.gravatar.com/avatar/a3b79d747c97c99173795031dc8fe5e0?s=36&d=http%3A%2F%2Fwww.letuknowit.com%2Ftopics%2Favatar%2Fdefault.png%3Fs%3D36&r=G) [function.copy]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/letuknow/domains/letuknowit.com/public_html/topics/wp-content/themes/d4/inc/function-opt.php on line 531
thanks. it’s helpful to me:)
有时间应该看看。。到底是啥区别。。
现在问题是 :sudo apt-get update 执行这个 也报错 E: Unable to locate package 。如何解决?
确认下包的名字是否正确
我这也是这样的,最后怎么解决的啊。。。。
Warning: copy(http://1.gravatar.com/avatar/5a9ee5fa199b569fa53455d5facb30de?s=36&d=http%3A%2F%2Fwww.letuknowit.com%2Ftopics%2Favatar%2Fdefault.png%3Fs%3D36&r=G) [function.copy]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/letuknow/domains/letuknowit.com/public_html/topics/wp-content/themes/d4/inc/function-opt.php on line 531
执行命令:sudo apt-get install
Warning: copy(http://1.gravatar.com/avatar/5a9ee5fa199b569fa53455d5facb30de?s=36&d=http%3A%2F%2Fwww.letuknowit.com%2Ftopics%2Favatar%2Fdefault.png%3Fs%3D36&r=G) [function.copy]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/letuknow/domains/letuknowit.com/public_html/topics/wp-content/themes/d4/inc/function-opt.php on line 531
或许 你们不是Ubuntu的
apt-get upgrade
Warning: copy(http://1.gravatar.com/avatar/3962737e0c3d79065cfffa624d0d0e7e?s=36&d=http%3A%2F%2Fwww.letuknowit.com%2Ftopics%2Favatar%2Fdefault.png%3Fs%3D36&r=G) [function.copy]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in /home/letuknow/domains/letuknowit.com/public_html/topics/wp-content/themes/d4/inc/function-opt.php on line 531
sudo apt-get update
sudo apt-get upgrade
之后,还是会出现那个问题,咋办。还是没法安装。