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:
- Global lock, table lock and row lock in MySQL
- How to Solve apt get update problem: usr/lib/apt/methods/HTTPS could not be found_PUBKEY 7EA0A9C3F273FCD8
- Condition judgment and error handling in ansible playbook (fail module failed_when changed_when keyword)
- N: Ignoring file ’50unattended-upgrades.ucf-dist’ in directory ‘/etc/apt/apt.conf.d/’ as it has an i
- ansible Q&A: Failed to connect to the host via ssh: ssh_exchange_identification and Authentication or per
- Unity Cursor Lock& Camera Lock
- Pass parameters to the YML file, ansible playbook command
- When linux installs rpm, it prompts: can’t create transaction lock on /var/lib/rpm/.rpm.lock error
- Lock mechanism in Oracle
- Forced shutdown of VMware wrokstation error (failed to get exclusive lock on the configuration file —)
- VMware failed to lock memory file. Error restoring virtual machine state from file
- Solution of apt unable to update in the docker container of raspberry pie
- When installing software in Ubuntu, it prompts: E: You don’t have enough free space in /var/cache/apt/archives/.
- Using apt mirror to build Debian local warehouse
- Lock wait timeout exceeded — transaction and index
- How to Use Apt get Command Under Mac OSX
- Linux environment setup – Update https://apt.repos.intel.com report errors
- Ubuntu add apt repository command not found solution
- ModuleNotFoundError: No module named ‘apt_pkg‘
- Fatal: unable to create ‘project_ path/.git/ index.lock ‘: File exists.