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.
Execute the following command to download the latest azcopy v7 tarball.
wget -O azcopy\_v7.tar.gz https://aka.ms/downloadazcopylinux64
Now execute the following commands to create a new directory and extract the contents of the v7 tarball into that new directory.
tar -xf azcopy\_v7.tar.gz -C azcopy\_v7
Download azcopy v10
Next, execute the following command to download the latest azcopy v10 tarball.
wget -O azcopy\_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux
Now execute the following commands to create a new directory and extract the contents of the v10 tarball into that new directory.
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.
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.)
You should now have the following folder structure:
azcopy/\* (many 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:
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:
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:
After it runs, we can type
again (from any folder), and this time we should get reasonable output like:
azcopy version 10.1.2