Execute commands remotely on a ubuntu

26 views
Skip to first unread message

Vamberto Junior

unread,
Mar 11, 2016, 9:46:25 AM3/11/16
to Ansible Project
Hi everyone,

I am new user on ansible and I have a little difficulty to execute commands  remotely on a Ubuntu Server. (Ubuntu don't accept ssh with user root and the user vamberto can use sudo su - )
My machine is a Fedora Linux and I execute this command: ansible -vvv wolverine -m apt -a "update_cache=yes" --user=vamberto -k --become-method=su --become-user=root --ask-become-pass

And the server asks 
SSH password:  
SU password[defaults to SSH password]:


After I putt the ssh and su password I receive this error:

 olverine | FAILED >> {
   "failed": true,                                                                                                                                            
   "msg": "Failed to lock apt for exclusive operation"                                                                                                        
}                   

Someone can help me ? 

Brian Coca

unread,
Mar 11, 2016, 11:05:23 AM3/11/16
to ansible...@googlegroups.com
you can use sudo OR su but not chain them.

Karl E. Jorgensen

unread,
Mar 11, 2016, 12:59:27 PM3/11/16
to ansible...@googlegroups.com
APT takes out a lock to ensure that only one instance of a package
manager is running. E.g. this can happen if you have synaptic open...

It is not an "ansible error" as such - just how the debian/ubuntu
package manager work...

Hope this helps

Reply all
Reply to author
Forward
0 new messages