使用 Kubuntu 22.04 更新和升级时遇到问题

使用 Kubuntu 22.04 更新和升级时遇到问题

我正在运行sudo apt update && sudo apt upgrade并收到以下错误:

sudo apt update && sudo apt upgrade
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease                                                                                                                 
Hit:3 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease                                                                                                               
Hit:4 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease                                                                                                             
Hit:5 https://packages.microsoft.com/ubuntu/20.04/mssql-server-2022 focal InRelease                                                                                             
Hit:6 http://security.ubuntu.com/ubuntu jammy-security InRelease                                                                                                                
Ign:7 https://packages.microsoft.com/repos/microsoft-ubuntu-jammy jammy InRelease                                                                                               
Hit:8 https://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                   
Hit:9 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease                                                                                                          
Hit:10 https://dl.winehq.org/wine-builds/ubuntu jammy InRelease                                                                                                                 
Err:11 https://packages.microsoft.com/repos/microsoft-ubuntu-jammy jammy Release                                                                                 
  404  Not Found [IP: 13.90.21.104 443]
Hit:12 https://download.docker.com/linux/ubuntu jammy InRelease                                                                                                                 
Hit:13 http://repository.spotify.com stable InRelease                                                                                                                           
Hit:14 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu jammy InRelease                                                                                   
Hit:16 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease                                                     
Hit:15 https://packagecloud.io/github/git-lfs/ubuntu jammy InRelease                                         
Reading package lists... Done
E: The repository 'https://packages.microsoft.com/repos/microsoft-ubuntu-jammy 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.
W: https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

结果cat /etc/apt/sources.list

# Microsoft repository for Ubuntu jammy
deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-jammy-prod/ jammy main
 
# deb cdrom:[Kubuntu 22.04.2 LTS w_Jammy Jellyfish_ - Release amd64 (20230223)]/ jammy main multiverse restricted universe
 
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy main restricted
 
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-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://us.archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy universe
deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-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://us.archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-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://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
 
deb http://security.ubuntu.com/ubuntu jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted
deb http://security.ubuntu.com/ubuntu jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu jammy-security universe
deb http://security.ubuntu.com/ubuntu jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu jammy-security multiverse
 
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

尝试了一下sudo sed -i -e 's|impish|jammy|g' /etc/apt/sources.list,但似乎没有任何效果。另一篇帖子建议更改软件和更新上的服务器。我从本地服务器更改为主服务器,并能够获取文件。

我不知道在哪里可以找到我的软件和更新应用程序来尝试这个建议。我还想更新到 23.04,所以我不确定是否需要在更新之前完成此操作。

https://packages.microsoft.com/repos/microsoft-ubuntu-jammy带我到404 Not found屏幕前。

答案1

如果您想在 Ubuntu 中启用 Microsoft 产品:

  1. 下载 repo 配置包:
curl -sSL -O https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
  1. 安装 repo 配置包:sudo dpkg -i packages-microsoft-prod.deb

  2. 安装后删除 repo 配置包:rm packages-microsoft-prod.deb

  3. 要安装所需的 Microsoft 产品包,请使用此 Linux 存储库 (packages.microsoft.com):sudo apt-get install <package-name>

相关内容