Brain fart with Apt

I just ran what could be one of the dumbest command lines that I’ve run in years in Linux.

sudo apt-get install pidgin & sudo apt-get remove gaim

 

No really, I want to install pidgin and remove gaim in parallel!

Any apt user will tell you where I went wrong. Apt locks the dpkg database. Only one operation at a time please.

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?

 

DUH!

I’m amazed that I even tried this. I blame Saturday morning foggy mind. I’ve only had 2/3 of a cup of coffee so far.

Reminder to self: don’t program or do important stuff with foggy mind. Tools nice enough to save you from yourself like dpkg are OK.

2 thoughts on “Brain fart with Apt”

  1. It’s easiest to do

    sudo apt-get install pidgin gaim-

    The – after gaim indicates that you want to uninstall it. It won’t run concurrently, but then most of the time spent by apt is reading its “database” (really thousands of files in /var/lib/dpkg/info), so adding a second concurrent apt command would, even with finer-grained locking, only serve to slow things down. (Perhaps the next-generation apt and dpkg ought to use BerkeleyDB or SQLite or similar instead of treating the filesystem as a database.)

  2. Thanks!

    I love that you are one of the few people who read the man pages more thoroughly than me! 🙂

Comments are closed.