Restic self-update fails in Debian 10

The packaged version on Debian seemed old, so I tried the self-update but it fails. I tried with sudo and as a regular user.

$ restic version
restic 0.9.4 compiled with go1.11.6 on linux/amd64

$ restic self-update
writing restic to /usr/bin/restic
find latest release of restic at GitHub
latest version is 0.11.0
download SHA256SUMS
download SHA256SUMS.asc
GPG signature verification succeeded
download restic_0.11.0_linux_amd64.bz2
Fatal: unable to update restic: context deadline exceeded

Any tips on how to make it work?

Can’t get it to work on my Kubuntu system either :confused:

Can you please download the latest beta from restic beta releases (/) and see if the same problem persist with that version?

1 Like

downloaded restic_v0.11.0-262-gaa0faa8c_linux_amd64 with wget
renamed to restic
chmod to root:root
chown to 0755
moved to /usr/bin

$ restic version
-bash: /usr/bin/restic: cannot execute binary file: Exec format error

Not sure if that is correct way to install a bin, but that’s what I got.

My system from: hostnamectl
Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 4.19.0-13-amd64
Architecture: x86-64

I think the download failed. What command did you run to download that file? If you run less /usr/bin/restic I think you’ll see some plain text instead of an actual binary.

I’d suggest using curl -OL https://beta.restic.net/restic-v0.11.0-262-gaa0faa8c/restic_v0.11.0-262-gaa0faa8c_linux_amd64 to download the file.

You should get something like the following when running file on it:

$ file restic_v0.11.0-262-gaa0faa8c_linux_amd64 
restic_v0.11.0-262-gaa0faa8c_linux_amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
  1. To download I used this:
    wget https://beta.restic.net/restic-v0.11.0-262-gaa0faa8c/restic_v0.11.0-262-gaa0faa8c_linux_arm64

  2. less /usr/bin/restic gives me lots of this
    ^?ELF^B^A^A^@^@^@^@^@^@^@^@^@^B^@<B7>^@^A^@^@^@0>^G^@^@^@^@^@@^@^@^@^@^@^@^@<C8>^A^@^@^@^@^@^@^@^@^@^@@^@8^@^G^@@

  3. Trying curl
    admin@host:~$ curl -OL https://beta.restic.net/restic-v0.11.0-262-gaa0faa8c/restic_v0.11.0-262-gaa0faa8c_linux_amd64 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 25.6M 100 25.6M 0 0 161k 0 0:02:42 0:02:42 --:--:-- 732k
    $ file restic_v0.11.0-262-gaa0faa8c_linux_amd64 restic_v0.11.0-262-gaa0faa8c_linux_amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=jnxgGkfblVTeq3W4nW3j/2nHtk0Mj3494dyQ_6G1r/-D94l5l6sTLeq0GL2zei/vyPnd54xRK4PymNaGoJq, not stripped

This was previous file I had that didn’t work:
$ file /usr/bin/restic /usr/bin/restic: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=f2-pps5F234whaLaL-w7/lmg9oij9fq4gYuB_SU68/Cfvu-7CaSBmsWyLATCE4/V3RrWOmwPC2RtkJxxjmt, not stripped
it is ARM for some reason? :confused: Oh man looking at the wget command I used, I downloaded arm64 instead of amd64. But still weird that self-update doesn’t work by itself.

Ok so moved to /usr/bin/
$ restic version restic 0.11.0-dev (compiled manually) compiled with go1.15.6 on linux/amd64

And now I tried it again with Kubuntu and it magically worked today. Odd because I tried it 3-5 times yesterday. So the moral of the story is to try many many times, maybe even wait a day and it’ll work :smiley:

$ sudo restic self-update [sudo] password for XXXXX: writing restic to /usr/bin/restic find latest release of restic at GitHub latest version is 0.11.0 download SHA256SUMS download SHA256SUMS.asc GPG signature verification succeeded download restic_0.11.0_linux_amd64.bz2 downloaded restic_0.11.0_linux_amd64.bz2 saved 19128320 bytes in /usr/bin/restic successfully updated restic to version 0.11.0

Sorry for taking us down this rabbit hole! Hope this helps some other newbies who are having trouble with self-update :smiley:

Yeah, seems you got the ARM version the first time.

Glad it works now, I can’t say why the old version didn’t work.

Hi Arkadi,

Did you remember to use sudo when you tried to update restock? When it’s in /usr/bin it needs sudo to update.

So you’d usually use:
sudo restic self-update

This could’ve been your problem in the beginning.

Glad you got it working in the end though!
jedi453

I’d instead remove the restic package and put the downloaded binary in /usr/local/bin. The directory /usr/bin should usually only be used by OS packages. /usr/local/* is where you put stuff you install manually, outside of packages.

2 Likes