Debian 10.10 won't boot after auto-remove

Kernels, Network, and Services configuration
Post Reply
Message
Author
colins2
Posts: 3
Joined: 2021-07-21 09:22

Debian 10.10 won't boot after auto-remove

#1 Post by colins2 »

I've been using Debian for a couple of years and have applied updates when advertised without any problems.
Yesterday I was trying to update a library from a repo and after the update I got the message that x packages were updated and that I should run auto-remove to get rid of redundant packages.
I have never run auto-remove before and I really wish I hadn't done so now!
My Debian installation will now not boot. I get the message that it failed to load a kernel module.
I downloaded and put the live system on a usb stick and booted from there but couldn't really see why it wouldn't boot and I have a nasty suspicion that I may have to re-install.
Next I booted and selected the recovery mode and looked at the journal log end eventually found the line that the system copuld not load the nvidia module as the file was not present - thanks auto-remove!

My question is: how can I force Debian to boot in default mode (nouveau?) so that I can re-install the nvidia drivers? As it is now, I cannot boot the system at all.
I have other OSs, Windoze, Mint and Devuan so I still have a computer to work with but all my development tools are on the Debian setup so I really do not want to have to re-install everything.

Any assistance gratefully received......

User avatar
Hallvor
Posts: 1175
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 3 times
Been thanked: 2 times

Re: Debian 10.10 won't boot after auto-remove

#2 Post by Hallvor »

Autoremove will remove all the files of a metapackage if you have uninstalled a single package of it. Therefore, always pay attention to what it wants to do. You learned that the hard way.

As for your current system, you probably need to chroot your system from a livecd/liveusb and reinstall the packages you removed. They should be listed in /var/log/dpkg.log
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Bullseye (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Bullseye (KDE)

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 3655
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 3 times
Been thanked: 4 times

Re: Debian 10.10 won't boot after auto-remove

#3 Post by sunrat »

colins2 wrote: 2021-07-21 09:47My Debian installation will now not boot. I get the message that it failed to load a kernel module.
If it is showing you that message then your system may have already booted but is just failing to load the graphical desktop. Does it show a login prompt? If so log in as root to reinstall the drivers assuming you still have internet connection. Otherwise chroot from another system as previously suggested.
My question is: how can I force Debian to boot in default mode (nouveau?) so that I can re-install the nvidia drivers?
Nvidia drivers block nouveau loading by creating a blacklist file or files so removing that and rebooting should allow Nouveau to load. Probably /etc/modprobe.d/nvidia-blacklists-nouveau.conf but there may be others.
Check this thread for an issue which was similarly solved:
viewtopic.php?f=10&t=149651

And yes, one should be very careful with autoremove, check its list of proposed removals carefully. Often the disk space it will recover is minimal.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

colins2
Posts: 3
Joined: 2021-07-21 09:22

Re: Debian 10.10 won't boot after auto-remove

#4 Post by colins2 »

Hallvor wrote: 2021-07-21 10:15 Autoremove will remove all the files of a metapackage if you have uninstalled a single package of it. Therefore, always pay attention to what it wants to do. You learned that the hard way.

As for your current system, you probably need to chroot your system from a livecd/liveusb and reinstall the packages you removed. They should be listed in /var/log/dpkg.log
Thanks for your help but nothing worked. I spent quite a few hours as chroot and finally got rid of all thge nvidia stuff but it still wouldn't boot. I reinstalled the nvidia drivers with apt install nvidia-driver and almost half a gig later it was done. I rebooted and got the same error as before. So re-format, re-install and it is working again now, just a couple of days work to get all the systems back that I had before.

Unbelievable that apt can recommend that we use auto-remove that has the ability to trash the system! Lesson learned!

colins2
Posts: 3
Joined: 2021-07-21 09:22

Re: Debian 10.10 won't boot after auto-remove

#5 Post by colins2 »

sunrat wrote: 2021-07-21 11:51
colins2 wrote: 2021-07-21 09:47My Debian installation will now not boot. I get the message that it failed to load a kernel module.
If it is showing you that message then your system may have already booted but is just failing to load the graphical desktop. Does it show a login prompt? If so log in as root to reinstall the drivers assuming you still have internet connection. Otherwise chroot from another system as previously suggested.
My question is: how can I force Debian to boot in default mode (nouveau?) so that I can re-install the nvidia drivers?
Nvidia drivers block nouveau loading by creating a blacklist file or files so removing that and rebooting should allow Nouveau to load. Probably /etc/modprobe.d/nvidia-blacklists-nouveau.conf but there may be others.
Check this thread for an issue which was similarly solved:
viewtopic.php?f=10&t=149651

And yes, one should be very careful with autoremove, check its list of proposed removals carefully. Often the disk space it will recover is minimal.
Thanks for your help but I couldn't do any of your suggestions as I couldn't log in. I had a stream of startup messages and then the system just froze. The only keys that worked was the Microsoft salute and that just shut down and rebooted.
Having wasted a whole day, I just copied my home directory to another drive and re-installed the system.
Lesson learned - never use auto-remove! Absolutely unbelievable that it can trash an entire system

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 3655
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 3 times
Been thanked: 4 times

Re: Debian 10.10 won't boot after auto-remove

#6 Post by sunrat »

Back up your system while it is working! And do it regularly. I use fsarchiver from another system on the same machine or you could use a live USB/CD system. Takes about 5 minutes or less to restore instead of whatever hours it takes to do a full reinstall.
Clonezilla is also commonly recommended although I find fsarchiver easier and quicker although it's only CLI. There are dedicated distros for backups and maintenance or utility work. PartedMagic is great although it costs a few bucks and all its utilities are available freely for other systems anyway. Clonezilla Live is good just for backups.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

steve_v
Posts: 764
Joined: 2012-10-06 05:31
Location: New Zealand
Has thanked: 2 times
Been thanked: 1 time

Re: Debian 10.10 won't boot after auto-remove

#7 Post by steve_v »

colins2 wrote: 2021-07-22 03:34The only keys that worked was the Microsoft salute
If ctrl-alt-del (I assume that's what this "Microsoft salute" nonsense means) worked to reboot the machine, then it had not failed to boot at all. Did you try booting in single-user mode (or the systemd equivalent thereof)?

colins2 wrote: 2021-07-22 03:34Absolutely unbelievable that it can trash an entire system
Absolutely unbelievable that people still run without backups. Disk space is far cheaper than time these days.

That said, I have been using apt's autoremove feature for at least 10 years, with zero issues, and zero need to restore or reinstall.
I have had occasional problems with proprietary out-of-tree modules (e.g. nvidia's sorry excuse for a driver), but that's more an inconvenience as one can almost always get a working shell via runlevel 1 / the "rescue" target, (or if all else fails the initrd) from which to fix it.
Frankly, reinstalling just because the GUI is broken boggles my mind.

arzgi
Posts: 796
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 2 times

Re: Debian 10.10 won't boot after auto-remove

#8 Post by arzgi »

steve_v wrote: 2021-07-24 09:51
That said, I have been using apt's autoremove feature for at least 10 years, with zero issues, and zero need to restore or reinstall.
I agree fully, apt is so robust, if autoremove breaks something, I would suspect some tinkering.

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 3655
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 3 times
Been thanked: 4 times

Re: Debian 10.10 won't boot after auto-remove

#9 Post by sunrat »

I use it regularly without issue, but have bailed out maybe twice ever due to unsafe looking remove proposals.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

steve_v
Posts: 764
Joined: 2012-10-06 05:31
Location: New Zealand
Has thanked: 2 times
Been thanked: 1 time

Re: Debian 10.10 won't boot after auto-remove

#10 Post by steve_v »

sunrat wrote: 2021-07-24 15:21bailed out maybe twice ever due to unsafe looking remove proposals.
I have done that before too TBH... But only when I'm attempting something unwise, undocumented, and usually downright foolish. :D

If you're trying to downgrade, sidegrade, frankengrade, or just plain idiot-grade, then autoremove might very well bork your install. But even then it does warn you, and you get to review it's proposed actions.

This does make me wonder if what we have here is another case of the ever-recurring "installing nvidia drivers some random way because a blog said so" mess... Just a thought.

It also makes me wonder exactly what "update a library from a repo" really means, and which repo is involved... But I'll restrain myself now.

Post Reply