How to update Rsync on Debian

posted in: Backend, rsync | 0

If you came across this article, you are probably going after updating rsync on two or more machines, as file transfer might not go through if there is a difference in rsync version.
Or else, you just want to update it to the latest version, to get all the new features.

I needed exact the same recently, so here is a short tutorial for you to follow up. Basically, if both machines use the same OS, you can just go and use that to update it:

//assume using sudo if you are not root

apt-get update

apt-get dist-upgrade

After using this commands you will have the latest version available for your OS. However, in my case I had one machine with Debian Stretch and another one with Debian Buster, so running this command resulted in different versions of rsync installed on machines.

To overcome this problem, you will need to manually get the latest rsync version from developers and build it from source code, here is how (I was installing 3.2.3 version, but you might want to change that to a different one).

//assume using sudo if you are not root for some commands


//get the archive with curl

curl -O

//unpack it into a folder with the same name

tar -xzvf rsync-3.2.3.tar.gz

//remove the archive

rm rsync-3.2.3.tar.gz

//get the build tools, if you don't have them yet

apt-get install build-essential

//install dependencies to be able to use fastest algorithms for rsync
apt-get install libssl-dev
apt-get install libxxhash-dev
apt-get install libzstd-dev
apt-get install liblz4-dev

//configure the source for building
//note that if you have errors later when building, you can disable some dependencies

//example with all dependencies:

./configure --prefix /usr/local

//example with zstd library disabled:

./configure --prefix /usr/local  --disable-zstd

//build from source code:
//if you see errors on this step and can't handle them, see the above instructions for disabling some dependecies.

make install

//rename the original rsync file coming with OS

mv /usr/bin/rsync /usr/bin/rsync.orig

//and replace it with your freshly built rsync

ln -s /usr/local/bin/rsync /usr/bin/rsync

Make sure to test it with some transfers. Besides, you can always return to the original rsync file, as it’s backed up.


Did this article help you? Or am I doing something wrong? Please post comments! 

Follow Sam Tyurenkov:
Hi there, I'm a web-designer, marketing and product manager, business developer. I have created this website and about 25 others. I'm also doing various tasks for IT projects besides websites - like mobile games.