值“jammy”对于 APT::Default-Release 无效

值“jammy”对于 APT::Default-Release 无效

在升级软件包和发布 Ubuntu 22.10 时我遇到了安装错误。

详细信息如下:

sudo do-release-upgrade

Checking for a new Ubuntu release

= Welcome to Ubuntu 23.04 'Lunar Lobster' =

The Ubuntu team is proud to announce Ubuntu 23.04 'Lunar Lobster'.

...

Continue [yN] y
Get:1 Upgrade tool signature [819 B]                                                                                                                                        
Get:2 Upgrade tool [1,260 kB]                                                                                                                                               
Fetched 1,261 kB in 0s (0 B/s)                                                                                                                                              
authenticate 'lunar.tar.gz' against 'lunar.tar.gz.gpg' 
extracting 'lunar.tar.gz'
can't load 22.04 (No module named 'DistUpgrade.22')
Error in sys.excepthook:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-lmzh0l52/DistUpgrade/DistUpgradeViewGtk3.py", line 540, in _handleException
    apport_crash(type, value, tb)
  File "/tmp/ubuntu-release-upgrader-lmzh0l52/DistUpgrade/DistUpgradeApport.py", line 57, in apport_crash
    apport_excepthook(type, value, tb)
TypeError: apport_excepthook() missing 1 required positional argument: 'exc_tb'

Original exception was:
Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-lmzh0l52/lunar", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-lmzh0l52/DistUpgrade/DistUpgradeMain.py", line 238, in main
    save_system_state(logdir)
  File "/tmp/ubuntu-release-upgrader-lmzh0l52/DistUpgrade/DistUpgradeMain.py", line 125, in save_system_state
    clone.save_state(sourcedir="/", target=target, with_dpkg_status=True,
  File "/tmp/ubuntu-release-upgrader-lmzh0l52/DistUpgrade/apt_clone.py", line 154, in save_state
    self._write_state_installed_pkgs(sourcedir, tar)
  File "/tmp/ubuntu-release-upgrader-lmzh0l52/DistUpgrade/apt_clone.py", line 192, in _write_state_installed_pkgs
    cache = self._cache_cls(rootdir=sourcedir)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 152, in __init__
    self.open(progress)
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 214, in open
    self._cache = apt_pkg.Cache(progress)
apt_pkg.Error: E:The value 'jammy' is invalid for APT::Default-Release as such a release is not available in the sources

我尝试通过修改 apt::default release 来解决问题,但是我没有找到发布文件“没有发布文件”

请帮我如何克服这个障碍

答案1

您只能从 Ubuntu 22.10 升级到 Ubuntu 23.04。从 Ubuntu 22.10 回退到 Ubuntu 22.04 (jammy) 不是升级,而是降级。这就是您收到此错误消息的原因:The value 'jammy' is invalid for APT::Default-Release

如果您想从 Ubuntu 22.10 降级到 Ubuntu 22.04,最安全的方法是备份数据并全新安装 Ubuntu 22.04。

答案2

尽管最初的问题是作为降级版本的尝试而写的,但是当我尝试升级时也收到了相同的输出,我在 Poe 的人工智能圣人的帮助下成功解决了这个问题,它指导我安装 Synaptic 包管理器, sudo apt install synaptic 该管理器在 Ubuntu 的通用存储库中可用,然后我选择了已安装的包,通过单击状态按钮并使用 ctrl+a 选择所有包,然后我通过单击包下拉列表并单击标记重新安装将它们标记为重新安装,然后在重新安装完成后,我重新启动系统以完成该过程,然后我多次使用完整升级命令,中间重新启动直到完成,sudo apt full-upgrade 当所有这些步骤完成后,系统升级到版本 2304 谨致问候

相关内容