Closed qiaofeng1227 closed 2 years ago
create a new vm on amazon ubuntu
when apt install package, lock file update
root@ip-172-31-45-249:/data# apt install ansible
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ieee-data python3-argcomplete python3-crypto python3-dnspython python3-jmespath python3-kerberos python3-libcloud python3-lockfile python3-netaddr python3-ntlm-auth python3-requests-kerberos python3-requests-ntlm python3-selinux
python3-winrm python3-xmltodict
the same issure refer to:(2019 to nowe , stilll opening) https://github.com/ansible/ansible/issues/51663 https://github.com/ansible/ansible/pull/74095
install.sh file have many package to install, especially apt install ansible need more time 50s
- name: Upgrade all packages to the latest version for production
apt:
name: "*"
state: latest
only_upgrade: yes
register: result
until: result.msg.find("Could not get lock /var/lib/dpkg") == -1
retries: 50
delay: 10
failed_when: "'FAILED' in result.stdout"
when: common_system_upgrade and (init == '1' or init == 1)
try it and wait for unlocked