Archives For November 30, 1999

For those hate Snap but prefer Flatpak, there’s now a script to automatically remove all the snap apps installed on your system, and install them back as Flatpak in Debian and Ubuntu.

It’s Unsnap, a free and open-source script written by Alan Pope and some other contributors. The man was an employee of Canonical (the company behind Ubuntu), and one of the developers of Snap.

As you may know, Snap and Flatpak are universal Linux package format run in sandbox. They make possible to run newer apps (or app in multiple versions) in Linux without worrying about dependency issue. However, they take more disk spaces since run-time libraries also sandboxed, and so far have limitations to interact outside of sandbox.

Snap is powered by Canonical. The client and runtime are open-source while the backend is proprietary. Flatpak is completely open-source, and RedHat is behind the project. And, the open-source community seems to (IMO) prefer Flatpak is bit more.

Use Unsnap to Convert your Snap Apps to Flatpak

Unsnap does NOT rebuilt your Snap apps as Flatpak. It automate the process to remove Snap apps and install equivalent Flatpak apps back. Which, is useful for beginners and advanced users who want to save time for searching packages.

Supported Systems:

According to the script content, it so far supports: Debian, Ubuntu (and its official flavors), Linux Mint, Pop!_OS, Elementary OS, and Zorin OS.

Working Process

The script works in two mode: default and auto.

It by default detects your system status and snap apps, then generates following new scripts:

  • 00-backup – script to run snap save to save current data of snap apps.
  • 01-install-flatpak – script to install Flatpak daemon.
  • 02-enable-flathub – script to add Flathub repository.
  • 03-install-flatpaks – script to install equivalent Flatpak apps.
  • 04-remove-snaps – script to Remove all the Snap apps.
  • 99-remove-snapd – script to remove disable snap. Though it may be installed back via a system update.

It may skip 01/02 scripts if you already installed Flatpak daemon and added Flathub repository. And, the scripts are quite simply and easy to understand for those have basic Linux command and programming skills. Then, you can choose to manually run all or any of the scripts accordingly!

The auto mode will generate the scripts and run all of them automatically!

Limitations:

The scripts so far supports 219 applications. Advanced users can add more apps support by editing the ‘applist.csv’ config file.

It won’t remove unsupported and excluded Snap applications, though they will be gone after running 99-remove-snapd script either manually or automatically.

The script can save current data of all Snap applications. But there seems no way to import them in the equivalent Flatpak applications. And, there’s NO script to undo the changes!

Download Unsnap and Run the script

1. User can either download Unsnap from github page, or open terminal (press Ctrl+Alt+T in Ubuntu) and run command:

git clone https://github.com/popey/unsnap

Run sudo apt install git if git command not found.

2. After downloading the script, either

  • run cd unsnap to navigate to source folder and ./unsnap auto to do all the things AUTOMATICALLY in one command.
  • or run cd unsnap, then ./unsnap to generate the scripts for MANUAL use.

For manual mode, all the generated scripts are available in “log-202x-xxx” sub-folder.

Just run cd log-* command to navigate to that folder, then choose any script you want to run. For example, backup snap app data by ./00-backup.

As mentioned, there’s no script to undo the changes! You can safely remove the unsnap folder after all the jobs done!

Ubuntu finally added support for disabling automatic updates for snap applications, though it’s currently considered experimental at the moment of writing.

As you may know, Snap is an universal package format runs in sandbox. It’s developed by Canonical, the company behind Ubuntu, as a competitor to Flatpak.

The pre-installed Firefox in Ubuntu 22.04+, and Ubuntu Software in Ubuntu 20.04+ are Snap applications. And there are lots of apps in Ubuntu Software available as Snap, including Chromium browser, Skype, and more.

By default, Snap apps automatically update to the newest version. Though, user can delay or specify when to perform updates. It was impossible to completely disable automatic updates due to security issue.

But as the snap update mechanism has been continuously refined, and to give IT teams more control they expect for Linux systems, this long-awaited feature is finally released for preview.

Hold or completely disable Snap updates

The function is done via a new --hold parameter using snap refresh command.

  • For example, completely disable automatic updates for Firefox via command:
    snap refresh --hold firefox

    It will output something like “General refreshes of “firefox” held indefinitely”.

  • Or, hold automatic updates for 24 hours for both firefox and snap-store via command:
    snap refresh --hold=24h firefox snap-store
  • For all the Snap apps, just skip package name in the command. So, disable automatic updates for all apps by running command:
    snap refresh --hold

Oppositely, re-enable automatically updates via --unhold parameter.

  • To re-enable updates for all apps, use command:
    snap refresh --unhold
  • To re-enable center apps, such as Firefox, use command:
    snap refresh --unhold firefox

Switch Snapd to edge channel

UPDATE: This feature is available in stable release. You don’t have to switch to edge channel any more!

As mentioned, the feature is not in edge channel for preview. If you found the commands above do not work, but you really want to try it out, switch Snapd daemon to edge channel via command:

snap refresh snapd --edge

And verify by running snap list |grep snapd command.

To switch back the daemon package to stable channel, use command:

snap refresh snapd --stable

via: this post.

How to Delay or Tell When to Update Snap Apps in Ubuntu

Ubuntu automatically checks and updates all installed Snap packages 4 times every day. Here’s how you can delay or assign a certain time period for the automatic update.

Snap is an Ubuntu developed universal package format that runs in sandbox. Few core apps (such as Ubuntu Software and Firefox in 22.04) and many software in Ubuntu Software are Snap packages. Unlike classic .deb package, snap updates all the packages automatically in the background silently without user intervention.

If you didn’t block the Snap package, you must have some installed on your Ubuntu machine. And, to avoid conflict to daily work (e.g., online meetings, data backup), you may tell Snap when to do the updates.

Check when Snap will do updates:

By default, snap check (and install if any) updates 4 times per day. You may verify it by pressing Ctrl+Alt+T on keyboard to open terminal and run command:

snap refresh --time

Besides the time period and frequency, it also tells when the last done and next will occur.

Hold or Completely Disable Automatic Updates

The developer team finally added the --hold parameter, so user can hold updates for either certain app or all snaps for given time or indefinitely.

NOTE: the commands below work only for edge channel of snapd daemon at the moment of writing.

Simply open terminal and run command, and run command to hold updates for 24 hours via command:

snap refresh --hold=24h firefox

Or completely disable automatic updates for firefox via:

snap refresh --hold firefox

To disable automatic updates for all snap applications, run command:

snap refresh --hold

To re-enable automatic updates, use command to unhold all:

snap refresh --unhold

Or unhold specified app via command:

pre>snap refresh –unhold firefox

Specify time period for Snap update

To tell when and how often to check updates, it can be done by running a single command in terminal to set the value of “refresh.timer”.

For example, to allow only between 4.00am and 6.00am, and 9.00pm and 12.00pm, use command:

sudo snap set system refresh.timer=4:00-6:00,21:00-24:00

Or, only check/install updates twice in weekend via command:

sudo snap set system refresh.timer=sat,sun,0:00-24:00/2

Other examples include between 10.00pm and 11.00pm from Monday to Wednesday, and between 9.00am and 11.00am on Friday.

sudo snap set system refresh.timer=mon-wed,22:00-23:00,,fri,9:00-11:00

Or second Monday of the month between 9:00 and 11:00 via command:

sudo snap set system refresh.timer=mon2,9:00-11:00

Delay the update

Ubuntu supports to delay snap updates by specifying a value to “refresh.hold” up to 90 days.

1. Firstly, in case you don’t know your time zone short name, run command:

date

It will output the current date and time, as well as time zone (e.g., NST, AST, EST, PST, CST).

2. Next, use the command below to convert your desired time (e.g., July 7, 2022) to the right format:

date --date="CST 2022-07-07 18:22:00" +%Y-%m-%dT%H:%M:%S%:z

Replace the time zone, date and time in bold. And, copy the output time for use in next command.

3. Finally, delay snap refresh until the given date and time.

sudo snap set system refresh.hold=2022-07-07T18:22:00+08:00

To verify the change, use command:

sudo snap get system refresh.hold

Prevent update when on metered connections

If you’re running Ubuntu on a metered network connection. Which mean you have limited amount of data per month or day. You can prevent Snap from doing updates by running command:

sudo snap set system refresh.metered=hold

To undo this change, use command:

sudo snap set system refresh.metered=null

Ubuntu is distributing more applications as the universal Snap package, but some users don’t like them. So I’m writing this tutorial for those want to completely get rid of Snap and prevent it from being installed back.

NOTE 1: Before getting started, please backup your app data, e.g., Firefox bookmarks. Attention that Ubuntu Software and App Center will also be removed after following this tutorial.
NOTE 2: This tutorial is tested and works in Ubuntu 22.04 and Ubuntu 24.04. It should also work on official flavors, e.g, XUbuntu, KUbuntu, etc.

Step 1. Remove Snap apps and the Daemon

Press Ctrl+Alt+T on keyboard to open a terminal window. When it opens, run the commands below one by one.

1.) List all installed snap applications:

snap list

They are by default Snap Store (Ubuntu Software), Firefox, default theme, and few core packages.

2.) Remove the apps one by one, Firefox and Snap-store go first, then theme package, gnome platform (in sandbox), and finally base packages and snapd daemon. NOTE: the package names may vary depends on “snap list” output.

sudo snap remove --purge firefox
sudo snap remove --purge snap-store
sudo snap remove --purge gnome-3-38-2004

Also run snap remove command to remove “gtk-common-themes”, “snapd-desktop-integration”, “bare”, “core20”, and finally “snapd”.

3.) Finally remove the Snap daemon package via apt:

sudo apt remove --autoremove snapd

Step 2. Block Snap package

After completely removed snap packages, you may prevent Ubuntu from installing them back by settings low priority for the Snapd package. Here’s how to do the trick inspired by the way Linux Mint 20 did.

1.) Press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to create and open a configuration file:

sudo gedit /etc/apt/preferences.d/nosnap.pref

For Ubuntu 24.04, replace gedit with gnome-text-editor. For non-GNOME desktop, use your system text editor or nano (Ctrl+S to save, and Ctrl+X to exit) that works for all.
When the file opens, paste lines below to tell refuse snapd from any repository:

# To prevent repository packages from triggering the installation of snap,
# this file forbids snapd from being installed by APT.

Package: snapd
Pin: release a=*
Pin-Priority: -10

2. After save the file, refresh package cache via command:

sudo apt update

Now, whenever you try to installed a Snap package or the daemon, it outputs either unmet dependencies (snapd) or package has no installation candidate.

How to Restore:

If you change your mind, run the commands below at any time will install back the Snap apps.

Firstly, run command in terminal (Ctrl+Alt+T) to unblock the daemon:

sudo rm /etc/apt/preferences.d/nosnap.pref

Then, install Ubuntu Software via command:

sudo snap install snap-store

And install Firefox as snap if you want by running command:

sudo apt install firefox

This simple tutorial shows how to search for, install, remove, and list installed Snap applications in Ubuntu from command line.

Snap is an universal Linux package format developed by Canonical, the company behind Ubuntu. Though many users hate the Snap apps, it’s hard to keep away from it since many popular applications (e.g., VLC, Spotify, VS Code, Android Studio) offer official Ubuntu binaries through Snap rather than classic deb package.

As Ubuntu Software still sucks and does not load application pages quite often, you can run followings command instead to search for & install snap applications.

1. Searching for Snap Apps in Terminal:

Simply open terminal from system application launcher. You can then either run snap find or snap search command follow with app name to query the store for available packages.

Both commands below do the same searching for GIMP packages:

snap find gimp

snap search gimp

For the verified publisher, you’ll see a green check mark after the publisher name.

2. Command to Install a Snap App:

To install a Snap application package, simply run snap install command follow with the package name.

After searching for an app, you can then select install one from available packages by running command (VLC for instance):

snap install vlc

Some applications support for installing with --classic flag to access files outside user’s home directory. So, the command could be:

snap install vlc --classic

Usually, we install Snap applications from the stable channel. There are also beta, edge, candidate channels include packages for testing purpose. For example, install VLC from its Beta channel, use command:

snap install vlc --channel beta

3. How to List installed Snap applications:

To list all installed snap applications, simply run snap list in terminal.

snap list

While “core” and “core18” are snap core packages, “snap-store”, “snap-store-proxy”, and “snap-store-proxy-client” relates to the Ubuntu Software.
All others are user installed packages, though “gnome-3-xxx” packages were installed automatically as dependency platform.

Snap apps update automatically when new release packages published. So, there may be old packages present in your system after using them for a period of time. To list all of them, use command:

snap list --all

Old packages should be marked as ‘disabled’.

4. How to Remove Snap Apps via command:

To remove a snap package, simply run snap remove command follow with package name.

In the case, I’m going to remove VLC snap package via command:

snap remove vlc

NOTE that the dependency platform (e.g., gnome and wine) won’t to be removed while removing the snap that requires it.

The previous remove command will leave a snapshot of app data on your system. Use --purge flag will clear all the app data:

snap remove --purge vlc

By running snap list --all command in terminal, you may see some old versions of app packages left in system marked as “disabled”. To remove one of the disabled package, there’s a ‘revision‘ flag can do the job. For example, remove chromium marked as rev 2254:

snap remove chromium --revision=2254

Thanks to @Fernando, the command below will free up disk space by removing all the old disabled snap packages:

snap list --all | awk '/disabled/{system("sudo snap remove " $1 " --revision=" $3)}'

Summary:

In brief you can run snap find APP_NAME or snap search APP_NAME to search for available packages. Use snap install PACKAGE_NAME or snap remove PACKAGE_NAME to install or remove an application. And run snap list to list all installed snap applications.

Install OBS Studio Easily via Snap in Ubuntu

Last updated: June 25, 2018

For those who don’t want to add third-party repositories, the free and open-source streaming and recording program OBS Studio now can be easily installed in Ubuntu via Snap package.

Snap is an universal Linux package format. Snap application runs in sandbox and it auto-updates itself once a new release is out and snapped by the maintainer.

The latest OBS Studio 21.1.2 is now available as snap package. You can easily install it from Ubuntu Software:

For Ubuntu 16.04 users who never installed a snap package, run command sudo apt install snapd first to install the daemon.

Or run command in terminal (Ctrl+Alt+T) to install the OSB Studio snap package:

snap install obs-studio

You may found that the snap package is kinda large in file size that because it bundles almost all its dependencies.

NOTE: To access webcam and content on external storage, you need to run 2 two commands:

sudo snap connect obs-studio:camera

sudo snap connect obs-studio:removable-media

Finally launch the software from Gnome launcher or Unity launcher (may need to log out and log in back) and enjoy!

The latest release of Eclipse IDE now is quite easy to install in Ubuntu 16.04, and Ubuntu 18.04 since it’s made into snap package.

Snap is an universal Linux package format. It ships with most run-time libraries so it’s normally large in file size. The snap applications run in sandbox and they can be installed directly from Ubuntu Software.

1. So you can just open Ubuntu Software, search for and install Eclipse 4.7.3a snap package:

For those prefer Linux command, run command in terminal to install the Eclipse snap:

snap install --classic eclipse

2. Eclipse needs java. If you don’t have it, run command in terminal to install OpenJDK java environment:

sudo apt-get install default-jre

You can also install Oracle Java 8 and/or 10 via this tutorial.

You Can Now Install Skype in Ubuntu via Snap

Last updated: February 1, 2018

Skype for Linux now is available as snap, the universal Linux app packaging format, with easy install and automatic updates.

London, UK – 1st February 2018 – Canonical, the company behind Ubuntu, announces today that Skype is now available as a snap, the universal Linux app packaging format. Available as of today, the release means that Skype can deliver its communication service to a wider range of Linux users, including millions on Ubuntu.“, it’s announced in Ubuntu Insights.

For Ubuntu 16.04 users who’ve never installed a snap package, first install snapd daemon in terminal (Ctrl+Alt+T):

sudo apt-get install snapd snapd-xdg-open

The snap package can be installed directly from Ubuntu Software. At the moment, it’s skype 8.14.0.10:

You can also open terminal and run command to install the snap:

snap install skype --classic

And the snap automatic updates itself when a new release is out and published.

To launch Skype, search it from application launcher (may need re-login) or run command:

/snap/bin/skype

Uninstall:

To uninstall the snap, either use Ubuntu Software or run command:

snap remove skype