LaravelCollective / remote

Remote SSH Access for the Laravel Framework
MIT License
276 stars 106 forks source link

dpkg/lock problem when using multiple jobs #62

Closed Cannonb4ll closed 6 years ago

Cannonb4ll commented 6 years ago

Lets say I have several jobs:

Job1.php Job2.php Job3.php

And in each job I do a apt-get install {somepackage} which would look like this:

        $commands = [
            'apt-get install somepackage'
        ];

        $connection->run($commands, function($line){

        });

Would I have to do a 'exit' in each job, because each jobs initiates its own connection again?

I am getting these errors, whilst I do it manually there are no problems:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?