Score:3

Can't uninstall Scala

tl flag
Tom

I installed Scala using cs setup as described on the Scala website: https://www.scala-lang.org/download/

Now I can't uninstall it for some reason. I tried sudo apt-get purge scala and sudo apt-get remove scala but it just outputs "Package 'scala' is not installed, so not removed". However, the command scala is still working.

How can I uninstall scala?

waltinator avatar
it flag
Since you installed `scala` outside the Ubuntu packaging system, you cannot uninstall `scala` with the Ubuntu packaging system. Consult the `scala` instalations, If there is a `Makefile`, try `sudo make uninstall`.
hr flag
It looks like the instructions you followed download and run a binary setup program named `cs`. Running `./cs uninstall --help` suggests you can uninstall everything with `./cs uninstall --all`. If you used `sudo` to install you will need to do the same to uninstall. See https://get-coursier.io/docs/cli-install#uninstall
us flag
@steeldriver That comment is an answer. Please post an answer
hr flag
@ArchismanPanigrahi - done ;)
Score:4
hr flag

The instructions that you linked tell you

To install Scala, it is recommended to use cs setup, the Scala installer powered by Coursier.

The same cs program may be used to uninstall the software - as you can verify by invoking its built-in help:

$ ./cs --help
Usage: ./cs <COMMAND>
Coursier is the Scala application and artifact manager.
It can install Scala applications and setup your Scala development environment.
It can also download and cache artifacts from the web.

Install application commands:
  install    Install an application from its descriptor.
  list       List all currently installed applications.
  setup      Setup a machine for Scala development.
  uninstall  Uninstall one or more applications.
  update     Update one or more applications.

Application channel commands:
  channel  Manage additional channels, used by coursier to resolve application descriptors.
  search   Search application names from known channels.

Java commands:
  java       Manage installed JVMs and run java.
  java-home  Print the home directory of a particular JVM.

Launcher commands:
  bootstrap  Create a binary launcher from a dependency or an application descriptor.
  launch     Launch an application from a dependency or an application descriptor.

Resolution commands:
  fetch    Transitively fetch the JARs of one or more dependencies or an application.
  resolve  Resolve and print the transitive dependencies of one or more dependencies or an application.

Other commands:
  version  Prints the coursier version

and

$ ./cs uninstall --help
Usage: ./cs uninstall [options] [app-name*]
Uninstall one or more applications.
The given name must be the application executable name, which may differ from the descriptor name.

Examples:
$ cs uninstall amm
$ cs uninstall bloop scalafix
$ cs uninstall --all

Help options:
  --usage                                        Print usage and exit
  -h, -help, --help                              Print help message and exit
  -help-full, -full-help, --help-full, --full-help  Print help message, including hidden options, and exit

Uninstall options:
  --dir, --install-dir string?
  --all
  -q, --quiet                   Quiet output
  -v, --verbose                 Increase verbosity (specify several times to increase more)

For additional details see the Uninstall section of the coursier documentation

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.