1

what I want is way to feed commands to Ubuntu at runtime that is to so that i don not have to wait for resources that gets locked to be free for example during during update

we get this error messsage while trying to execute other commands with sudo access

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?

what i want is way to execute my scripts at like batch processing but i could remove any batch jobs any time i want

I would like a dynamic script/program with root access to do all my jobs.

Ahmed Ali
  • 135
  • 6
  • You need to be more specific as to what this script you describe is trying to do. The error you show can occur for example if someone has software center open and then someone tries and apt-get command at the same time. – John Kirchner May 04 '15 at 10:12
  • @JohnKirchner yes you may think my situation as if someone has software center open and then someone tries and apt-get command at the same time but what i want is root access not like aptdcon command which has no root access – Ahmed Ali May 06 '15 at 15:46
  • You cannot access apt-get or aptitude if the software center is open. The software center uses the same resources. So, root or not, if the updater program or software center is running you cannot use the same resources in your script. Bottom line, if a user has it open root cannot open it also...see below answer too – John Kirchner May 07 '15 at 01:17

1 Answers1

0

The error message you displayed is not shown because some process is using sudo.

This indicates that you are doing some package management for your system (update, upgrade, install....)

So with regard to your demand I'm afraid to say for you that you can't do that in Linux, since the package management always demand the lock to disable other user of using the package management in the time another process is running.

Imagine for example:
user1 is updating the vim package whilst user2 is removing the vim package.

How can you deal with this situation?!

For that and from the basics of the package management I could say you can't do that.

Maythux
  • 84,289