You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This often costs us (GitHub CLI maintainers) time to triage and asses these issues. Sometimes it's not evident that the user has installed gh via snap, as they don't always include that information in their report. Typical issues reported are "permission denied errors", git clone errors, filesystem errors, and other edge-case bugs that aren't present in our own builds of GitHub CLI, but are present in the gh snap.
I do not believe that these bugs are explicitly caused by your own repository, but I do think that snap (or, more generally, containerized or sandboxed packages) is an insufficient mechanism to distribute and run apps like ours. Installing an official gh binary locally on the system (either directly or from our debian package repo) is a vastly superior and stabler method to keep running gh without extra trouble, and yet when Ubuntu users type gh, they get suggested to install the snap, which sets them up for a bad experience:
$ gh
Command 'gh' not found, but can be installed with:
sudo snap install gh # version 1.12.1-pre.0-15-gbf5b34d0, or
sudo apt install gitsome # version 0.8.0+ds-4
See 'snap info gh' for additional versions.
I do not know of ways to fix these issues, but I would much rather that the gh snap isn't featured so prominently, and the only way I can imagine fixing that is by unpublishing gh from the Snap store. An even more ideal solution would be so that nobody is allowed to publish a snap for GitHub CLI again, but I guess neither of us has that level of control over the Snap store.
Hey just curious how do I get back on the non snap version? I see the install instructions here: https://github.com/cli/cli/blob/v2.0.0/docs/install_linux.md but when I run $ snap remove gh
and then those instructions I get $ gh --version bash: /snap/bin/gh: No such file or directory
I assume I have the wrong directory for the bash alias. How do I fix that? What is the file for the normal install?
@jaron-l "Classic" does sound like it would be a better confinement method for CLI tools such as ours. However, if users are required to explicitly opt into classic by means of --classic flag at install time, and if the default suggestion from Ubuntu when one types gh remains just sudo snap install gh (i.e. without the --classic flag), I think we'd still have a problem because I imagine the typical user not knowing that they are supposed to install in classic mode.
sudo snap install gh won't work if it's a --classic snap... you'd get an error message saying the --classic flag is required
Can confirm this. "Classic" is the type of snap and the user gets prompted to add it if it's not there saying that they they need to add it if they know the risks. A good example of this is the vscode snap.
I use Ubuntu as my primary OS and I expect for many snaps to require classic, for them to fail without --classic and for me to retry with --classic. When I tried to use the snap gh it failed because it couldn't write to /etc. IMO the snap should not exist the way it is right now and agree with the original post.
Reacted by BJ Cardon, Phil Corbett and rayrakesgh-hash
Not an expert on snaps yet BUT to confirm what was said earlier, when this would be packages in the classic snap format the user must install with --classic and can NOT install it "wrongly". The first message would suggest it without --classic I think, but they would be reminded when trying that they need the switch.
I do think snap is actually a good way to distribute this. I installed the media player Clementine today and I needed to set a specific option to read and write from mounted drives. It had permission to my home directory by default. So even for the sandboxed snaps there are ways to get more permissions, but I think for this the classic package is probably the only thing that makes sense. Still because snap works on so many distros it is better than to maintain so many packages.
So my suggestion would be not to unpublish it, but to do a proper classic snap that has all the permissions and just acts like a normal binary from any other package manager that is distro specific.
Because of the tight integration into Ubuntu and derivates, it thinks it's amazing to have a message suggest an installation method for something that is outside the regular repos. That is FAR superior to having to add a PGP key, repo ... and install through apt ...
Reacted by Phil Corbett, Mateusz, Alex Lowe and Brycen G
So, @mislav, you guys can't build a proper snap and so you take your ball and go home? One of the links you provide as "evidence" of snap being insufficient is a thread on somebody using docker?
Reacted by Andrew Gozzard, lena, Mohit Raj, Bryan Weber, Denis Belyaev, ajp109, goldstar611, Colton Loftus, d-g, Juan Luis Cano Rodríguez and 1 more
@mislav Are you saying "remove gh from your machine and rest".
I tried to instal gh using sudo apt install gh
The machine returns E: Unable to locate package gh
@jonbirge I admit that I wouldn't know how to build a better snap. My argument is that gh should never be packaged and distributed in any “containerized” format. From the Wikipedia page about snap:
Snaps are self-contained applications running in a sandbox with mediated access to the host system.
GitHub CLI, by design, should not be running in any kind of sandbox. It wants to have full access to the host system. It's true that some of the resources I've linked to are about Docker, not snap, but the argument is the same.
@ChrisNzoka GitHub CLI installation instructions for Debian/Ubuntu include information on how to add our own Debian package repository to your package sources. Without that, apt install gh will not work (or it will install the wrong thing).
@mislav There are multiple ways for a snap to access the file system, some more safe than others, but all pretty easy. Both snap and docker are containerized, but unlike docker snap is designed to—-among other things—package CLI user tools whereas docker is aimed at server workloads, and so your statement is flat out wrong. Plenty of tools with the same requirement as yours work well as snaps, such as VS Code. Bottom line: if you don’t want somebody doing a poor job packaging your software do it right yourself. People want things like snap and flatpak because they are better than the old packaging formats.
Reacted by Salim B, Mateusz and Alex Lowe
Reacted by Andrew Gozzard, lena, Gaël BEAUDOIN, Vašek Purchart, ajp109, mildmojo, d-g and Robert Vrooman
@mislav hey there. I'm a snapd developer and I'd love to help you guys out to make gh snap just prefect and working out of the box for everyone. Could we explore making gh use classic confinement as it was discussed above? What are the current blockers for this? Is it a process or a technical problem that's in the way?
To nás (správcov GitHub CLI) často stojí čas na triedenie a posúdenie týchto problémov. Niekedy nie je zrejmé, že používateľ nainštaloval gh cez snap, pretože nie vždy uvedú túto informáciu vo svojom hlásení. Typické hlásené problémy sú chyby „permission denied“ (odmietnutie prístupu), chyby klonovania git, chyby súborového systému a ďalšie chyby na okraji prípadu, ktoré sa nevyskytujú v našich vlastných zostaveniach GitHub CLI, ale sú prítomné v gh snap.
Nemyslím si , že tieto chyby sú explicitne spôsobené vaším vlastným repozitárom, ale myslím si, že snap (alebo všeobecnejšie kontajnerizované alebo sandboxové balíčky) nie je dostatočný mechanizmus na distribúciu a spúšťanie aplikácií, ako je ten náš . Inštalácia oficiálneho binárneho súboru gh lokálne v systéme (buď priamo, alebo z nášho repozitára balíčkov Debian) je oveľa lepšia a stabilnejšia metóda na udržanie prevádzky gh bez ďalších problémov, a napriek tomu, keď používatelia Ubuntu zadajú gh, dostanú návrh na inštaláciu snapu, čo ich pripraví na zlú skúsenosť:
$ gh
Command 'gh' not found, but can be installed with:
sudo snap install gh # version 1.12.1-pre.0-15-gbf5b34d0, or
sudo apt install gitsome # version 0.8.0+ds-4
See 'snap info gh' for additional versions.
Neviem, ako tieto problémy vyriešiť, ale oveľa radšej by som uprednostnil, keby sa snap gh nezobrazoval tak výrazne, a jediný spôsob, ako si viem predstaviť, že by som to mohol vyriešiť, je zrušiť publikovanie gh v obchode Snap. Ešte ideálnejším riešením by bolo, aby už nikto nemohol publikovať snap pre GitHub CLI, ale myslím, že ani jeden z nás nemá takú úroveň kontroly nad obchodom Snap.
This often costs us (GitHub CLI maintainers) time to triage and asses these issues. Sometimes it's not evident that the user has installed gh via snap, as they don't always include that information in their report. Typical issues reported are "permission denied errors", git clone errors, filesystem errors, and other edge-case bugs that aren't present in our own builds of GitHub CLI, but are present in the gh snap.
I do not believe that these bugs are explicitly caused by your own repository, but I do think that snap (or, more generally, containerized or sandboxed packages) is an insufficient mechanism to distribute and run apps like ours. Installing an official gh binary locally on the system (either directly or from our debian package repo) is a vastly superior and stabler method to keep running gh without extra trouble, and yet when Ubuntu users type gh, they get suggested to install the snap, which sets them up for a bad experience:
$ gh
Command 'gh' not found, but can be installed with:
sudo snap install gh # version 1.12.1-pre.0-15-gbf5b34d0, or
sudo apt install gitsome # version 0.8.0+ds-4
See 'snap info gh' for additional versions.
I do not know of ways to fix these issues, but I would much rather that the gh snap isn't featured so prominently, and the only way I can imagine fixing that is by unpublishing gh from the Snap store. An even more ideal solution would be so that nobody is allowed to publish a snap for GitHub CLI again, but I guess neither of us has that level of control over the Snap store.
gh is GitHub on the command line, and it's now available in beta. It brings pull requests,
issues, and other GitHub concepts to
the terminal next to where you are already working with git and your code.
Activity
woodsmanlucas commentedon Sep 9, 2021
Hey just curious how do I get back on the non snap version? I see the install instructions here: https://github.com/cli/cli/blob/v2.0.0/docs/install_linux.md but when I run
$ snap remove ghand then those instructions I get
$ gh --version bash: /snap/bin/gh: No such file or directoryI assume I have the wrong directory for the bash alias. How do I fix that? What is the file for the normal install?
mislav commentedon Sep 9, 2021
@woodsmanlucas You can run
type ghin your shell to see what would be executed: a command, a shell function, or a shell alias.After installing the Debian package, the path to it should be
/usr/bin/gh, I think.casperdcl commentedon Sep 14, 2021
hmm interesting @mislav I would prefer to get confirmation from https://github.com/orgs/snapcore/people before doing something as drastic as unpublishing.
mislav commentedon Sep 15, 2021
Sure thing! I just wanted to make sure you're aware of the influx of issues we're seeing reported in our issue tracker due to Snap. 👍
jaron-l commentedon Sep 27, 2021
Would snap clasic resolve some of these issues? Seems like getting around confinement would help a lot.
mislav commentedon Sep 28, 2021
@jaron-l "Classic" does sound like it would be a better confinement method for CLI tools such as ours. However, if users are required to explicitly opt into classic by means of
--classicflag at install time, and if the default suggestion from Ubuntu when one typesghremains justsudo snap install gh(i.e. without the--classicflag), I think we'd still have a problem because I imagine the typical user not knowing that they are supposed to install in classic mode.casperdcl commentedon Sep 28, 2021
sudo snap install ghwon't work if it's a--classicsnap... you'd get an error message saying the--classicflag is requiredjaron-l commentedon Sep 28, 2021
Can confirm this. "Classic" is the type of snap and the user gets prompted to add it if it's not there saying that they they need to add it if they know the risks. A good example of this is the vscode snap.
charlesritchea commentedon Nov 9, 2021
I use Ubuntu as my primary OS and I expect for many snaps to require classic, for them to fail without
--classicand for me to retry with--classic. When I tried to use the snapghit failed because it couldn't write to/etc. IMO the snap should not exist the way it is right now and agree with the original post.cardonator commentedon Nov 10, 2021
Also agree here. The command doesn't work right and causes issues which seem to be gh's fault and not the snap.
nextgenthemes commentedon Dec 1, 2021
Not an expert on snaps yet BUT to confirm what was said earlier, when this would be packages in the classic snap format the user must install with
--classicand can NOT install it "wrongly". The first message would suggest it without--classicI think, but they would be reminded when trying that they need the switch.I do think snap is actually a good way to distribute this. I installed the media player Clementine today and I needed to set a specific option to read and write from mounted drives. It had permission to my home directory by default. So even for the sandboxed snaps there are ways to get more permissions, but I think for this the classic package is probably the only thing that makes sense. Still because snap works on so many distros it is better than to maintain so many packages.
So my suggestion would be not to unpublish it, but to do a proper classic snap that has all the permissions and just acts like a normal binary from any other package manager that is distro specific.
Because of the tight integration into Ubuntu and derivates, it thinks it's amazing to have a message suggest an installation method for something that is outside the regular repos. That is FAR superior to having to add a PGP key, repo ... and install through apt ...
jonbirge commentedon Jan 28, 2022
So, @mislav, you guys can't build a proper snap and so you take your ball and go home? One of the links you provide as "evidence" of snap being insufficient is a thread on somebody using docker?
ChrisNzoka commentedon Feb 17, 2022
@mislav Are you saying "remove gh from your machine and rest".
I tried to instal gh using
sudo apt install ghThe machine returns
E: Unable to locate package ghmislav commentedon Feb 18, 2022
@jonbirge I admit that I wouldn't know how to build a better snap. My argument is that gh should never be packaged and distributed in any “containerized” format. From the Wikipedia page about snap:
GitHub CLI, by design, should not be running in any kind of sandbox. It wants to have full access to the host system. It's true that some of the resources I've linked to are about Docker, not snap, but the argument is the same.
@ChrisNzoka GitHub CLI installation instructions for Debian/Ubuntu include information on how to add our own Debian package repository to your package sources. Without that,
apt install ghwill not work (or it will install the wrong thing).jonbirge commentedon Feb 18, 2022
@mislav There are multiple ways for a snap to access the file system, some more safe than others, but all pretty easy. Both snap and docker are containerized, but unlike docker snap is designed to—-among other things—package CLI user tools whereas docker is aimed at server workloads, and so your statement is flat out wrong. Plenty of tools with the same requirement as yours work well as snaps, such as VS Code. Bottom line: if you don’t want somebody doing a poor job packaging your software do it right yourself. People want things like snap and flatpak because they are better than the old packaging formats.
31 remaining items
Initial commit
zyga commentedon Jun 7, 2025
@mislav hey there. I'm a snapd developer and I'd love to help you guys out to make gh snap just prefect and working out of the box for everyone. Could we explore making gh use classic confinement as it was discussed above? What are the current blockers for this? Is it a process or a technical problem that's in the way?
casperdcl commentedon Jun 9, 2025
There was some progress in #47 I think
zyga commentedon Jun 9, 2025
Hmm this links to #47 that is closed that talks about a snapcrafters repo. A quick search on https://github.com/orgs/snapcrafters/repositories?q=gh finds nothing. Then there is https://github.com/casperdcl/cli but all I want is the user experience to be great:
This is currently published with strict confinement but is fairly recent. Are the issues with classic confinement no longer relevant?
casperdcl commentedon Jun 9, 2025
Could you try
sudo snap install --classic gh --channel edgeemybk933-debug commentedon Sep 4, 2025
100
patrron commentedon Nov 7, 2025
sues/328)
phadungkiat627 commentedon Nov 13, 2025
phadungkiat627 commentedon Nov 13, 2025
Duplicate of #69
astrojuanlu commentedon Nov 13, 2025
I think this is now done? b48244c
ved130349-blip commentedon Apr 28, 2026
zyga@x13:~$ snap info gh
name: gh
summary: The GitHub CLI
publisher: Casper (casper-dcl)
store-url: https://snapcraft.io/gh
contact: https://github.com/casperdcl/cli/issues/new/choose
license: MIT
description: |
https://cli.github.com
gh- The GitHub CLI toolghis GitHub on the command line, and it's now available in beta. It brings pull requests,issues, and other GitHub concepts to
the terminal next to where you are already working with
gitand your code.Usage
gh pr [create, list, status, view, checkout, ...]gh issue [create, list, status, view, ...]gh [auth, browse, codespace, gist, org, project, release, repo, ...]gh [cache, run, workflow, ...]gh [alias, api, attestation, config, extension, gpg-key, label, preview, ruleset, search, secret, ssh-key, status, variable, ...]gh helpsnap-id: RcphOHl3Jx7YP6wTXEJLdcGjnSTmGjNp
channels:
latest/stable: 2.74.0-19-gea8fc856e 2025-06-09 (640) 43MB -
latest/candidate: ↑
latest/beta: ↑
latest/edge: 2.74.0-19-gea8fc856e 2025-06-09 (640) 43MB -### https://snapcraft.io/gh
astrojuanlu commentedon Apr 28, 2026
Indeed
astrojuanlu commentedon Oct 13, 2026
Documentation has been amended at 1d9a43fThis is the same as #7 (comment), rebased 👍🏼@casperdcl Do you think this issue can be closed?
casperdcl commentedon Oct 13, 2026
Well given that this issue was renamed/repurposed from "unpublish" to "change to classic confinement" I suppose it can be closed as completed; yes.