Ubuntu sudo apt-get update提示 Failed to fetch,解决办法
2023-09-11 14:21:04 时间
问题:
执行sudo apt-get update提示:Failed to fetch
chen@ubuntu:~/soft/Python-2.7.12$ sudo apt-get update Get:1 http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu xenial InRelease [2,281 B] Err:1 http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu xenial InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Fetched 2,281 B in 0s (4,524 B/s) Reading package lists... Done E: Failed to fetch http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu/dists/xenial/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Some index files failed to download. They have been ignored, or old ones used instead.
但是在虚拟机里面直接访问:http://ppa.launchpad.net/fkrull/deadsnakes-python2.7/ubuntu 是可以的啊
一、删除文件
sudo rm -rf /var/lib/apt/lists
二、删除所有源
三、修改源
sudo vi /etc/apt/sources.list
里面写入163的源
deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
查看源
四、测试
再次sudo apt-get update
提示如下:
guchen@ubuntu:~/soft/Python-2.7.12$ sudo apt-get update Get:1 http://mirrors.163.com/ubuntu xenial InRelease [2,281 B] Get:2 http://mirrors.163.com/ubuntu xenial-security InRelease [2,281 B] Err:1 http://mirrors.163.com/ubuntu xenial InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Err:2 http://mirrors.163.com/ubuntu xenial-security InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Get:3 http://mirrors.163.com/ubuntu xenial-updates InRelease [2,281 B] Err:3 http://mirrors.163.com/ubuntu xenial-updates InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Get:4 http://mirrors.163.com/ubuntu xenial-proposed InRelease [2,281 B] Err:4 http://mirrors.163.com/ubuntu xenial-proposed InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Get:5 http://mirrors.163.com/ubuntu xenial-backports InRelease [2,281 B] Err:5 http://mirrors.163.com/ubuntu xenial-backports InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Fetched 9,124 B in 0s (19.8 kB/s) Reading package lists... Done E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial-security/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial-updates/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial-proposed/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Failed to fetch http://mirrors.163.com/ubuntu/dists/xenial-backports/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) E: Some index files failed to download. They have been ignored, or old ones used instead.
五、切换认证
怎么还提示:does the network require authentication?
需要权限??
解决方法:将software$updates中的Authentication换一个试试
六、成功
最后再执行一下:
sudo apt-get clean
sudo apt-get update
guchen@ubuntu:~/soft/Python-2.7.12$ sudo apt-get update Get:1 http://mirrors.163.com/ubuntu xenial InRelease [247 kB] Get:2 http://mirrors.163.com/ubuntu xenial-security InRelease [107 kB] Get:3 http://mirrors.163.com/ubuntu xenial-updates InRelease [109 kB] Get:4 http://mirrors.163.com/ubuntu xenial-proposed InRelease [260 kB] Get:5 http://mirrors.163.com/ubuntu xenial-backports InRelease [107 kB] Get:6 http://mirrors.163.com/ubuntu xenial/main Sources [868 kB] Get:7 http://mirrors.163.com/ubuntu xenial/restricted Sources [4,808 B] Get:8 http://mirrors.163.com/ubuntu xenial/universe Sources [7,728 kB] Get:9 http://mirrors.163.com/ubuntu xenial/multiverse Sources [179 kB] Get:10 http://mirrors.163.com/ubuntu xenial/main amd64 Packages [1,201 kB] Get:11 http://mirrors.163.com/ubuntu xenial/main i386 Packages [1,196 kB] Get:12 http://mirrors.163.com/ubuntu xenial/main Translation-en [568 kB] Get:13 http://mirrors.163.com/ubuntu xenial/main amd64 DEP-11 Metadata [733 kB] Get:14 http://mirrors.163.com/ubuntu xenial/main DEP-11 64x64 Icons [409 kB] Get:15 http://mirrors.163.com/ubuntu xenial/restricted amd64 Packages [8,344 B] Get:16 http://mirrors.163.com/ubuntu xenial/restricted i386 Packages [8,684 B] Get:17 http://mirrors.163.com/ubuntu xenial/restricted Translation-en [2,908 B] Get:18 http://mirrors.163.com/ubuntu xenial/restricted amd64 DEP-11 Metadata [186 B] Get:19 http://mirrors.163.com/ubuntu xenial/universe amd64 Packages [7,532 kB] Get:102 http://mirrors.163.com/ubuntu xenial-backports/universe DEP-11 64x64 Icons [1,789 B] Get:103 http://mirrors.163.com/ubuntu xenial-backports/multiverse amd64 DEP-11 Metadata [216 B] Get:104 http://mirrors.163.com/ubuntu xenial-backports/multiverse DEP-11 64x64 Icons [29 B] Fetched 53.4 MB in 18s (2,849 kB/s) AppStream cache update completed, but some metadata was ignored due to errors. Reading package lists... Done
终于搞定啦
备注:
最好把DNS设置一下
sudo vi /etc/resolv.conf
在里面添加
nameserver 8.8.8.8
重启网络服务
sudo service networking restart
相关文章
- 【Ubuntu】ubuntu更新设置
- 移动MM failed to find resource file{mmiap.xml}
- Ubuntu nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
- 【RAC】How to Proceed from Failed 11gR2 CRS Installation
- 解决问题 The Tomcat connector configured to listen on port 8080 failed to start.
- JAVA Eclipse 启动 Eclipse 弹出“Failed to load the JNI shared library jvm_dll”怎么办
- dns未设置 PHP Warning: file_get_contents():php_network_getaddresses: getaddrinfo failed:
- Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed
- [置顶] ubuntu版本很老,apt-get update更新失败时(W: Failed to fetch ...)------如何创建新的sources.list
- frida环境问题解决Failed to enumerate processes: this feature requires an iOS Developer Disk Image to be mounted;
- Error: Failed to connect to MySQL server: DBI connect(';
- EasyPusher华为手机直播推流硬编码[OMX.IMG.TOPAZ.Encoder] failed to set input port definition parameters.
- Android SDK content Loader has encountered a problem.parseSdkContent failed
- [FAQ] golang-migrate/migrate error: migration failed in line 0: (details: Error 1065: Query was empty)
- SqlCommand.DeriveParameters failed
- INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl1631409119.tmp/base.ap
- npm run dev 启动错误:Module build failed: Error: No PostCSS Config found in:xxxxxxxxxxxxxx
- Ubuntu 16.04 显卡报错NVIDIA-SMI has failed because it couldn‘t communicatewith the NVIDIA driver.....
- Ubuntu 18.04 清华更新源 Certificate verification failed
- ubuntu Ubuntu 20.04 禁止内核自动更新
- Xcode Internal launch error: process launch failed: Unspecified
- Ubuntu菜鸟入门(十一)—— windows 和 ubuntu时间冲突解决
- Failed to load resource: net::ERR_CLEARTEXT_NOT_PERMITTED