Lost system packages, Ubuntu-software, Firefox, also LXC and LXD, how to return to normal?

Hi everyone,

I found this post which has similar symptoms, but I’m not sure what the correct repair steps are. Removing AppArmor packages also removes important system packages

Ubuntu Version: Ubuntu 22.04 LTS

Desktop Environment (if applicable): GNOME

Problem Description:
After resolving the problem I had here: LXD, integrated GPU passthrough, now fully blank desktop, how to get desktop back? - #4 by thingizkhan I have found that several apps are now “command not found”, e.g. LXC, LXD, Firefox, Ubuntu Software are the ones I’ve identified so far.

Apart from the steps described in my other problem thread, I did remove openssh-client and openssh-server when I realised I couldn’t use them because the laptop wouldn’t appear on the local network. I wanted to return the Ubuntu installation to how it was before I messed it up with the LXD GPU passthrough issue. I removed those SSH packages with “sudo apt remote openssh-server openssh-client”. I suspect that doing this has remove a bunch of important other packages, right?

What is the correct way to return the installation how it should be? Note that my installation is fairly plain, I’ve not added much to it at all.

Relevant System Information:
Dell Precision 3490, Ubuntu 22.04 LTS. I’m not sure what else is relevant for this.

Screenshots or Error Messages:
Will add later.

What I’ve Tried:
Given I’ve already probably messed things up by incorrect use of apt I’ve not tried anything! For example, I don’t know which is the usual Firefox package to have installed with 22.04 (Snap?) and given that Ubuntu Software is an important system package I don’t want to screw up the reinstall of this.

Cheers :slight_smile:

If you’ve not added much to an install, and particularly if you haven’t edited any config files, it may be easier just to reinstall and start again.

2 Likes

Hi @irihapeti,

Normally I would agree but in this case reinstalling isn’t an option unfortunately. Anyway, I’d like to know how to do this in case I screw things up again in future.

I found this, but it’s old and I don’t know if it’s still correct. Also, may be a bit OTT, I wonder how long it would take, how attended it would need to be, etc: https://askubuntu.com/questions/533030/how-to-reinstall-default-packages#:~:text=That%20makes%204%20files:%20default,that%20were%20related%20to%20wine.
sudo apt-get install ubuntu-minimal ubuntu-standard ubuntu-desktop

Cheers :slight_smile:

Fair enough. I’ll step aside and leave this to someone else.

All the packages you list in your original post are indeed snap packages, this looks like you somehow managed to purge snapd from your system, so I would start with reinstall of the snapd deb (sudo apt install snapd), then the snapd snap and the respective core snap for your system (sudo snap install snapd core22), the you can use the snap install command to reinstall firefox, snap-store (app center) and lxd

3 Likes

Hi @ogra,
Yep, indeed snap is command not found as well, well deduced!

After sudo apt install snapd I tried sudo snap install snapd core22 but it said snapd already installed, so out of curiosity I tried Firefox and voila it appeared! Snap Store also came back, as well as lxc and lxd.

With that info, is it worth doing a reinstall of core22? Any other checks I should do to check the integrity of the overall install?

Cheers :slight_smile:

1 Like

Well, take a look with snap list what you have installed, but I guess if firefox runs core22 is definitely there since firefox uses it…

1 Like

Everything seems to be there and working now, so the only casualty seemed to be snapd itself, I’m not sure how that happened.
Cheers :slight_smile:

3 Likes