Environment
- On Ubuntu 16.04/Ubuntu 14.04
- Ansible 2.3.2.0
updateApt.yml
- name: APT Update
hosts: webservers
become: True
tasks:
- name: Update apt
apt:
update_cache: yes
错误:
p>
fatal: [testserver2]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to lock apt for exclusive operation"}
- name: APT Update
hosts: webservers
become: True
tasks:
- name: Update apt
apt:
update_cache: yes
cache_valid_time: 3600
,并在目标机上执行此操作
sudo apt-get clean
sudo apt-get update
这为我解决了它,运行它在目标机器上
div>
Read More:
- Lock mechanism in Oracle
- Pass parameters to the YML file, ansible playbook command
- ansible Q&A: Failed to connect to the host via ssh: ssh_exchange_identification and Authentication or per
- Condition judgment and error handling in ansible playbook (fail module failed_when changed_when keyword)
- Cannot find module ‘lodash’
- When docker creates a container command: Error response from daemon: No command specified
- Cargo invoice has failed: error: exit code: 101
- Failed to initialize nvml driver / library version mismatch due to automatic update of NVIDIA driver
- Fatal: unable to create ‘project_ path/.git/ index.lock ‘: File exists.
- Mac installation software, error permission denied @ unlink_ internal
- When installing software in Ubuntu, it prompts: E: You don’t have enough free space in /var/cache/apt/archives/.
- Lock wait timeout exceeded — transaction and index
- Problem solving: failed to connect to github.com port 443: Operation timed out(2020.06.04)
- How to prevent duplicate submission
- How to solve the [error 11004] getaddrinfo failed error in nltk downloader
- “DNET: failed to open device eth1” error resolution of nmap
- Solution to error: no devices found in ADB command
- Error “NPM err” when starting Vue project! code ELIFECYCLE”
- Spark shell startup error, error: not found: value spark (low level solved)
- error Unable to authenticate, need: BASIC realm=“Sonatype Nexus Repository Manager“