pauloo27/tuner

Improve Debian installation script

Closed this issue · 5 comments

Hi!

I just tried tuner and it works well, nice project!

I noticed that there are two problems with the installation script for Debian.

1) golang version

In Debian 10 golang is in version 1.11, and in Debian 11 golang is version 1.15.
https://packages.debian.org/buster/golang-go
https://packages.debian.org/bullseye/golang-go

The installation will fail with this error message:

...

github.com/Pauloo27/tuner/command
github.com/ananagame/rich-go/client
golang.org/x/text/internal/colltab
golang.org/x/text/cases
golang.org/x/text/collate
github.com/dop251/goja
github.com/kkdai/youtube/v2
# github.com/kkdai/youtube/v2
../go/pkg/mod/github.com/kkdai/youtube/v2@v2.7.10/client.go:372:9: undefined: io.ReadAll
../go/pkg/mod/github.com/kkdai/youtube/v2@v2.7.10/client.go:407:9: undefined: io.ReadAll
note: module requires Go 1.17

So currently in Debian, the golang should be installed from the Go official website, for example:
https://www.linuxcapable.com/how-to-install-go-golang-compiler-on-debian-11/

2) pip3

In Debian, pip3 is not installed with python3 package. Pip3 is installed with python3-pip package.

So after fixing both golang and pip3 issues, the updated installation script would look something like below. The updated script is tested successfully in fresh Debian 11 installation. It should also work in Debian 10.

#!/bin/bash

C_DEEPSKYBLUE3="\033[38;5;32m"
NO_FORMAT="\033[0m"

echo -e "Debian-based install script for
$C_DEEPSKYBLUE3
████████╗██╗   ██╗███╗   ██╗███████╗██████╗ 
╚══██╔══╝██║   ██║████╗  ██║██╔════╝██╔══██╗
   ██║   ██║   ██║██╔██╗ ██║█████╗  ██████╔╝
   ██║   ██║   ██║██║╚██╗██║██╔══╝  ██╔══██╗
   ██║   ╚██████╔╝██║ ╚████║███████╗██║  ██║
   ╚═╝    ╚═════╝ ╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝
$NO_FORMAT
"

echo "Your system info:"
cat /etc/os-release

echo "Installing libmpv-dev, wget, python, git, make, and the Icon Font"
sudo apt-get install fonts-font-awesome libmpv-dev wget git make python3 python3-pip --no-install-recommends

echo "Installing GoLang"
wget https://golang.org/dl/go1.17.linux-amd64.tar.gz
sudo tar -zxvf go1.17.linux-amd64.tar.gz -C /usr/local/
echo "export PATH=/usr/local/go/bin:${PATH}" | sudo tee /etc/profile.d/go.sh
source /etc/profile.d/go.sh

echo "Installing youtube-dl"
sudo -H pip3 install --upgrade youtube-dl

echo "Cloning Tuner..."
git clone https://github.com/Pauloo27/tuner.git

echo "Installing Tuner"
cd tuner
make install

echo "Deleting Tuner local folder"
cd ..
rm -rf tuner

Thank you!

Do you want to open a PR or is it ok to me to update it?

You can update it if it's okay to you.

Since the filename is now different, the link in the README doesn't work.

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Pauloo27/tuner/master/install.sh)"
=>
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Pauloo27/tuner/master/install-debian.sh)"

Btw, was it intentional to remove the # from the start of the script?

Now the install-debian.sh has:
!/bin/bash

I guess it should be:
#!/bin/bash

Btw, was it intentional to remove the # from the start of the script?

No, my mistake. Thanks for the heads up! Should be fixed by now.

Since the filename is now different, the link in the README doesn't work.

I think I've changed it already, haven't it?

No, my mistake. Thanks for the heads up! Should be fixed by now.

Nice!

I think I've changed it already, haven't it?

Oh, I just was looking the old README.. :) Yep, it's changed, my bad.