无法再使用 sudo apt update。正在运行 20.04

无法再使用 sudo apt update。正在运行 20.04

尝试安装 wine 但遇到错误:

跑步lsb_release可得:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:        21.04
Codename:       hirsute
vnc@CustomSite:/etc/apt$ sudo apt-get update
Hit:1 http://mirrors.digitalocean.com/ubuntu hirsute InRelease
Hit:2 https://dl.winehq.org/wine-builds/ubuntu focal InRelease
Hit:3 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease
Ign:4 https://packages.sury.org/php hirsute InRelease
Hit:5 https://dl.winehq.org/wine-builds/ubuntu hirsute InRelease
Err:6 https://packages.sury.org/php hirsute Release
  404  Not Found [IP: 2606:4700:3030::ac43:b696 443]
Ign:7 http://ppa.launchpad.net/boost-latest/ppa/ubuntu hirsute InRelease
Ign:8 http://ppa.launchpad.net/jonathonf/wine/ubuntu hirsute InRelease
Err:9 http://ppa.launchpad.net/boost-latest/ppa/ubuntu hirsute Release
  404  Not Found [IP: 2001:67c:1560:8008::19 80]
Err:10 http://ppa.launchpad.net/jonathonf/wine/ubuntu hirsute Release
  404  Not Found [IP: 2001:67c:1560:8008::19 80]
Reading package lists... Done
E: The repository 'https://packages.sury.org/php hirsute 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.
E: The repository 'http://ppa.launchpad.net/boost-latest/ppa/ubuntu hirsute 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.
E: The repository 'http://ppa.launchpad.net/jonathonf/wine/ubuntu hirsute 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.

nano sources.list给出:

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb [trusted=yes] http://mirrors.digitalocean.com/ubuntu/ hirsute main restricted
# deb-src http://mirrors.digitalocean.com/ubuntu/ hirsute main restricted

请帮助我解决这个错误。

谢谢。

答案1

您的 Ubuntu 21.04 中第三方存储库存在一些问题。
要修复它们:

  1. 禁用 PPA:

    sudo add-apt-repository -r ppa:boost-latest/ppa
    sudo add-apt-repository -r ppa:jonathonf/wine
    
  2. 禁用https://packages.sury.org/php您必须使用 来找到它的文件grep -r packages.sury.org /etc/apt --include=*.list

    在你的情况下运行:

    sudo nano /etc/apt/sources.list.d/php.list
    

    并放置#在线上deb packages.sury.org/php hirsute main,然后按Ctrl+O保存,按Ctrl+x关闭。

  3. 恢复正常默认存储库 - 将以下内容放入/etc/apt/sources.list

    deb http://archive.ubuntu.com/ubuntu/ hirsute main universe multiverse restricted
    deb http://archive.ubuntu.com/ubuntu/ hirsute-updates main multiverse universe restricted
    deb http://archive.ubuntu.com/ubuntu/ hirsute-security main universe multiverse restricted
    

    用以下方式替换行数字海洋

  4. 跑步sudo apt-get update

  5. 按照计划从官方存储库安装 Wine

    sudo add-apt-repository universe
    sudo rm /etc/apt/sources.list.d/archive_uri* # we remove winehq here
    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo apt install wine64 wine32:i386
    

相关内容