Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debian: apt-get install -y shellcheck installs older version #704

Closed
alberto56 opened this issue Jun 28, 2016 · 6 comments
Closed

debian: apt-get install -y shellcheck installs older version #704

alberto56 opened this issue Jun 28, 2016 · 6 comments

Comments

@alberto56
Copy link

Perhaps we could specify in the README that apt-get install might install an earlier version; in my case apt-get install is installing version: 0.3.4

@Herst
Copy link

Herst commented Jun 29, 2016

Having ancient versions in the Debian repositories should come to now surprise to any Debian user but mentioning it really can't do any harm. It would be great though if shellcheck had its own Debian repo but I guess this would mean a lot of work.

@brother
Copy link
Collaborator

brother commented Jun 30, 2016

Pretty much true to most distributions with some sense of "stable" to them (debian seem to be very late on the releases even in testing for shellcheck though).

https://github.com/koalaman/shellcheck/releases (0.4.4 is latest)
https://tracker.debian.org/pkg/shellcheck (0.3.7 in testing, unstable and experimental. 0.3.4 in stable)
https://launchpad.net/ubuntu/+source/shellcheck (0.3.7 in latest stable and next release - probably no maintainer just a import from debian)
https://apps.fedoraproject.org/packages/ShellCheck (0.3.7 for fedora 23 and 24)
https://www.archlinux.org/packages/community/x86_64/shellcheck/ (0.4.4 \o/)

Pointing fingers at anyone distribution is not very friendly. Describing that packaged versions from distributions will always be behind the git HEAD and so on is on the other hand a good idea.

@dialex
Copy link

dialex commented Aug 30, 2017

Since we can't wait for distributions to include the latest version, since it takes ages...
How can we install the latest version (1) without compiling from source and (2) without installing a package manager (ie. cabal)?

I noticed there's a link to download a freshly built binary. Can anyone provide the commands to manually use that binary to do the installation? We could even add those steps to the readme, right @koalaman ?

@koalaman
Copy link
Owner

You just extract and run it. There's no installation.

@dialex
Copy link

dialex commented Aug 30, 2017

You're right. I've used these steps to make it globally available:

# Download
wget -P tmp_install_folder/ https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz
# Extract
tar xvf tmp_install_folder/shellcheck-latest.linux.x86_64.tar.xz -C tmp_install_folder
# Make it globally available
cp tmp_install_folder/shellcheck-latest/shellcheck /usr/bin/shellcheck
# Cleanup
rm -r tmp_install_folder

I think you can close it now.

@KEINOS
Copy link

KEINOS commented Nov 6, 2020

The @dialex solution above still works, but there are some points that you should note.

Change the download URL

The URL to wget should be github.com and not storage.googleapis.com.

Otherwise, you'll get the below message.

$ ./shellcheck --version
You are downloading ShellCheck from the wrong URL!
Please update to the latest one:
https://github.com/koalaman/shellcheck/releases/download/latest/shellcheck-latest.linux.x86_64.tar.xz

For more information, see:
https://github.com/koalaman/shellcheck/issues/1871

Don't forget to install xz

If you get xz: Cannot exec: No such file or directory while extracting then possibly you are missing the xz-utils package. Most of the Debian-based Docker images don't have it by default.

$ tar xvf shellcheck-latest.linux.x86_64.tar.xz
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

$ tar --version
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
$ # Install xz
$ apt-get install xz-utils
...
$ # Extract
$ tar xvf shellcheck-latest.linux.x86_64.tar.xz
shellcheck-latest/README.txt
shellcheck-latest/LICENSE.txt
shellcheck-latest/shellcheck

$ ./shellcheck-latest/shellcheck --version
ShellCheck - shell script analysis tool
version: 0.7.1
license: GNU General Public License, version 3
website: https://www.shellcheck.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants