How can the default track of snapd be replaced by another track?

For snaps that whose default track has not been specified within their snapcraft.yaml file, how can the default track of snapd be replaced by another track, such as latest/edge instead of latest/stable?

You can use snap refres --channel=latest/edge which refreshes the snap from a given track/channel, or snap switch --channel=latest/edge, which only changes the channel, but does not attempt an immediate refresh.

1 Like

How can the default track of snapd be replaced by another track?

I am sorry, but you have misinterpreted my question (although after reading my question again, I have realised that my phrasal of it was more likely to cause that than not). What I had meant to ask is: when no track has been specified by a snap, whatever software is responsible for installation of snaps (I am guessing the snap daemon) shall install the aforementioned snap from the latest/stable track. Am I able to cause it to install snaps from another track, such as latest/edge?

you mean you’d want to globally force the usage of latest/edge for everything you install ?

i don’t think you can currently (and it would be a bit insane too since edge is for many/most snaps the development channel that auto-builds of source trees go in in an untested manner, with all the bugs and breakages that get introduced during development) beyond doing something like adding a wrapper script and alias in your shell to wrap the snap install call …

1 Like

How might I add an alias or “wrapper” to do this? I need not have you explain it, but I am not sure exactly what sort of tutorial to search for.

you could for example add something like:

snap() {
  case $1 in
    install)
      shift
      command snap install --channel=edge $@
      ;;
    refresh)
      shift
      command snap refresh --channel=edge $@
      ;;
    *)
      command snap "$@"
      ;;
    esac
}

to your ~/.bashrc … or write a shell script you call instead of snap…

1 Like