由于源配置错误导致更新失败

由于源配置错误导致更新失败

我删除了一个文件,/etc/apt/但不记得删除了什么。

当我尝试使用更新时sudo apt-get update,出现此错误:

Ign:1 http://ma.archive.ubuntu.com/ubuntu jammy InRelease                                                                                    
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease                                                                             
Ign:3 https://storage.googleapis.com/download.dartlang.org/linux/debian stable InRelease                                                     
Ign:4 https://ppa.launchpadcontent.net/dartsim/ppa/ubuntu jammy InRelease                                                                    
Ign:5 https://dl.google.com/linux/chrome/deb stable InRelease                                                                                
0% [Working]                                                                                                                                 
Get:6 http://ma.archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]                                                                   
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]                                                                    
Ign:3 https://storage.googleapis.com/download.dartlang.org/linux/debian stable InRelease                                                     
Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease                                                                                
Hit:7 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease                                                                   
Hit:8 https://storage.googleapis.com/download.dartlang.org/linux/debian stable Release                                                       
Hit:10 https://ppa.launchpadcontent.net/maarten-fonville/android-studio/ubuntu jammy InRelease                                               
Get:11 http://ma.archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]                                                               
Hit:12 https://ppa.launchpadcontent.net/ts.sch.gr/ppa/ubuntu jammy InRelease                                                                 
Ign:13 https://ppa.launchpadcontent.net/webupd8team/java/ubuntu jammy InRelease                                                              
Ign:11 http://ma.archive.ubuntu.com/ubuntu jammy-backports InRelease                          
Hit:4 https://ppa.launchpadcontent.net/dartsim/ppa/ubuntu jammy InRelease
Hit:1 http://ma.archive.ubuntu.com/ubuntu jammy InRelease   
Get:14 http://ma.archive.ubuntu.com/ubuntu jammy-updates/main amd64 DEP-11 Metadata [94.8 kB]
Get:15 http://ma.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 DEP-11 Metadata [257 kB]                  
Get:16 http://ma.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 DEP-11 Metadata [940 B]                                  
Ign:13 https://ppa.launchpadcontent.net/webupd8team/java/ubuntu jammy InRelease
Get:11 http://ma.archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]                                    
Get:17 http://ma.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [11.7 kB]
Err:18 https://ppa.launchpadcontent.net/webupd8team/java/ubuntu jammy Release
  404  Not Found [IP: 185.125.190.52 443]
Reading package lists... Done                              
E: The repository 'https://ppa.launchpadcontent.net/webupd8team/java/ubuntu jammy Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

这是我所拥有的/etc/apt/

apt.conf.d  auth.conf.d  keyrings  preferences.d  sources.list  sources.list.d  trusted.gpg.d

答案1

  1. 按下 win 键(= Super 键)并开始输入,software & updates 很快你就会看到一个粉红色的图标;单击它。
  2. 在出现的窗口中,单击Other software(顶部的选项卡)
  3. 找到ppa.launchpadcontent.net/webupd8team/java/(或类似的东西)并删除其左侧的勾号。它应该是一行。
  4. $ sudo apt update && sudo apt upgrade 或者再次按下 Super 键,开始输入并在出现时update单击。Update softw...

注意:这是针对 20.04 / focal fossa 的,可能与 22.04 / jammy jellyfish 略有不同

相关内容