"Device or resource busy" Can't delete nodejs package, can't install updates because the system wants me to delete it

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
fruitkiller
Level 4
Level 4
Posts: 411
Joined: Tue Aug 05, 2014 7:52 pm

"Device or resource busy" Can't delete nodejs package, can't install updates because the system wants me to delete it

Post by fruitkiller »

..to do so.

Should I login in the Repair choice in grub and get in there through the command line without X or anything running to get rid of it? This happened to me a while ago if you look at my profile, this is kind of strange that I get these device or resource busy for stuff in "/usr/..." I remember getting rid of the package I wanted to remove after a clean but regular reboot and removing the package right away before opening anything, no browser, no caja, just the terminal. apt-get install -f doesn't work either, I get the device resource or busy thing there too.

acerimusdux
Level 4
Level 4
Posts: 337
Joined: Sat Dec 26, 2009 3:36 pm

Re: "Device or resource busy" Can't delete nodejs package, can't install updates because the system wants me to delete i

Post by acerimusdux »

Try:

Code: Select all

lsof +D /usr|grep nodejs
Since most all files installed by nodejs have "nodejs" somewhere in the filename or path, that should catch most all of them (it will take a little time to run, though). If that finds any open files, you can kill the process listed by PID using:

Code: Select all

kill -9 PID

fruitkiller
Level 4
Level 4
Posts: 411
Joined: Tue Aug 05, 2014 7:52 pm

Re: "Device or resource busy" Can't delete nodejs package, can't install updates because the system wants me to delete i

Post by fruitkiller »

Thanks for responding!

Yeah, I've seen this through some searches before posting (well variations of lsof commands, not yours).Same thing, nothing indicates nodejs / node is being used. This command went for a while and returned nothing. The way I was able to delete a file/package acting this way once in the past was to boot with no external drives turned on, no turntable, basically nothing but the bare minimum then I was able to get out of a very strange situation (worse than this one, it took a long time and a lot of help to get to the point where this device or resource busy thing showed up as the last obstacle). I'll try that and see. Very strange. A lot of solutions I found upon ungoogling said to unmount the drive....they weren't speaking of a file that's in the filesystem of the OS itself heh.

acerimusdux
Level 4
Level 4
Posts: 337
Joined: Sat Dec 26, 2009 3:36 pm

Re: "Device or resource busy" Can't delete nodejs package, can't install updates because the system wants me to delete i

Post by acerimusdux »

You need more detail where the error is occurring. There's lots of files in /usr which should open, especially if you are running the desktop. Don't know what would be connected to removing nodejs, though. Try lsof +c 15 +D /usr/bin/ and see if anything there looks related.

And try cat /var/log/dpkg.log|less to see if you can find more detail of the error. Maybe dmesg -l err as well. You need to narrow it down a little.

Mute Ant
Level 14
Level 14
Posts: 5132
Joined: Tue Sep 03, 2013 7:45 pm
Location: Norfolk UK

Re: "Device or resource busy" Can't delete nodejs package, can't install updates because the system wants me to delete i

Post by Mute Ant »

"...device or resource busy..." with the nodejs package running as you try to delete it? If it makes a user nodejs or mounts its own ramdisk workspace you get that 'busy' error. The old-style solution would be to switch to runlevel1 where the only user logged in is root, so booting into a recovery-mode-shell and deleting the package would probably work, yes. Or you can try the old-style method... set a password for the root account and run command sudo init 1 to change to recovery-mode without rebooting.
While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named "manual".

Post Reply

Return to “Software & Applications”