PJ-Singh-001 / Cubic

The Official Web Site for Cubic (Custom Ubuntu ISO Creator) (https://github.com/PJ-Singh-001/Cubic)
813 stars 47 forks source link

How to remove snaps packages from custom Ubuntu ISO? #333

Closed Ludolulu closed 1 month ago

Ludolulu commented 2 months ago

Describe the question

I would like to remove the Firefox Snap package, the Snap Store and others snaps packages, like bare and gnome42-2204 from my custom cubic distro. I want to keep other snap packages in my custom distro. Thanks! image

What you have tried

I tried to remove them with the default snap remover. image

I also tried to remove them by removing their folders from the /snap/ folder, and removing their shortcut from the desktop and /snap/bin image

Expected behavior

It should be removed from the distro entirely, image

OS Information (please complete the following information):

Cubic Information (please complete the following information):

PJ-Singh-001 commented 2 months ago

Unfortunately, you can not manage snap packages in Cubic's virtual environment. I had contacted Canonical to request the ability to manage Snap packages in a chroot-like environment, but they told me that they will not be supporting this.

However, here is a work around:

  1. Delete the snapd package using apt purge snapd; this has the (desired) side effect of removing all snaps
  2. Optionally, reinstall the snapd package using apt install snapd (so snaps can be managed once the OS has been installed to disk)
  3. Install the deb versions of the software you want to add to the custom OS, using apt or dpkg -i or gdbi

Do not try to use the snap command in in Cubic's virtual environment.

Note: you must select Minimal Install when installing your customized OS.


Note:

You may not be able to test all of your changes in the emulator in Cubic.

This issue is due to the new Subiquity installer and the new layout Canonical introduced for the ISOs.

The new version of Cubic, which should be released in August, should remedy this problem. Until the new version of Cubic is released, you may have to actually install the customized OS to see your changes. To work around this, I usually install onto a virtual disk in Virtual Box to test.

If you want to preview the new release, do the following. (Note, this will not remedy the snap issue).

# Remove release version 2024.02.86 of Cubic.
sudo apt autoremove --purge cubic

# Optionally make sure there are no old files left by apt.
sudo rm -rf /usr/share/cubic

# Remove the Cubic "Release" repository.
sudo add-apt-repository --remove ppa:cubic-wizard/release

# Add the Cubic "Experimental" repository.
sudo apt-add-repository universe
sudo apt-add-repository ppa:cubic-wizard/experimental
sudo apt update

# Install an EXPERIMENTAL version of Cubic.
sudo apt install --no-install-recommends cubic
Ludolulu commented 2 months ago

Yeah, sadly, Subiquity use snap and when I uninstall snap, the installer stop working. I'll wait till the next version then?

PJ-Singh-001 commented 1 month ago

The new version of Cubic has been released with improved support for Ubuntu with Subiquity. Please update to Cubic version 2024.09.88.

sudo apt update
sudo apt install --no-install-recommends cubic

After installing, please follow the instructions in the following question: How to remove all snaps from Ubuntu?