Improve Linux installation docs to avoid apt does not have a stable CLI interface warning#10578
Conversation
…CLI interface` warning When using the [Linux manual instruction steps](https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt) from within a script, the following is logged: > WARNING: apt does not have a stable CLI interface. Use with caution in scripts. These installation have been copied into scripts [many times](https://github.com/search?q=%22sudo+chmod+go%2Br+%2Fetc%2Fapt%2Fkeyrings%2Fgithubcli-archive-keyring.gpg%22+language%3AShell&type=code&l=Shell). Migrates `apt` -> `apt-get` to address this. [Further reading](https://askubuntu.com/a/990838).
|
Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message. |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Linux installation instructions to use apt-get instead of apt in scripted contexts, preventing the “apt does not have a stable CLI interface” warning.
- Switched all
apt updatecalls toapt-get update - Swapped
apt installforapt-get installin both wget-check and final install steps
Comments suppressed due to low confidence (2)
docs/install_linux.md:19
- Consider cleaning up the temporary file after use (e.g., adding
&& rm $outafter the tee command) to avoid leaving artifacts in the working directory.
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
docs/install_linux.md:20
- [nitpick] You could simplify this step by using
sudo mv $out /etc/apt/keyrings/githubcli-archive-keyring.gpginstead of piping throughtee, reducing overhead and improving readability.
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
|
Hey @JackPGreen 👋 Sorry this got missed. Tyler moved to a different team and this got missed in the transition. I'll work on reviewing this soon. |
|
Hey @JackPGreen, sincere apologies for the delay getting to this one and thank you again for working to improve I discussed this more with the team, and we decided loosely that our intention is for this to be run interactively, so we want to stick to With that in mind, I'll close this out for now. Please feel free to reach out if I misunderstood anything! Related: #11216 |
When using the Linux manual instruction steps from within a script, the following is logged:
These installation instructions have been copied into scripts many times.
Migrates
apt->apt-getto address this.Further reading.