Home>
I can't install SBT in my environment

I have installed the following command from the SBT homepage (https://www.scala-sbt.org/download.html) according to the installation procedure, but I cannot install it.
Please let me know how I can install it.
Also, please point out if i am a beginner and may not have the necessary information.

Actual situation

Type the following command to install SBT.

  

  ~ $echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
  ~ $curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
  ~ $sudo apt-get update
  ~ $sudo apt-get install sbt

But the second line

  

~ $curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add

When I type

, I get the following response:

  

Command 'curl' not found, but can be installed with:
  sudo apt install curl
  gpg: No valid OpenPGP data found.

The response of the following commands is as follows.

  

~ $sudo apt-get update
  E: Invalid entry 1st line list file /etc/apt/sources.list.d/sbt.list (Suite)
  E: Unable to read source list.
  ~ $sudo apt-get install sbt
  E: Invalid entry 1st line list file /etc/apt/sources.list.d/sbt.list (Suite)
  E: Unable to read source list.
  E: Invalid entry 1st line list file /etc/apt/sources.list.d/sbt.list (Suite)
  E: Unable to read source list.

What I actually tried

As in the command response on the second line,

  

sudo apt install curl

I typed

,

  

~ $sudo apt install curl
  E: Invalid entry 1st line list file /etc/apt/sources.list.d/sbt.list (Suite)
  E: Unable to read source list.
  E: Invalid entry 1st line list file /etc/apt/sources.list.d/sbt.list (Suite)
  E: Unable to read source list.

and I couldn't execute it.I looked at the contents of /etc/apt/sources.list.d/sbt.list, but there were a lot of similar addresses (below). I found many packages (?) And files for SBT when I searched, but I didn't know what to do.

  

:/etc/apt/sources.list.d $cat sbt.list
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/
  deb https://dl.bintray.com/sbt/debian/

  • Answer # 1

    First, delete the file that failed in the first command.
    Thanks to this, apt can no longer be used.

    sudo rm /etc/apt/sources.list.d/sbt.list

    Install curl first.

    sudo apt install curl

    When you access the url accessed by the first command with curl as follows,

    curl https://dl.bintray.com/sbt/debian

    The following results are returned.

    Moved to  http : //dl.bintray.com: 80/v1/content/sbt/debian/

    It looks like the URL has changed.
    So please do as follows.

    echo "deb https://dl.bintray.com/v1/content/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d /sbt.list