Error install dutree - ubuntu 12.04

Dear, I need to install dutree on a Server with Ubuntu 12.04 the first part goes in the command: apt install cargo -y But when running the second command: cargo install dutree - The installation is interrupted with the following message: error: failed to compile dutree v0.2.18, intermediate artifacts can be found at /tmp/cargo-installK8My3o

Caused by: failed to parse lock file at: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/dutree-0.2.18/Cargo.lock

Caused by: invalid serialized PackageId for key package.dependencies

root@servidor:~# cargo install dutree
    Updating crates.io index
  Installing dutree v0.2.18
error: failed to compile `dutree v0.2.18`, intermediate artifacts can be found at `/tmp/cargo-installK8My3o`

Caused by:
  failed to parse lock file at: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/dutree-0.2.18/Cargo.lock

Caused by:
  invalid serialized PackageId for key `package.dependencies`

You likely have a very old version of Cargo (pre-1.38 released in 2019), the lockfile in dutree is using the new format from that version. If you download the package and delete the Cargo.lock then it will manage to resolve packages, but fail to compile because dependencies use features from a newer version of rustc. You will need to get a newer version of the toolchain.

1 Like

Debian/Ubuntu rust/cargo packages generally are not compatible with the crates.io ecosystem due to being chronically outdated. They also won't work with cross-compilation. Don't use the apt packages. Uninstall them, and then install proper Rust via rustup:

(this is the official site)

4 Likes

Even with rustup, Ubuntu 12.04 will only be compatible up to Rust 1.63, as we raised the system requirements in 1.64. In fact, rustup itself will have the same requirements, so you will need to download the standalone installer for 1.63 instead.

I managed to solve it following this tutorial thank you.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.