AWS System Managerを使用してUbuntu EC2をパッチスキャンできない

AWS System Managerを使用してUbuntu EC2をパッチスキャンできない

AWS System Managerを使用して、Ubuntu EC2で欠落しているパッチがあるかどうかを調べました。 AWS-RunPatchBaseline を使用して「コマンドを実行」すると、PatchLinux スキャン失敗メッセージが表示されます。エラーメッセージは以下の通りです。

原因が何であるか、解決/デバッグ方法を知っている人はいますか?

パッチしたいEC2はubuntu 16.04です。

(Reading database 
---Output truncated---
----------ERROR-------
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
E: Sub-process /usr/bin/dpkg returned an error code (1)
WARNING: Could not install the python3-requests, this may cause the     
patching operation to fail.
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
E: Sub-process /usr/bin/dpkg returned an error code (1)
WARNING: Could not install the python3-apt, this may cause the patching         
operation to fail.

failed to run commands: exit status 1

アップデート:実際に「Run Command」をもう一度クリックしましたが、今回は出力全体をS3に保存していましたが、これ以上のエラーメッセージが表示される理由は次のとおりです。 AWSは私のEC2にpython3-aptをインストールしようとしましたが失敗しました。

実際、私はsshを介してこのec2に接続し、手動で実行しました。

sudo apt-get update

それから:

sudo apt-get -y upgrade

次のエラーが表示されます。

Preparing to unpack .../apport_2.20.1-0ubuntu2.13_all.deb ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit     
status 1
dpkg: trying script from the new package instead ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:

SyntaxError: invalid syntax
dpkg: error processing archive /var/cache/apt/archives/apport_2.20.1-    
0ubuntu2.13_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit    
status 1
Errors were encountered while processing:
 /var/cache/apt/archives/apport_2.20.1-0ubuntu2.13_all.deb
Reading package lists...
Building dependency tree...
Reading state information...

「sudo apt-get -yアップグレード」を正常に実行する方法がわかったら、元のスキャンの問題が解決されると思います。手動で「sudo apt-get -y update」を実行するときに問題を解決する方法を知っている人はいますか?

ベストアンサー1

おすすめ記事