How to stop or interrupt Pacman?

I’m installing software and somehow I have a second pacman running and cannot figure out how to get it to stop or interrupt it. The present instance of it running just finished installing a package and it is waiting for the first instance of it to finish what it’s doing. . . .it’s waiting . . . . and is stalled in that state. How did I get into this messed up scenario you might ask? Your guess is as good as mine. . . .I think I may have interrupted the initial one when running and restarted the procedure to download and install again.

Any help?

Rich :wink:

open terminal and type killall pacman

problem fixed. . . .
var/lib/pacman/ delete db.lck

Thanks. . .

Rich :wink:

You should never do this, while it is updating stuff. It’s an easy way to wreck your system.

It’s OK to do it while it downloads especially to do something, anything about very slow downloads sometimes. However, once that phase ends you should allow pacman to do its important work.

Hmmm read the rest of the first post. There should be a feature that pacman detects if another copy of itself is running and then ask the user what to do. If for some reason pacstrap were the one running at first then…

Right my bad I was thinking like an update notifier using pacman to show available updates I had this happen in the past and just killall and then run pacman but if not an update notifier then yeah don’t do what i said

ctrl+c should also work.

1 Like

Not being sarcastic. The thing was that I’ve seen at least two people writing on forums (not sure if both were here or on the “M”) saying he/she had a power outage while pacman was trying to update a large number of files/packages.

Sadly power outages are common where I live and therefore I have a cheap UPS connected only to the computer because it resents more than one thing (modem also) getting battery power. They claim five years life but it’s been 1-1/2 years so far and I don’t think it would go for much longer. If the lights go out while downloading then no problem, but if pacman is busy changing libraries and stuff I have to let it finish.

I must add that I checked out Manjaro “i3” and, while it was doing the full system update and got into the updating stage, it suddenly locked me out warping the screen and ignored my password. I was unwilling to let it finished, pulled the plug on it and erased the disk it was in because I knew it wasn’t going to even boot.

It depens on when you interrupt it. If it is just refreshing the database or downloading packages, it should be fine to interrupt it. Just remember to update later, before installing any new packages to avoid any partial update situations.

If you interrupt it during the phase when it is applying updates, you may have certain programs broken, but you will still have a working system in RAM – it shouldn’t cause a crash or anything like that. Just don’t reboot now, because there is a chance it may not boot. Instead, make sure all pacman processes are killed, delete the db.lock file, and update again. If you get no errors, chances are good everything will be okay.

1 Like