Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] HomePod上apt update出现错误:KeyError: 'suite' #35

Closed
gemfield opened this issue May 6, 2021 · 2 comments
Closed

[bug] HomePod上apt update出现错误:KeyError: 'suite' #35

gemfield opened this issue May 6, 2021 · 2 comments

Comments

@gemfield
Copy link
Contributor

gemfield commented May 6, 2021

错误如下所示:

gemfield@bd0d4c6acd4c:/etc/apt$ sudo apt update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://packages.microsoft.com/repos/code stable InRelease                                                      
Hit:3 https://packages.microsoft.com/repos/vscode stable InRelease                                                   
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]                                            
Hit:5 http://archive.ubuntu.com/ubuntu focal InRelease                                                               
Hit:6 http://ppa.launchpad.net/kdenlive/kdenlive-stable/ubuntu focal InRelease                                       
Hit:7 https://apt.repos.intel.com/mkl all InRelease                                                  
Get:8 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]                              
Get:9 http://archive.neon.kde.org/user focal InRelease [166 kB]                           
Get:10 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [28.5 kB]        
Get:11 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [71.3 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [365 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/main DEP-11 64x64 Icons [87.9 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [411 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2,540 B]
Get:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1,765 B]
Fetched 1,457 kB in 4s (386 kB/s)                                              
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'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_lib_cnf-update-db.0.crash'

Original exception was:
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... Done
@gemfield
Copy link
Contributor Author

gemfield commented May 6, 2021

临时解决方案:

sudo apt purge command-not-found

@gemfield gemfield closed this as completed May 6, 2021
@gemfield gemfield reopened this May 6, 2021
@gemfield
Copy link
Contributor Author

gemfield commented Jun 9, 2021

在Dockerfile中,需要按照如下的命令顺序来build:

RUN apt update && \
    apt dist-upgrade -y && \
    apt install -y ubuntu-minimal ubuntu-standard && \
    apt purge -y command-not-found && \
    apt update && \
    apt install xxxxxx xxx xxx

@gemfield gemfield closed this as completed Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant