2

Was attempting to run sudo apt upgradeand hit Ctrl c when it gave me a prompt that I could not figure out how to get out of.

Tried to rerun sudo apt upgrade. Got a message about some kind of lock process being occupied. Foolishly, tried to restart it. This happens after selecting Ubuntu to start. https://i.sstatic.net/FzxNO.jpg Any ideas on how to fix that?

dluxcru
  • 123

1 Answers1

0

I would boot a 'live' medium (eg. your Ubuntu install media) and fsck your system. fsck is a file-system-check command that will check for, then fix any errors in your file-system. (depending on what fs I'm using, I sometimes use xfs_check but I'm betting fsck will be right for you).

My first purpose would be to hopefully get so I can login to recovery or runlevel 1 (text terminal only and not use gui).

I would login (text term or runlevel 1) and look for the last package that was being installed in your logs (I'd stat /var/log/apt/history.log hoping it'd have a time/date stamp that matches your ^C then view it's contents), taking note of the last installed package (even last 2-3).

I would then sudo apt upgrade and hope it would continue. If it complains and wants me to run any dpkg-reconfigure commands, I'd do what it wants and repeat the sudo apt upgrade until all upgrades were complete (0 remain). Myself I'd probably sudo apt dist-upgrade as well.

When completed i'd possibly sudo apt install --reinstall the aborted package (one being installed when you ^C that was hopefully found & noted earlier).

Of course I'd evaluate this by what I saw in messages as steps run. At this stage it would include a reboot & use of system normally at first to test how it goes.

If I wasn't completely happy with the results, or unsure about anything; I'd consider install --reinstall those packages, or just go to a whole Ubuntu re-install.

My re-install choice would be using "Something else" selecting my partitions and ensuring I had 'no-format' which can be quicker. This option takes note of added packages, erases system directories, then installs, adds back your added software [packages] without touching your user directories or files. I want to trust my systems, so this would be my fall-back if I wasn't happy with any step.

guiverc
  • 33,561