I am using Octave 8.40, Portable version (the one which comes on a zip file), on Windows 10. I get the following error when trying to install a package (be it from the github or local packages):
>> pkg install arduino-0.12.1.tar.gz
error: unpack: unarchiving program exited with status: 2
tar: /C/PortableApps/PortableApps/octave-8.4.0-w64/arduino-0.12.1.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
error: called from
unpack at line 287 column 5
untar at line 48 column 5
install at line 99 column 9
pkg at line 619 column 9
Using the command pkg install -forge
also does not work.
(Edit) Here is a screenshot of the Octave GUI, so it is possible to see what is the current Octave path, and the package file there. (End of edit)
I tried to add some debugging to the "unpack.m" file. There, I can see the the command issued by Octave to try to uncompress the .tar.gz file:
>> pkg install arduino-0.12.1.tar.gz
Current path: C:\Users\Legion\AppData\Local\Temp\oct-VvVNU6
Command is: tar xf "/C/PortableApps/PortableApps/octave-8.4.0-w64/arduino-0.12.1.tar.gz" 2>&1
error: unpack: unarchiving program exited with status: 2
tar: /C/PortableApps/PortableApps/octave-8.4.0-w64/arduino-0.12.1.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
error: called from
unpack at line 290 column 5
untar at line 48 column 5
install at line 99 column 9
pkg at line 619 column 9
I tried substituting the /C/ by C:/ but then the following error shows up:
>> pkg install arduino-0.12.1.tar.gz
Current path: C:\Users\Legion\AppData\Local\Temp\oct-fCIzKT
Command is: tar xf "C:/PortableApps/PortableApps/octave-8.4.0-w64/arduino-0.12.1.tar.gz" 2>&1
error: unpack: unarchiving program exited with status: 128
tar: Cannot connect to C: resolve failed
error: called from
unpack at line 290 column 5
untar at line 48 column 5
install at line 99 column 9
pkg at line 619 column 9
Very interestingly though, if I copy the command tar xf "C:/PortableApps/PortableApps/octave-8.4.0-w64/arduino-0.12.1.tar.gz
and use it on the cmd, it works right away. I know, the tar on the cmd is not the same tar used by Octave (which is provided by Cygwin).
(Edit 2) Following @Nick J suggestion, I tried to set Octave's env folder to somewhere above the user folder, but still had no success.
>> setenv('tmpdir','C:\octave\temp')
>> pkg install arduino-0.12.1.tar.gz
Current path: C:\octave\temp\oct-rF0VdY
Command is: tar xf "/C/PortableApps/PortableApps/octave-8.4.0-w64/arduino-0.12.1.tar.gz" 2>&1
error: unpack: unarchiving program exited with status: 2
tar: /C/PortableApps/PortableApps/octave-8.4.0-w64/arduino-0.12.1.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
error: called from
unpack at line 290 column 5
untar at line 48 column 5
install at line 99 column 9
pkg at line 619 column 9
Even if I try using the pkg install from Github, it fails the same way:
>> setenv('tmpdir','C:\octave\temp')
>> pkg install "https://github.com/gnu-octave/octave-arduino/releases/download/release-0.12.1/arduino-0.12.1.tar.gz"
Current path: C:\octave\temp\oct-OnnVD1
Command is: tar xf "/C/octave/temp/oct-CxgHf3/arduino-0.12.1.tar.gz" 2>&1
error: unpack: unarchiving program exited with status: 2
tar: /C/octave/temp/oct-CxgHf3/arduino-0.12.1.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
error: called from
unpack at line 290 column 5
untar at line 48 column 5
install at line 99 column 9
pkg at line 619 column 9
(End of Edit 2)
In any case, any ideas?
There is a similar issue but there, the problem was a non-unicode character in the path, something that is not present here. And here, there is no conclusion, one of the suggestions is to install the package directly from the .tar.gz, which I tried, but did not succeed.
Any help is appreciated!
Short update, by using the new Octave 9.2.0 version, installing packages is possible even with the "non-installed" version under Windows.
Steps that I did to acheive this:
After download I ran the bat files cmdshell, fc_update and post-install too, maybe they set some path variable that was missing before. On the first launch I used the octave-launch-firsttime.exe and afterwards I am launching Octave directly from the octave-launch.exe. To successfully install the packages you need to launch it as administrator.