How to use Zsync to transfer a file part in Linux

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 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 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

May be interested

  • Netcat user guideNetcat user guide
    netcat can be used as a special solution for transferring files over a local or internet network. it is also useful for transferring data to or from virtual machines or containers, when they do not include this feature.
  • Basic Linux commands everyone needs to knowBasic Linux commands everyone needs to know
    when using linux, you should also learn basic linux commands to make operations quicker and easier. here are some basic commands on linux you should know.
  • How to use MobiMover to transfer data on iPhone to PCHow to use MobiMover to transfer data on iPhone to PC
    to transfer data on iphone / ipad to devices of the same type or to a computer, mobimover software will help users to perform quickly.
  • 2 ways to transfer PPS file to PPT2 ways to transfer PPS file to PPT
    in the previous article, we helped you distinguish concepts of ppt, pps, pptx, ppsx and their functions. in this article, we will continue to share with you 2 ways to convert pps file (slideshow only) to ppt (editable). please consult.
  • Transfer from Linux Mail Server to Exchange Server 2007 (Part 3)Transfer from Linux Mail Server to Exchange Server 2007 (Part 3)
    through the previous two sections we have created users, this article will switch to the user information section. using the new-mailbox command cannot add the information we have in the csv file.
  • How to use Isof command on LinuxHow to use Isof command on Linux
    if everything in linux is a file, you'll have more than just the file on your hard drive. this article will show you how to use the lsof command to see all other devices and processes processed as a file.
  • The reason and how to edit sudoers file in LinuxThe reason and how to edit sudoers file in Linux
    in a linux or macos system, there is a file called 'sudoers' that controls the deepest levels of your system permissions. it allows or denies a user to gain superuser access and holds some special options for sudo.
  • How to mount a Linux file system using WSL2 on Windows 10How to mount a Linux file system using WSL2 on Windows 10
    starting with build 20211, windows subsystem for linux 2 (wsl2) includes a new feature that allows you to attach and mount physical drives to access the linux file system (such as ext4) which is not supported. support on windows 10.
  • How to convert DAT file into a Word documentHow to convert DAT file into a Word document
    you're stuck with the dat file, which should have been a word document and you don't know what to do with it. do not worry! let's find solutions through the following article.
  • How to quickly create new blank text files on Windows, Mac and LinuxHow to quickly create new blank text files on Windows, Mac and Linux
    text file is useful for everything. recording a note, storing information, and journaling are just a few of the many things you can do with text files. today, we will show you how to create new blank text files in windows, mac and linux quickly. in windows, it is easy to locate new text files. but on mac and linux, this job requires some initial setup, then creating a new text file is also quick and easy.