ubuntu16.04 apt-get 报错:E: Unable to locate package update(E: Unable to locate package upgrade)(没解决)(

Posted Dontla

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 updateapt-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下载地址
    跳过

暂停暂停!!问题暂时消除

以上是关于ubuntu16.04 apt-get 报错:E: Unable to locate package update(E: Unable to locate package upgrade)(没解决)(的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu使用apt-get安装软件,出现报错Err:1 http://security.ubuntu.com

Ubuntu 16.04 apt-get搭建LAMP环境

Ubuntu 16.04配置国内高速apt-get更新源

Restore Apt-get In Ubuntu16.04

我在 Ubuntu 16.04 上运行 apt-get update 时无法解决“代理”错误

ubuntu apt-get update 失败解决