解决E: Unable to locate package XXX
Posted 南柯Dream丶
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决E: Unable to locate package XXX相关的知识,希望对你有一定的参考价值。
- 首先尝试update命令
sudo apt-get update - 如果不行则执行upgrade
sudo apt-get upgrade
上述命令成功以后就能正常使用
sudo apt-get install xxxxx - 最后上面两项都不行则尝试
sudo apt-get install aptitude
成功以后使用
sudo aptitude install xxxxx - 另外还可以
sudo apt-get install python-你要安装的包的名字
ubuntu16.04 apt-get 报错:E: Unable to locate package update(E: Unable to locate package upgrade)(没解决)(
如题:
[root@ubuntu /home/arnold]7# apt-get install update
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package update
解决办法:
点close,不要点revert(恢复)!
我也不知道解决没有,,之前最初的指令好像写错了,应该是:sudo apt-get update
,,中间不需要install,,
现在我是用apt-get install update
和apt-get install upgrade
倒是正常,,,更新了很多包
但是我后面执行的时候还是发现不行哎!!!
[root@ubuntu /home/arnold]5# apt-get install update
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package update
[root@ubuntu /home/arnold]6#
[root@ubuntu /home/arnold]6# apt-get install upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package upgrade
但是我安装包的时候倒是没有报那个错误!!!
[root@ubuntu /home/arnold]7# sudo apt-get install vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libpango1.0-0 libpangox-1.0-0
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
vsftpd
0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded.
Need to get 115 kB of archives.
After this operation, 336 kB of additional disk space will be used.
Get:1 http://mirrors.ustc.edu.cn/ubuntu xenial/main amd64 vsftpd amd64 3.0.3-3ubuntu2 [115 kB]
Fetched 115 kB in 0s (336 kB/s)
Preconfiguring packages ...
Selecting previously unselected package vsftpd.
(Reading database ... 212893 files and directories currently installed.)
Preparing to unpack .../vsftpd_3.0.3-3ubuntu2_amd64.deb ...
Unpacking vsftpd (3.0.3-3ubuntu2) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.31) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up vsftpd (3.0.3-3ubuntu2) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.31) ...
[root@ubuntu /home/arnold]8#
参考文章1:如何从根本上解决E: Unable to locate package错误的方法
参考文章2:Ubuntu install 错误 E:Unable to locate package
还是解决不了,,,,在网上都找不到关于E: Unable to locate package update(E: Unable to locate package upgrade)
的报错解决方法,全是E: Unable to locate package
的!!!!
想卸载一个包,发现怎么都卸载不掉,报E: Unable to locate package(后来发现我压根没装这包,我是装的vsftpd!!!)
[root@ubuntu /home/arnold]15# apt-get remove vsftp
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package vsftp
[root@ubuntu /home/arnold]16#
看来这个问题必须解决才行
我参考 ubuntu18.04 E: Unable to locate package *错误 方法试试
- 1、删除/var/lib/apt/periodic文件夹下所有文件(删除前先备份)
[root@ubuntu /home/arnold]16# cd /var/lib/apt/periodic/
[root@ubuntu /var/lib/apt/periodic]17# ls
download-upgradeable-stamp update-stamp upgrade-stamp
unattended-upgrades-stamp update-success-stamp
[root@ubuntu /var/lib/apt/periodic]18# cd ..
[root@ubuntu /var/lib/apt]19# tar cvzf periodic.tar periodic/
periodic/
periodic/upgrade-stamp
periodic/download-upgradeable-stamp
periodic/unattended-upgrades-stamp
periodic/update-stamp
periodic/update-success-stamp
[root@ubuntu /var/lib/apt]20# ls
cdroms.list extended_states lists periodic
daily_lock keyrings mirrors periodic.tar
[root@ubuntu /var/lib/apt]21# cd periodic
[root@ubuntu /var/lib/apt/periodic]22# rm * -rf
[root@ubuntu /var/lib/apt/periodic]23# ls
[root@ubuntu /var/lib/apt/periodic]24#
- 2、更换sources.list下载地址
跳过
暂停暂停!!问题暂时消除
以上是关于解决E: Unable to locate package XXX的主要内容,如果未能解决你的问题,请参考以下文章
问题解决:“E: Unable to locate package sysv-rc-conf“
E: Unable to locate package gcc
已解决E: Unable to locate package ros-kinetic-desktop-full
解决Ubuntu18.04安装ros报错E: Unable to locate package ros-melodic-desktop-full