How to use Zsync to transfer a file part in Linux

Zsync is based on rsync, another popular Linux tool to synchronize files or directories, and it's very easy to use. Most Linux distributions already have zsync available in the package repository, so it's easy to install and get started.

Downloading large files like ISO images can be an uncomfortable task. Depending on the Internet connection, sometimes these files can take a lot of time to download and consume tons of hard drive space. Then, if an updated version is needed, the user needs to redo the entire process.

There is a solution to this problem. Zsync is a file synchronization tool for Linux, allowing users to update only the parts of the file that have been changed without downloading everything from scratch.

Zsync is based on rsync, another popular Linux tool to synchronize files or directories, and it's very easy to use. Most Linux distributions already have zsync available in the package repository, so it's easy to install and get started.

Use Zsync to download a part of the file in Linux

  1. Install Zsync
    1. Ubuntu / Debian
    2. Fedora
    3. Arch Linux
    4. OpenSUSE
    5. Solus
  2. Download a file
  3. Update a file

Install Zsync

Before starting, users will need to install zsync. It is a small command line utility, so there are not too many dependencies.

Ubuntu / Debian

Both Debian and Ubuntu have the zsync package available and both have new versions of zsync. Please install zsync with Apt.

 sudo apt install zsync 

Fedora

Fedora does not have zsync available. Fedora's limited repository sometimes interferes with users, but you can still install and use zsync from the source page.

First, make sure you have the necessary development tools from Fedora.

 sudo dnf group install 'Development Tools' 

Select the current source tarball from the zsync download page (link: http://zsync.moria.org.uk/downloads). Unzip it into the directory you want to build zsync. Then open a terminal and change it to that folder.

 cd ~/Downloads/zsync-0.6.2 

From there, configure, compile and install zsync.

 ./configure make -j4 sudo make install 

Arch Linux

Arch includes zsync in its default repository. Please install with Pacman.

 sudo pacman -S zsync 

OpenSUSE

Users can find the latest zsync version for all OpenSUSE versions. Please install it with the favorite package utility.

 sudo zypper in zsync 

Solus

Solus also has zsync in the default repository. Please install it with the command:

 sudo eopkg it zsync 

Download a file

Zsync is a simple command line utility. Pass the URL of the zsync file to the file you want to download and it will have the right to operate. Start by downloading a file. MX Linux is a popular new distribution based on Debian Stable. MX Linux uses zsync for ISO images. Try using zsync to download MX Linux. If you don't really want a file that is too large, you can press Ctrl + C to cancel the process at any time.

 zsync http://linuxfreedom.com/mxlinux/MX/Snapshots/MX-18_January_x64.iso.zsync 

How to use Zsync to transfer a file part in Linux Picture 1How to use Zsync to transfer a file part in Linux Picture 1

Note that zsync starts by checking the existing file to update. If no existing file is found, it will download the entire file.

Users also have the option to download the .zsync file directly to their computer and use it to download the target. Use the -i flag to specify the path to the file.

 zsync -i ~/Downloads/MX-18_January_x64.iso.zsync 

The results are exactly the same.

Users can use the -o flag to make the name of the output file change. Sometimes it helps shorten the file name to make it easier.

 zsync http://linuxfreedom.com/mxlinux/MX/Snapshots/MX-18_January_x64.iso.zsync -o MX-18.iso 

Again, the user receives the same file, only with a different name.

Update a file

Ubuntu also uses Zsync files for its ISOs. Users can only find them through Ubuntu's CD image server (link: http://cdimage.ubuntu.com/). This process is exactly the same as downloading a new file. Zsync will still start by searching for an existing file in the current directory. Only when the file is found, does it compare the differences between them and only download the updated sections. The image below shows what happens when zsync finds an existing Kubfox ISO.

How to use Zsync to transfer a file part in Linux Picture 2How to use Zsync to transfer a file part in Linux Picture 2

Zsync is a great way to keep downloads minimal. The only downside of zsync is that it is not widely used. However, this tool is still worth testing, especially if you have to regularly download large files.

Hope you are succesful.

4 ★ | 3 Vote