ansible-nodejs-role icon indicating copy to clipboard operation
ansible-nodejs-role copied to clipboard

Install Node.js fails, "Could not fetch updated apt files"

Open tyleha opened this issue 9 years ago • 6 comments
trafficstars

Installing on Ubuntu 14.04, I get

TASK [nodesource.node : Install Node.js] ***************************************
fatal: [CCAP4]: FAILED! => {"changed": false, "failed": true, "msg": "Could not fetch updated apt files"}

on the last task. I can install node via the command line fine at this stage using apt-get install nodejs. Using -vvv produces

fatal: [CCAP4]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"allow_unauthenticated": false, "autoremove": false, "cache_valid_time": null, "deb": null, "default_release": null, "dpkg_options": "force-confdef,force-confold", "force": false, "install_recommends": null, "only_upgrade": false, "package": ["nodejs"], "pkg": ["nodejs"], "purge": false, "state": "present", "update_cache": true, "upgrade": null}, "module_name": "apt"}, "msg": "Could not fetch updated apt files"}

tyleha avatar Oct 12 '16 21:10 tyleha

Can you please be more specific? We'd need to know the exact command you entered that created the error message, and any other pertinent info about your setup. Thanks.

chrislea avatar Oct 12 '16 21:10 chrislea

Oh!, wait, sorry. Please disregard the above comment. I'm looking at the wrong repository (thought I was looking at distributions). It may still be helpful if you can provide more detail though. :)

chrislea avatar Oct 12 '16 21:10 chrislea

Sure - what additional detail would be most helpful?

The command I ran was simply to execute this galaxy role, as defined by a playbook below:

---
  - hosts: servers
    roles:
      - nodesource.node
    become: true
    vars:
      - nodejs_version: '4.6'

I did have to add become: true as the user who's running this playbook isn't root, it's an admin user with sudo perms.

tyleha avatar Oct 12 '16 22:10 tyleha

I'm having the same issue upon updating my OS to Ubuntu Trusty from Precise.

hyperatom avatar Nov 07 '16 15:11 hyperatom

same issue here

zhiyelee avatar Dec 01 '16 05:12 zhiyelee

either become: true should be added here or this should be updated on the README to note this should be run as root.

sultangillani3 avatar Dec 08 '18 22:12 sultangillani3