Installing AzCopy v10 on Linux

Installing AzCopy v10 on Linux

There are several versions of the Azure command-line utility, azcopy. The latest (as of this writing) is v10.

If you’re on Linux, getting azcopy v10 installed and adding it to your system’s command-line completion is undocumented (for now) in the above link. Fortunately, we can adapt the Linux installation for the older azcopy v7 to get azcopy v10 installed and added to the system command-line completion. Here’s how.

(Note that v7 uninstallation is also undocumented at this point. If you have an existing installation of azcopy 7, consider uninstalling it before installing v10. Refer to this github issue for details. This will also remove your v7 azcopy from command-line completion.)

Download azcopy v7

Wait – aren’t we installing v10? Yes! However, we’ll adapt files delivered with v7, which are not delivered with v10 and for which no alternate procedure is documented. Don’t worry about dependencies or other installs, we don’t need them for this.

Reference

Execute the following command to download the latest azcopy v7 tarball.

wget -O azcopy\_v7.tar.gz https://aka.ms/downloadazcopylinux64

Extract v7

Now execute the following commands to create a new directory and extract the contents of the v7 tarball into that new directory.

mkdir azcopy\_v7
tar -xf azcopy\_v7.tar.gz -C azcopy\_v7

Download azcopy v10

Reference

Next, execute the following command to download the latest azcopy v10 tarball.

wget -O azcopy\_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux

Extract v10

Now execute the following commands to create a new directory and extract the contents of the v10 tarball into that new directory.

mkdir azcopy\_v10
tar -xf azcopy\_v10.tar.gz -C azcopy\_v10

Prep the v10 folder

In order to use the v7 install script unchanged, we need to prepare the v10 folder where we just extracted the v10 tarball. (You don’t need to do this step if you’re comfortable editing the install.sh script used below and adjusting folder/file paths instead.)

We list the contents of the v10 folder to which we extracted the v10 tarball, and see a folder that references the specific version of azcopy v10 and contains the executable.

ls azcopy\_v10

We will see a subfolder named similarly to azcopy\_linux\_amd64\_10.1.2 (the specific version may change after this writing).

We’ll rename this subfolder to just azcopy so that the v7 install script works without changes, using this command.

mv azcopy\_v10/azcopy\_linux\_amd64\_10.1.2 azcopy\_v10/azcopy

(Adjust this command to your specific subfolder name, if needed.)

Checkpoint

You should now have the following folder structure:

azcopy\_v7/
azcopy/\*  (many files)
install.sh
azcopy\_v10/
azcopy/\*
(few files)

Copy needed v7 files to v10

Let’s copy the files we need from v7 to v10 using the following commands. We need three files: install.sh, azcopy_autocomplete, and startup.

cp azcopy\_v7/install.sh azcopy\_v10/install.sh
cp azcopy\_v7/azcopy/azcopy\_autocomplete azcopy\_v10/azcopy/
cp azcopy\_v7/azcopy/startup azcopy\_v10/azcopy/

We can verify that the files copied successfully.

ls -lR azcopy\_v10

This should show a folder structure like this:

azcopy\_v10/
azcopy/
install.sh
azcopy\_v10/azcopy/
azcopy
azcopy\_autocomplete
startup

Install

To recap, azcopy v10 by itself needs no installation. The install script from azcopy v7, though, is still useful in order to make azcopy resolve at the command line from any folder on the system.

Currently – if you do not have azcopy installed already or did not uninstall a previous install – you can type azcopy --version and get an error like -bash: /usr/bin/azcopy: No such file or directory. This is not convenient, since we would like to be able to invoke azcopy from any directory.

The v7 install script and the other files we copied in the previous step will add azcopy to command completion system-wide.

We’ll use the install script as follows:

sudo ./azcopy\_v10/install.sh

After it runs, we can type

azcopy --version

again (from any folder), and this time we should get reasonable output like:

azcopy version 10.1.2

Conclusion

Congratulations – your Linux system is now running azcopy v10 with command line completion. Head to the AzCopy v10 Docs to get started.