Home > Enterprise >  Can't install rustc version 1.7.0 with apt
Can't install rustc version 1.7.0 with apt

Time:12-24

I am trying to install Pachev_FTP server on Ubuntu 20.1 I need to have have rustc installed on the system to use this. As mentioned in the Installation guide, I need to have rustc version 1.7.0. But when I installed rustc with apt install rustc it installed version 1.53.0. So I followed this guide and tried installing the correct version with

apt install rustc=1.7.0

But it gives me an error saying E: Version '1.7.0' for 'rustc' was not found. How do I install the correct version of rustc?

CodePudding user response:

Like Luke Woodward mentioned I was able to install rust version 1.7.0 by following this

  1. Uninstall the initial rustc installation (if installed)
apt autoremove rustc
  1. Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Add ~/.cargo/bin to the $PATH (add this to your .bashrc (or your source file) to make this permanent)
export PATH=~/.cargo/bin:$PATH
  1. Install the needed version of rust
rustup default 1.7.0

CodePudding user response:

It turns out that this project will compile with the latest version of Rust (1.57.0 at the time of writing), provided you update one of the dependencies:

  • Edit Cargo.toml and change the line slog="1.5.2" to slog="1.7.1".
  • Update the Cargo.lock file by running cargo generate-lockfile.
  • Re-run cargo build --release.

I got 21 warnings but it did at least compile.

This package won't compile on Windows as it requires a package that isn't available for Windows.


Note that as mentioned in the comments, this project has an unpatched security vulnerability. It seems you are well aware of this and are trying to build this project only to practise reproducing this vulnerability, rather than actually using it to serve files.

  • Related