Ubuntu仓库没有Release文件。

这与Xenial repository does not have a Release file类似,但那里的修复方法对我无效。
在一个几天前安装的Ubuntu 16.04上运行sudo apt-get update时,会返回以下错误信息:
    $ sudo apt-get update
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1,201 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/main i386 Packages [1,196 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/main Translation-en_GB [426 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/main Translation-en [568 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial/main amd64 DEP-11 Metadata [733 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial/main DEP-11 64x64 Icons [409 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [8,344 B]
Get:12 http://archive.ubuntu.com/ubuntu xenial/restricted i386 Packages [8,684 B]
Get:13 http://archive.ubuntu.com/ubuntu xenial/restricted Translation-en_GB [2,556 B]
Get:14 http://archive.ubuntu.com/ubuntu xenial/restricted Translation-en [2,908 B]
Get:15 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 DEP-11 Metadata [186 B]
Get:16 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [7,532 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial/universe i386 Packages [7,512 kB]                                                    
Get:18 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en_GB [3,040 kB]                                                
Get:19 http://archive.ubuntu.com/ubuntu xenial/universe Translation-en [4,354 kB]                                                   
Get:20 http://archive.ubuntu.com/ubuntu xenial/universe amd64 DEP-11 Metadata [3,410 kB]                                            
Get:21 http://archive.ubuntu.com/ubuntu xenial/universe DEP-11 64x64 Icons [7,448 kB]                                               
Get:22 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [144 kB]                                                   
Get:23 http://archive.ubuntu.com/ubuntu xenial/multiverse i386 Packages [140 kB]                                                    
Get:24 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en_GB [88.1 kB]                                               
Get:25 http://archive.ubuntu.com/ubuntu xenial/multiverse Translation-en [106 kB]                                                   
Get:26 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 DEP-11 Metadata [63.8 kB]                                           
Get:27 http://archive.ubuntu.com/ubuntu xenial/multiverse DEP-11 64x64 Icons [230 kB]                                               
Get:28 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [700 kB]                                                 
Get:29 http://archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [654 kB]                                                  
Get:30 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [292 kB]                                                 
Get:31 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [308 kB]                                          
Get:32 http://archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons [221 kB]                                             
Get:33 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [7,604 B]                                          
Get:34 http://archive.ubuntu.com/ubuntu xenial-updates/restricted i386 Packages [7,604 B]                                           
Get:35 http://archive.ubuntu.com/ubuntu xenial-updates/restricted Translation-en [2,272 B]                                          
Get:36 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 DEP-11 Metadata [157 B]                                     
Get:37 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [574 kB]                                             
Get:38 http://archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [535 kB]                                              
Get:39 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [232 kB]                                             
Get:40 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [185 kB]                                      
Get:41 http://archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [262 kB]                                         
Get:42 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [16.2 kB]                                          
Get:43 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse i386 Packages [15.3 kB]                                           
Get:44 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en [8,052 B]                                          
Get:45 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [5,888 B]                                   
Get:46 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse DEP-11 64x64 Icons [14.3 kB]                                      
Get:47 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [4,840 B]                                              
Get:48 http://archive.ubuntu.com/ubuntu xenial-backports/main i386 Packages [4,832 B]                                               
Get:49 http://archive.ubuntu.com/ubuntu xenial-backports/main Translation-en [3,220 B]                                              
Get:50 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,324 B]                                       
Get:51 http://archive.ubuntu.com/ubuntu xenial-backports/main DEP-11 64x64 Icons [29 B]                                             
Get:52 http://archive.ubuntu.com/ubuntu xenial-backports/restricted amd64 DEP-11 Metadata [194 B]                                   
Get:53 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [6,612 B]                                          
Get:54 http://archive.ubuntu.com/ubuntu xenial-backports/universe i386 Packages [6,600 B]                                           
Get:55 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [3,768 B]                                          
Get:56 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [4,712 B]                                   
Get:57 http://archive.ubuntu.com/ubuntu xenial-backports/universe DEP-11 64x64 Icons [2,716 B]                                      
Get:58 http://archive.ubuntu.com/ubuntu xenial-backports/multiverse amd64 DEP-11 Metadata [216 B]                                   
Get:59 http://archive.ubuntu.com/ubuntu xenial-backports/multiverse DEP-11 64x64 Icons [29 B]                                       
Get:60 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages [425 kB]                                                
Get:61 http://archive.ubuntu.com/ubuntu xenial-security/main i386 Packages [385 kB]                                                 
Get:62 http://archive.ubuntu.com/ubuntu xenial-security/main Translation-en [186 kB]                                                
Get:63 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [62.8 kB]                                        
Get:64 http://archive.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [66.2 kB]                                           
Get:65 http://archive.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [7,224 B]                                         
Get:66 http://archive.ubuntu.com/ubuntu xenial-security/restricted i386 Packages [7,224 B]                                          
Get:67 http://archive.ubuntu.com/ubuntu xenial-security/restricted Translation-en [2,152 B]                                         
Get:68 http://archive.ubuntu.com/ubuntu xenial-security/restricted amd64 DEP-11 Metadata [200 B]                                    
Get:69 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [196 kB]                                            
Get:70 http://archive.ubuntu.com/ubuntu xenial-security/universe i386 Packages [161 kB]                                             
Get:71 http://archive.ubuntu.com/ubuntu xenial-security/universe Translation-en [101 kB]                                            
Get:72 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [51.3 kB]                                    
Get:73 http://archive.ubuntu.com/ubuntu xenial-security/universe DEP-11 64x64 Icons [85.1 kB]                                       
Get:74 http://archive.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3,208 B]                                         
Get:75 http://archive.ubuntu.com/ubuntu xenial-security/multiverse i386 Packages [3,380 B]                                          
Get:76 http://archive.ubuntu.com/ubuntu xenial-security/multiverse Translation-en [1,408 B]                                         
Get:77 http://archive.ubuntu.com/ubuntu xenial-security/multiverse amd64 DEP-11 Metadata [212 B]                                    
Get:78 http://archive.ubuntu.com/ubuntu xenial-security/multiverse DEP-11 64x64 Icons [29 B]                                        
Fetched 45.0 MB in 28s (1,577 kB/s)                                                                                                 
Reading package lists... Error!
E: Read error - read (5: Input/output error)
W: You may want to run apt-get update to correct these problems
E: The package cache file is corrupted

/etc/apt/sources/list:

# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu xenial main restricted
# deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
# deb-src http://gb.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://archive.ubuntu.com/ubuntu xenial universe
# deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial universe
deb http://archive.ubuntu.com/ubuntu xenial-updates universe
# deb-src http://gb.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://archive.ubuntu.com/ubuntu xenial multiverse
# deb-src http://gb.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
# deb-src http://gb.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://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
# deb-src http://gb.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://archive.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://archive.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://archive.ubuntu.com/ubuntu xenial-security multiverse
deb http://archive.ubuntu.com xenial universe
# deb-src http://archive.ubuntu.com xenial universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

$ grep -nwFe Release /etc/apt/sources.list{,.d/*.list}
/etc/apt/sources.list:1:# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted

我已经尝试过使用sudo rm /var/lib/apt/lists/*命令,而且我的/etc/apt/sources/list文件中已经注释掉了第52行,并且第54行并不存在。(这两个解决方案都是我在这个论坛和其他论坛上找到的)。

请问您能否编辑一下您的问题,包括完整的终端命令输出“LC_MESSAGES=POSIX apt-get update”?谢谢。 - David Foerster
@DavidFoerster 给你。 - Adoria298
http://archive.ubuntu.com xenial Release 没有指向现有软件包仓库。请您[编辑]问题,包括 /etc/apt/sources.list 的内容以及 grep -nwFe Release /etc/apt/sources.list{,.d/*.list} 的输出。 - David Foerster
@DavidFoerster 添加了您所要求的内容。 - Adoria298
7对于投票关闭的人:我不明白这个问题怎么会不清楚。 - Gunnar Hjalmarsson
6个回答

你的 /etc/apt/sources.list 文件中倒数第三行似乎有错误:
deb http://archive.ubuntu.com xenial universe

我认为那一行代码是导致错误的原因,所以我建议你将其删除。
在这样做之后,可能需要清理软件包缓存,你可以通过运行以下命令来完成:
sudo rm -r /var/lib/apt/lists/*

然后:
sudo apt update

8我已经投票支持重新开放上述问题,该问题被错误地关闭,原因是不清楚,但实际上并非如此。 - karel
2我遇到了同样的错误。似乎是因为Ubuntu 17.04现在不再受支持。https://wiki.ubuntu.com/ZestyZapus/ReleaseNotes - Morgan Christiansson
1@MorganChristiansson:对我来说,这听起来像是一个不同的问题,即使错误信息看起来相似。 - Gunnar Hjalmarsson
使用nano编辑并删除了所述行后,现在运行sudo apt-get update会返回E: 软件包缓存文件已损坏 - Adoria298
1@Adoria298:请查看我的修改后的答案。 - Gunnar Hjalmarsson
@GunnarHjalmarsson 运行了这两个命令后,出现了相同的错误。 - Adoria298
@Adoria298: 如果你也运行 sudo rm /var/lib/apt/lists/partial/*,会有什么区别吗?如果没有的话,请再次编辑你的问题,并展示完整的 sudo apt update 输出。 - Gunnar Hjalmarsson
@GunnarHjalmarsson 很抱歉,请您能否看一下我编辑过的问题。 - Adoria298
@Adoria298:E: 读取错误 - 读取(5: 输入/输出错误)表示某种硬件问题,这超出了我的能力范围,与你最初的问题完全无关。如果问题持续存在,并且你需要进一步调查的指导,请建议你发布一个新的问题。 - Gunnar Hjalmarsson
@GunnarHjalmarsson 好的 - Adoria298
请注意,有时候解决方案只是删除缓存,可能是因为在最近的更新中您使用了代理。 - tuxErrante

在我的情况下,问题真的很愚蠢。我在服务器外没有网络访问权限。花了我相当长的时间才意识到这是我的问题;-)

4老实说,“没有发布文件”并不是应该传达的信息。它得出了一个结论,而不是陈述事实。“无法下载发布文件”才是准确的表达。这不是你的错,是别人的错。谢谢你分享这个“傻呵呵”的时刻。 ;) - TheSatinKnight

在我的情况下(16.04 LTS),远程下载服务器可能存在一些问题。我收到了一个未记录的错误通知。我更改了下载服务器,问题得到解决。我已经在另一篇帖子中记录了这个解决方案。

在Linux Mint(Ubuntu的子版本)上,问题出现在软件源->附加仓库中。安装的软件添加了一个错误版本操作系统的仓库。 - Andrew

这是在尝试安装一个没有适用于您的Ubuntu版本的软件包时常见的错误...所以解决方案是更新您的/etc/apt文件,使用先前版本的Ubuntu(顶级提示:如果您的机器的Ubuntu版本不是最新的Ubuntu LTS https://releases.ubuntu.com,则更新下面提到的文件以使用该软件包的LTS版本)。
例如,我正在使用的是Ubuntu 20.10。
 cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.10
DISTRIB_CODENAME=groovy
DISTRIB_DESCRIPTION="Ubuntu 20.10"

我看到下面的错误。
Hit:11 http://archive.ubuntu.com/ubuntu groovy-backports InRelease  
Hit:12 http://archive.ubuntu.com/ubuntu groovy-security InRelease                   
Hit:13 http://archive.ubuntu.com/ubuntu groovy-proposed InRelease                   
Hit:10 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease
Reading package lists... Done
E: The repository 'https://packages.microsoft.com/repos/azure-cli groovy 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.

这意味着该软件包没有适用于我的操作系统版本(groovy)的版本(通常情况下,软件包不会为每个Ubuntu版本提供发布版本),因此只需更新安装文件以使用先前的Ubuntu版本(良好的建议是使用最新的长期稳定版本LTS,请参见https://releases.ubuntu.com/)。
因此,由于我的机器是Ubuntu 20.10(groovy),而LTS是20.04(focal),只需通过以下方式更新,停止使用groovy,并改为使用focal...如下所示:

每两年Ubuntu都会发布一个新的LTS版本,总是在偶数年,并且只针对xx.04版本进行发布。

cd /etc/apt
grep -r azure-cli # to find offending file responsible for error

显示
sources.list.d/azure-cli.list:deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ groovy main

编辑上述文件。
sudo vi /etc/apt/sources.list.d/azure-cli.list

将提及的groovy替换为focal
cat /etc/apt/sources.list.d/azure-cli.list

# deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ groovy main
deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ focal main

好了...现在你的机器已经指向了一个好的源,让我们安装这个软件包。
sudo apt-get install azure-cli  #  

可以设置代理。
请查看以下位置:
- /etc/apt/apt.conf - /etc/apt/apt.conf.d - http_proxy 环境变量

尝试这两个命令:
sudo snap install cmake --classic
cmake --version

他们为我工作。

1这个回答是否解答了问题?如果是,请您解释一下如何解答的。 - Ben Kovitz