Problem with installation on AWS EC2

I am trying to launch an instance on EC2 - Ubuntu version 18.04 (ARM architecture) using the easy install script.

I am getting the following error in the log file:

TASK [wkhtmltopdf : Install wkhtmltox deb] *********************************************************************************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/wkhtmltopdf/tasks/main.yml:103
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c ‘echo ~root && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /root/.ansible/tmp”&& mkdir /root/.ansible/tmp/ansible-tmp-1632124519.3870838-1026-35190889062632 && echo ansible-tmp-1632124519.3870838-1026-35190889062632=“echo /root/.ansible/tmp/ansible-tmp-1632124519.3870838-1026-35190889062632” ) && sleep 0’
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/packaging/os/apt.py
<127.0.0.1> PUT /home/ubuntu/.ansible/tmp/ansible-local-19105283p2wtl/tmp2h6cv4q_ TO /root/.ansible/tmp/ansible-tmp-1632124519.3870838-1026-35190889062632/AnsiballZ_apt.py
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1632124519.3870838-1026-35190889062632/ /root/.ansible/tmp/ansible-tmp-1632124519.3870838-1026-35190889062632/AnsiballZ_apt.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1632124519.3870838-1026-35190889062632/AnsiballZ_apt.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1632124519.3870838-1026-35190889062632/ > /dev/null 2>&1 && sleep 0’
fatal: [localhost]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“allow_unauthenticated”: false,
“autoclean”: false,
“autoremove”: false,
“cache_valid_time”: 0,
“deb”: “/tmp/wkhtmltox.deb”,
“default_release”: null,
“dpkg_options”: “force-confdef,force-confold”,
“force”: false,
“force_apt_get”: false,
“install_recommends”: null,
“only_upgrade”: false,
“package”: null,
“policy_rc_d”: null,
“purge”: false,
“state”: “present”,
“update_cache”: null,
“upgrade”: null
}
},
“msg”: “Wrong architecture ‘i386’ – Run dpkg --add-architecture to add it and update afterwards”
}

RUNNING HANDLER [mariadb : restart mysql] **********************************************************************************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/mariadb/handlers/main.yml:2

PLAY RECAP *****************************************************************************************************************************************************************************
localhost : ok=42 changed=27 unreachable=0 failed=1 skipped=43 rescued=0 ignored=0

Install script run at 07:50 on 2021-09-20

Please help

Use Ubuntu based on x86 architecture

Before Executing the Install.py script, run the below commands on EC2 instance

$ sudo apt update
$ sudo apt upgrade

make sure the only file present in /etc/dpkg/dpkg.cfg.d/ is “multiarch”

ls /etc/dpkg/dpkg.cfg.d/

if output is

multiarch

execute the following commands as it is else replace “multiarch” with the name of file present in that directory.

sudo sh -c "echo 'foreign-architecture i386' > /etc/dpkg/dpkg.cfg.d/multiarch"

The above command will add i386 architecture then execute below command

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo apt update
sudo apt upgrade