• Stars
    star
    935
  • Rank 48,878 (Top 1.0 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A cargo subcommand for checking and applying updates to installed executables

cargo-update TravisCI build status AppVeyorCI build status Licence Crates.io version

A cargo subcommand for checking and applying updates to installed executables

Documentation

Manpage

Installation

Firstly, ensure you have CMake and the Required Libraries™.

Then proceed as usual:

cargo install cargo-update

If that doesn't work:

If it still doesn't work, slam open an issue or comment on one of the existing relevant ones.

Dependencies

Dependency Debian package Fedora package MSYS2 package
libgit2 libgit2-dev libgit2-devel mingw-w64-x86_64-libgit2
libcurl libcurl4-*-dev libcurl-devel libcurl-devel
libssh2 libssh-dev libssh2-devel mingw-w64-x86_64-libssh2
openssl libssl-dev openssl-devel mingw-w64-x86_64-openssl
pkg-config (some platforms) pkg-config pkg-config mingw-w64-x86_64-pkg-config

Usage

cargo install-update -a - check for newer versions and update all installed packages.

cargo install-update crate1 crate2 ... - check for newer versions and update selected packages, will not install new packages.

For more information and examples see the manpage.

Self-update

cargo-update will update itself seamlessly on Linux and Windows.

On Windows the following strategy is applied:

  • Check for old versions, remove them
  • Add the current version to the current executable's extension
  • Create an empty file in place of the just-renamed file (this way cargo install will "replace" it and not duplicate the entry in .crates.toml)

Troubleshooting

Some crates, like clippy and rustfmt, have moved from Crates.io to being a rustup component. If you'd installed them beforehand, then added them via rustup component, they might not have been removed from the list of crates installed via cargo install, and you might come across errors such as

$ cargo install-update -a
Updating registry 'https://github.com/rust-lang/crates.io-index'

Package          Installed  Latest    Needs update
clippy           v0.0.179   v0.0.302  Yes
.....

Updating clippy
    Updating crates.io index
  Installing clippy v0.0.302
   Compiling clippy v0.0.302
error: failed to compile `clippy v0.0.302`, intermediate artifacts can be found at `/tmp/cargo-installxHfj2y`

Caused by:
  failed to run custom build command for `clippy v0.0.302`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installxHfj2y/release/build/clippy-ffeedc2f188020a4/build-script-build` (exit code: 1)
--- stderr

error: Clippy is no longer available via crates.io

help: please run `rustup component add clippy-preview` instead

In that case, run cargo install --list to verify that they're still there and cargo uninstall them, which will deregister the cargo versions and leave you with the rustup ones.

Bleeding-edge cargos

Since 0.42.0, cargo install cratename checks for newer versions and installs them if they exist, instead of erroring out like it does usually.

Source Replacement vs custom registries

Cargo allows replacing entire registries at a time.

For example, this stanza in ~/.cargo/config will replace the default crates.io registry with the Shanghai Jiao Tong Universty's mirror:

[source.crates-io]
replace-with = "sjtu"

[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"

cargo-update resolves this to the deepest registry, and passes --registry sjtu to cargo install. This worked until roughly nightly-2019-08-10, but since nightly-2019-09-10 due to a Cargo regression (or feature, but it's breaking without a major version bump, so) --registry looks into a different key, requiring this additional stanza to ensure correct updates:

[registries.sjtu]
index = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"

Confer the initial implementation, rewrite, final broken testcase and final debug implementation threads (h/t @DCJanus for help debugging and testcases, also dealing with me as I slowly spiraled into insanity).

Special thanks

To all who support further development on Patreon, in particular:

  • ThePhD
  • Embark Studios
  • Lars Strojny
  • EvModder

More Repositories

1

termimage

Display images in your terminal, kind of
Rust
182
star
2

rust-embed-resource

A Cargo build script library to handle compilation and inclusion of Windows resources, in the most resilient fashion imaginable
Rust
143
star
3

safe-transmute-rs

A safe-guarded transmute for Rust
Rust
38
star
4

checksums

Tool for making/verifying checksums of directory trees
Rust
36
star
5

BearLibTerminal.rs

BearLibTerminal FFI for Rust
Rust
31
star
6

openalias.rs

Look up and parse OpenAlias data
Rust
20
star
7

tweetr

tweetr is a platform that allows you to create and queue tweets to be shared when YOU want. You create content when you have time and then use FOSS and NOT pay whatever-ridiculous amount of $$$ for posting them automatically.
Rust
18
star
8

wustc

Exampwe of ewwonyenyonyuns code:
Rust
16
star
9

flac-bound

FLAC encoding via libflac FFI
Rust
9
star
10

pb-cpp

Console progress bar for C++
C++
9
star
11

poke-a-mango

What all the kool kidz are playing these days
Rust
7
star
12

hrx.rs

A Rust implementation of the HRX plain text archive format
Rust
6
star
13

whereami-cpp

Locate the current executable and the current module on the file system, in C++
C++
6
star
14

codepage-437

cp437 transcoding for Rust
Rust
5
star
15

registry.pol-rs

Parser for the Windows Registry Policy File format
Rust
5
star
16

gen-epub-book.rs

Generate an ePub book from a simple plaintext descriptor, in Rust
Rust
5
star
17

tackup

Continuously back up your browser tabs
JavaScript
4
star
18

gen-epub-book.cpp

Generate an ePub book from a simple plaintext descriptor, in C++
Shell
4
star
19

blake-rs

Implementation of the BLAKE hash function via FFI for Rust
C
4
star
20

BarbersAndRebarbs

A game in C++ using SFML 2.4
C++
4
star
21

gen-epub-book.js

Generate an ePub book from a simple plaintext descriptor, in JavaScript
JavaScript
3
star
22

gen-epub-book

Generate an ePub book from a simple plaintext descriptor
Awk
3
star
23

rfsapi-rs

Raw Filesystem API for Rust -- enable simpler browsing with ease
Rust
3
star
24

ASMifier

Minecraft mod for DOS 16bit real-mode Assembly programming with (not yet) full FAT16 filesystem emulation.
Scala
3
star
25

goodolddownloads-deobf

Deobfuscate https://goggames.goodolddownloads.com/ links
JavaScript
2
star
26

BearLibTerminal-sys.rs

BearLibTerminal pure FFI
Rust
2
star
27

Cwepper

A minesweeper implementation in C++, hence the name
C++
2
star
28

big-voronoi

Consider: voronoi diagram, but in 3D and in parallel.
C++
2
star
29

dumplingh

Issue/PR exporter for GitHub
Rust
2
star
30

topfig

Assorted config/tooling/lube from the nabtop
Python
2
star
31

babfig

Assorted config/tooling/lube from the babtop
NWScript
2
star
32

progressbar-cpp

C++ wrapper for an easy-to-use C library for displaying text progress bars.
C++
2
star
33

http.deb

Host These Things Please - a basic http server for hosting a folder fast and simply – Debian package
Rust
2
star
34

bidir-map-rs

Bidirectional maps for Rust
Rust
2
star
35

totalcmd-zstd

Total Commander packer plugin for zstd support
C++
2
star
36

nabijaczleweli.github.io

A repo for http://nabijaczleweli.github.io
HTML
2
star
37

PsyduckSublime

Sublime text 3 plugin to add Psyduck
Python
1
star
38

pls-rs

Rust crate for parsing and writing the PLS playlist format
Rust
1
star
39

dotfiles

.
Vim Script
1
star
40

systemd-zram-generator.deb

Systemd unit generator for zram devices – Debian package
Rust
1
star
41

penerator

Generate a secure password over your local network (yes it's a toy, probably don't use it for prod or anything)
C
1
star
42

whereami-rs

whereami for Rust
Rust
1
star
43

Cpp-NBT

Implementation of NBT file format in C++
C++
1
star
44

SublimeLinter-contrib-aspell

Check your spelling with aspell from within Sublime
Python
1
star
45

termimage.deb

Display images in your terminal, kind of – Debian package
Rust
1
star
46

adventure

A strange game.
C++
1
star
47

Cpp-CGOL

Conway's Game of Life, uses the Armadillo linear algebra library.
C++
1
star
48

cimpoler-meta

Header-only C++ compiler metadata extractor
C++
1
star
49

vswhom-sys.rs

Pure FFI to Jon Blow's VS discovery script
C++
1
star
50

dishub

Rust app for posting GitHub activity on Discord.
Rust
1
star
51

libgit2pp

libgit2++ is not yet a solid C++14 wrapper around libgit2 (https://libgit2.github.com)
C++
1
star
52

feembox

What if a feed, but it's a mailbox?
Rust
1
star
53

mcp-mapping-transposer

Translate between two MCP mappings
Rust
1
star
54

BearLibTerminal

Autoimported from https://bitbucket.org/cfyzium/bearlibterminal/
C
1
star
55

gen-epub-book.scala

Generate an ePub book from a simple plaintext descriptor, in Scala
Scala
1
star
56

machine-usable-words

Sets of English words, sorted and segregated for machine consumption
Rust
1
star
57

path.nabijaczleweli.xyz

A page Nat can link to that explains, for every operating system, how to add a folder to your PATH
HTML
1
star
58

voltaire

Pulse a coil to get a bigger voltage, a.k.a. a template embedded project
Makefile
1
star
59

mandalas-rs

A mandala generator using Tonči Juričev-Grgin's method in Rust with a scalable driver
Rust
1
star