简体   繁体   English

无法使用 apt 安装 rustc 版本 1.7.0

[英]Can't install rustc version 1.7.0 with apt

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.我正在尝试在 Ubuntu 20.1 上安装Pachev_FTP 服务器,我需要在系统上安装rustc才能使用它。 As mentioned in the Installation guide, I need to have rustc version 1.7.0 .如安装指南中所述,我需要 rustc 版本1.7.0 But when I installed rustc with apt install rustc it installed version 1.53.0 .但是当我使用apt install rustc时,它安装了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 .但它给了我一个错误,说E: Version '1.7.0' for 'rustc' was not found How do I install the correct version of rustc?如何安装正确版本的 rustc?

Like Luke Woodward mentioned I was able to install rust version 1.7.0 by following this就像卢克伍德沃德提到的那样,我可以按照这个安装 rust 版本 1.7.0

  1. Uninstall the initial rustc installation (if installed)卸载初始rustc安装(如果已安装)
apt autoremove rustc
  1. Install rustup安装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)~/.cargo/bin添加到 $PATH (将其添加到您的.bashrc (或您的源文件)以使其永久化)
export PATH=~/.cargo/bin:$PATH
  1. Install the needed version of rust安装所需版本的rust
rustup default 1.7.0

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:事实证明,只要您更新其中一个依赖项,该项目将使用最新版本的 Rust(在撰写本文时为 1.57.0)进行编译:

  • Edit Cargo.toml and change the line slog="1.5.2" to slog="1.7.1" .编辑Cargo.toml并将 slog slog="1.5.2"行更改为 slog slog="1.7.1"
  • Update the Cargo.lock file by running cargo generate-lockfile .通过运行cargo generate-lockfile lockfile 更新Cargo.lock文件。
  • Re-run cargo build --release .重新运行cargo build --release

I got 21 warnings but it did at least compile.我收到了 21 个警告,但它至少可以编译。

This package won't compile on Windows as it requires a package that isn't available for Windows.此 package 无法在 Windows 上编译,因为它需要 package 不适用于 ZAEA23489CE3AAB4304


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.您似乎很清楚这一点,并且尝试构建此项目只是为了练习重现此漏洞,而不是实际使用它来提供文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM