30

I'd like to play with the Rust language on Ubuntu, but there don't seem to be any packages. Did I miss it or is there some problem?

poolie
  • 9,161
  • 4
  • 38
  • 62

4 Answers4

18

On ubuntu 16.04 you can use official apt package without install any other ppa repository.

sudo apt install rustc

... and don't forget cargo

sudo apt install cargo

... but the versions are not really updated: (August 2016) rustc 1.7.0 and cargo 0.8.0. Unfortunally cargo is not compatible with IDEA rust plugin... I used the script pointed in Rust Documentation.

Michele d'Amico
  • 281
  • 2
  • 4
  • 1
    I haven't worked with Rust yet, but I've got good experiences with tools that manage multiple installations in other languages: rbenv for Ruby, nvm for Node.js and so on. [rustup.rs](https://github.com/rust-lang-nursery/rustup.rs) seems to be something similar for Rust. You should be able to use the current versions of Rust and Cargo with it, independently of what is packaged for Ubuntu. – Henning Kockerbeck Dec 08 '16 at 02:30
  • By installing `rustc`, the `cargo` will be installed too! – Amir Fo May 04 '20 at 16:50
  • Tried this on Ubuntu 20.04, and while it installs it, I can't seem to figure out where to find rustup – eri0o Jul 21 '20 at 01:05
17

Jonathon Fernyhough has a PPA (personal package archive) where he provides unofficial nightly and versioned builds of rust, but it does require libstdc++ 6.x (Xenial uses 5.4.0). With Yakkety you can install Rust 1.10 from the universe repository, and 1.13 with Zesty.

Rust can be installed from this PPA by running the following, as well as llvm which is now needed:

sudo add-apt-repository ppa:jonathonf/rustlang (accept to add llvm)
sudo apt-get update
sudo apt-get install rustc

Alternatively different backport ppas like rustlang-1.13 or rustlang-test can be substituted instead of rustlang to get a the latest unstable code or a particular version.

Kevin Bowen
  • 19,395
  • 55
  • 76
  • 81
Chris Pick
  • 427
  • 4
  • 5
  • 3
    That PPA seems to not be update at the moment (March 2016) - the current stable version should be 1.7, but the latest stable version in the PPA is 1.4. – Thomas W. Mar 03 '16 at 22:14
  • 1
    It turns out it *is* still updated, though possibly lagging behind - currently (May 2016) 1.7 is provided. – Thomas W. May 07 '16 at 11:56
  • 3
    The PPA seems to have been removed now (weblink is dead, `sudo add-apt-repository ppa:hansjorg/rust` does not work any more). – Thomas W. Aug 21 '16 at 14:12
  • 1
    That PPA now states "You should probably just use rustup." – Daniel Mar 19 '17 at 14:40
12

This answer is old

I see there is a Debian prospective package bug 689207 still open. There are initial packages but it's not ready to be in the distribution. There is also a Debian wiki page about the packaging effort.

It alludes to the fact that Rust's compiler is written in Rust so the bootstrapping process is strange, so perhaps that's why it's not packaged yet.

There are some issues in upstream Rust that make it hard to package. Bootstrapping is apparently not a catastrophic problem as packagers can start from a binary snapshot.


Updated May 2016: Happily, rustc is now in Debian testing, so should be in Ubuntu within a year or so.

poolie
  • 9,161
  • 4
  • 38
  • 62
  • 3
    The link to the Wiki is dead, and I can't find a related page to where that same content may have migrated. This page is relevant: https://wiki.debian.org/Teams/RustPackaging/Bootstrap. – seh Nov 13 '14 at 17:24
  • 2
    Now that Rust 1.0 has been released, the objection that we would need to continually update the snapshot is no longer relevant. There is in fact a package in unstable: https://tracker.debian.org/pkg/rustc – gmatht Jun 15 '15 at 05:52
  • [Rust as of 1.10 can bootstrap from an official release not a nightly build](https://blog.rust-lang.org/2016/07/07/Rust-1.10.html) which should remove another impediment to packaging. – poolie Aug 15 '16 at 16:41
  • the Debian bug is now closed and archived. – Kornel Jan 13 '17 at 01:48
  • This answer doesn't seem relevant to 20.04 – eri0o Jul 21 '20 at 01:11
9

I might be too late in commenting here but I found that using https://rustup.rs/ was easier. Here is what I ran in terminal to have rust installed on my Ubuntu subsystem for Windows 10:

curl https://sh.rustup.rs -sSf | sh
Zanna
  • 69,223
  • 56
  • 216
  • 327
Sushruth
  • 191
  • 1
  • 2