2

I removed a library from my system by mistake. Can't remember the actual package name. Tons of stuff was removed. Now every application is inoperable and my application's window shows nothing.

  1. Is there a way to find the last couple of items removed with synaptic?

    I found that if I run <sudo apt reinstall (app)> the programs will then work and the settings are intact. I reinstalled firefox, zim and a couple of others and all the original settings and configs were intact.

    I then shut off the computer and found that when restarting it the ubuntu splash screen comes up and the I get a user prompt and that gets me nowhere. So basically it looks like ALL applications are glitched until I reinstall them.

  2. Would reinstalling my /etc from backup fix these problems?

    I have a backintime backup of /Home from yesterday and a /etc and /boot backup from a month ago.

More questions...

  • What are my options?
  • I am currently running on a livedvd. I don't know how to repair a system from a livedvd. Would a repair be possible from a livedvd?
  • Is it obvious to you people what exactly got glitched from what I have told you?
Daryl
  • 21
  • 1
    Have you considered reinstalling the system? This is why you don't mess with libraries that come preinstalled unless you know what you're doing. The libraries probably lived in /usr/lib or /lib or other directories that a typical "save my data" backup will not be included in. – Thomas Ward Apr 01 '23 at 02:47
  • I assume I will have to reinstall but I was hoping for a better option before I do. – Daryl Apr 01 '23 at 03:11
  • I don't see clear instructions of where you are, is this a server install (ie. Ubuntu 20.04 LTS Server?) or desktop (ie. Ubuntu 20.04 LTS Desktop) or flavor etc as specifics are what I'd consider (& you weren't specific). Can you login to text terminal & read logs to see what you removed? (ie. Ctrl+Alt+F4 & look at your apt logs in /var/log/apt/history.log for clear details of what was removed). You can re-install Ubuntu Desktop systems rather easily (non-destructively too) but I'd ensure your backups are up to date first as mistakes are easy to make. – guiverc Apr 01 '23 at 03:28

2 Answers2

2

If you removed system files to the extent that you cannot anymore log in in any way, but cannot recall what you did, nothing else is left than a reinstall.

Option 1: Reinstall in place. It is possible, though, to repair an existing installation by reinstalling without reformatting. To that aim, load the live installer of the same Ubuntu version that you had on your hard drive. Select "Something Else" in the installer. Now indicate that your system partition on the hard drive should be the root partition, and, importantly, indicate that the partition should not be formatted.

Such installation will overwrite current system files, but will leave existing system configuration and the user home directories in place. After reinstall, the system will largely work like before, except where you will need to reinstall applications that do not come with a default install. (Manually installed third party applications will still be there, though).

Option 2: Reinstall fresh. If you feel this is too difficult, then update the backup of your user data using the live session, do a default new install and restore your data and configuration afterwards.

vanadium
  • 88,010
1

Question1) Is there a way to find the last couple of items removed with synaptic?

synaptic is a frontend for apt which is in turn a frontend for dpkg ... So, you can find out about previous installs, removes and other package operations by inspecting the log file /var/log/dpkg.log and you should be able to filter that log file for packages removed on a certain date e.g. 2023-04-01 with e.g. something like this:

awk -F' |:' '$1=="2023-04-01" && $5=="remove" { if ( !seen[$6]++ ) print $6 }' /var/log/dpkg.log

And automatically install them with e.g. something like this:

awk -F' |:' '$1=="2023-04-01" && $5=="remove" { if ( !seen[$6]++ ) print $6 }' /var/log/dpkg.log | xargs sudo apt install

Question 2) Would reinstalling my /etc from backup fix these problems?

/etc holds system configuration files and restoring it will not fix missing libraries, binaries or packages ... Also, selectively restoring certain system directories might break your system due to e.g. version mismatch especially after modifying/updating your system installed packages or due to wrong permissions/ownership depending on the way you back up and restore them.

What are my options? I am currenty running on a livedvd. I don't know how to repair a system from a livedvd. Would a repair be possible from a livedvd?

Yes, you can chroot from a live system to your installed system on disk and fix it almost the same way if the original system was running.

Is it obvious to you people what exactly got glitched from what I have told you?

Aside from you telling us that you think it was probably caused by you removing a library and the fact that only you have access to the system to investigate ... No, it's not obvious.

Raffa
  • 32,237