Skip to content

Instantly share code, notes, and snippets.

@DanielGGordon
Last active January 20, 2023 14:55
Show Gist options
  • Save DanielGGordon/160c32f42f233a4025ce33ee5f4a40f2 to your computer and use it in GitHub Desktop.
Save DanielGGordon/160c32f42f233a4025ce33ee5f4a40f2 to your computer and use it in GitHub Desktop.
Update Scala Version to Some Version on Debian/Ubuntu/Mint Linux Distrubtions via CLI
# Author: Daniel Gordon
# License: MIT
# Created: 10/28/2016
#
# Mini Script for Updating Scala to some Scala version
# Does not update SBT. Just Scala.
# See <http://www.scala-sbt.org/0.13/docs/Installing-sbt-on-Linux.html> for upgrading SBT
# This is for Debian/Mint/Ubuntu distributions only
#
# TO USE AS A SCRIPT:
# Download this as a file and rename it so updateScalaVersion.sh to use it as a script
# Comment out the first line of code and uncomment the line above it to use as a script like this:
# ./updateScalaVersion 2.11.8
# Don't forget to run "chmod +x" on the script, and you will likely need to run it in `sudo`
# Running as a script is UNTESTED as of this writing.
#
# ALL COMMANDS NEED TO BE RUN WITH "SUDO"
# scalaVer="$1"
scalaVer="2.11.8"
apt-get remove scala-library scala
wget www.scala-lang.org/files/archive/scala-"$scalaVer".deb
dpkg -i scala-"$scalaVer".deb
apt-get update
apt-get install scala
Copy link

ghost commented Jun 28, 2020

When dpkg -i is already installing scala, why is apt-get install scala also required?

@gunjan075
Copy link

When dpkg -i is already installing scala, why is apt-get install scala also required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment