当我尝试运行更新管理器时收到以下错误:

当我尝试运行更新管理器时收到以下错误:
** (appstreamcli:7309): WARNING **: 10:16:30.753: No origin found for file us.archive.ubuntu.com_ubuntu_dists_focal-updates_main_dep11_Components-amd64.yml.gz

** (appstreamcli:7309): WARNING **: 10:16:30.753: No origin found for file us.archive.ubuntu.com_ubuntu_dists_focal-updates_universe_dep11_Components-amd64.yml.gz

** (appstreamcli:7309): WARNING **: 10:16:30.753: No origin found for file us.archive.ubuntu.com_ubuntu_dists_focal-updates_multiverse_dep11_Components-amd64.yml.gz

** (appstreamcli:7309): WARNING **: 10:16:30.753: No origin found for file us.archive.ubuntu.com_ubuntu_dists_focal-backports_universe_dep11_Components-amd64.yml.gz
AppStream system cache refresh failed. Turn on verbose mode to get detailed issue information.
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 26, in <module>
    col.create(db)
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 94, in create
    self._fill_commands(con)
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 138, in _fill_commands
    self._parse_single_commands_file(con, fp)
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 176, in _parse_single_commands_file
    suite=tagf.section["suite"]
KeyError: 'suite'
Reading package lists... Error!
E: Repository 'http://us.archive.ubuntu.com/ubuntu focal-updates InRelease' changed its 'Origin' value from '' to 'Ubuntu'
E: Repository 'http://us.archive.ubuntu.com/ubuntu focal-updates InRelease' changed its 'Label' value from '' to 'Ubuntu'
N: Repository 'http://us.archive.ubuntu.com/ubuntu focal-updates InRelease' changed its 'Version' value from '' to '20.04'
N: Repository 'http://us.archive.ubuntu.com/ubuntu focal-updates InRelease' changed its 'Suite' value from '' to 'focal-updates'
E: Repository 'http://us.archive.ubuntu.com/ubuntu focal-updates InRelease' changed its 'Codename' value from '' to 'focal'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
E: Repository 'http://us.archive.ubuntu.com/ubuntu focal-backports InRelease' changed its 'Origin' value from '' to 'Ubuntu'
E: Repository 'http://us.archive.ubuntu.com/ubuntu focal-backports InRelease' changed its 'Label' value from '' to 'Ubuntu'
N: Repository 'http://us.archive.ubuntu.com/ubuntu focal-backports InRelease' changed its 'Version' value from '' to '20.04'
N: Repository 'http://us.archive.ubuntu.com/ubuntu focal-backports InRelease' changed its 'Suite' value from '' to 'focal-backports'
E: Repository 'http://us.archive.ubuntu.com/ubuntu focal-backports InRelease' changed its 'Codename' value from '' to 'focal'
E: Repository 'http://us.archive.ubuntu.com/ubuntu focal-backports InRelease' changed its default priority for apt_preferences(5) from 500 to 100.
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_focal-updates_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

答案1

在这种情况下,以下命令有效:

sudo rm -vf /var/lib/apt/lists/*

相关内容