Ubuntu16.4关于apt功能update忽略所有文件问题的解决方案
1.问题出现
前几天使用ubuntu进行arm的学习,发现其apt功能无法使用,输入sudo apt-get update指令总是显示忽略所有文件,如下图所示:

2.尝试解决解决方案
首先在CSDN上搜索相关帖子也问过相关工程师,其中大多数的反馈是这样的,即大致流程是使用ubuntu的图形化界面中的设置-》软件与更新-》让其自动查找最佳服务器进行换源操作。
CSDN上推荐解决方案
但这个方法我尝试后发现还是不是,它一直卡死在更新缓存上。

所以网上推荐的方法对我不管用,但仔细分析其实也是,因为使用上述方法,相当于还是需要使用好的源来加载相关功能,既然本身apt功能就不能使用了。自然此方法也不管用了。
3. 解决方案
1.问题本质——源的原因
最开始我以为是此ubuntu系统的原因,于是我在另一台电脑上重装了一个新的ubuntu系统,使用系统默认源进行apt,此时功能是正常的。然后我换成清华的源就又出现上述问题了,然后我又把源改成系统的源就又功能正常了。而且我将系统最初始的source.list文件(里面包含系统最初的使用源)拷贝出来,将之前的ubuntu中的source.list中的信息更改为我拷贝出来源信息,然后之前的ubuntu中的apt功能就正常运行了。所以得出结论,由于源的问题导致apt功能无法使用,我之前使用的是清华镜像源,但我之前用的好好的,现在不知道为什么用不了了。
2.解决方案
1.首先你先需要把自己ubuntu中的source.list信息改成最初系统自带的版本,保证此时apt功能可用(速度比较慢)。
source.list信息如下:
#deb cdrom:[Ubuntu 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
2.更换成国内源
1步骤完成后,apt功能可以正常运行,但肯定不能使用国外源,网速太慢,所以需要换成国内源。可按照此博客链接进行
步骤二换国内源



最后,完成上述操作后,ubuntu的apt功能可以正常运行,且换成了国内源。

至此,Ubuntu16.4关于apt功能update忽略所有文件的问题解决!
本文详细介绍了在Ubuntu16.4中遇到apt功能update忽略所有文件的问题及其解决方案。问题根源在于源设置,通过恢复系统初始source.list文件并切换到国内源,成功解决了无法使用apt-get update的问题。

1992

被折叠的 条评论
为什么被折叠?



