Help updating from 0.8.3 to latest stable version

Hi all - I am needing to upgrade my file server’s restic install from 0.8.3 to a more recent or latest stable version. I have already devoted time trying to work through this on my own. I came to understand that the auto-update feature was not included until a later release.

I’m working with an Ubuntu Server (Linux). Because I am both a n00b for the most part as a Linux server admin and running upgrades, are there any helpful links to be shared to point me in the right direction?

I’ve tried downloading a more recent version, extracting, etc. Every step of the way I hit roadblocks due to my own relative unfamiliarity with running a Linux server. All advice is appreciated.

1 Like

Download the binary for your architecture from the release page (presumably you have already done this) and extract it with the unzip command. As root, move the binary to /usr/local/bin/restic and make sure it’s owned by root (chown root:root /usr/local/bin/restic) and executable (chmod +x /usr/local/bin/restic).

1 Like

Thank you for the walkthrough. I have just completed those steps.

Currently when I enter “restic version” I still get the old one coming up, “restic 0.8.3” although when I FTP into the server I can see that all files are showing as last modified today. Is there some very simple step remaining that I have overlooked?

Whats the output if type

 which restic

In addition, the output of echo $PATH might be useful.

However, I suspect that everything is fine but that the bash shell instance you were typing in simply had the old location cached. hash -r will clear this cache and (hopefully) allow it to find the new binary.

@drewkett output of

 which restic

shows as /usr/bin/restic

@cdhowie output of

echo $PATH

Blockquote

shows as /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

I did run hash -r in my shell but am still showing restic 0.8.3

Thanks so far guys.

What about the output of

ls -l /usr/local/bin/restic

Drew - here is what I have:

ls -l /usr/local/bin/restic
total 220
-rw-r–r-- 1 root root 707 Nov 25 06:56 appveyor.yml
-rw-r–r-- 1 root root 16110 Nov 25 06:56 build.go
drwxr-xr-x 20 root root 4096 Nov 25 06:56 changelog
-rw-r–r-- 1 root root 82051 Nov 25 06:56 CHANGELOG.md
drwxr-xr-x 3 root root 4096 Nov 25 06:56 cmd
drwxr-xr-x 2 root root 4096 Nov 25 06:56 contrib
-rw-r–r-- 1 root root 8403 Nov 25 06:56 CONTRIBUTING.md
drwxr-xr-x 6 root root 4096 Nov 25 06:56 doc
-rw-r–r-- 1 root root 520 Nov 25 06:56 doc.go
drwxr-xr-x 2 root root 4096 Nov 25 06:56 docker
-rw-r–r-- 1 root root 2115 Nov 25 06:56 go.mod
-rw-r–r-- 1 root root 24287 Nov 25 06:56 go.sum
-rw-r–r-- 1 root root 1071 Nov 25 06:56 GOVERNANCE.md
drwxr-xr-x 4 root root 4096 Nov 25 06:56 helpers
drwxr-xr-x 27 root root 4096 Nov 25 06:56 internal
-rw-r–r-- 1 root root 1345 Nov 25 06:56 LICENSE
-rw-r–r-- 1 root root 164 Nov 25 06:56 Makefile
-rw-r–r-- 1 root root 6426 Nov 25 06:56 README.rst
-rw-r–r-- 1 root root 16130 Nov 25 06:56 run_integration_tests.go
drwxr-xr-x 9 root root 4096 Nov 25 06:56 vendor
-rw-r–r-- 1 root root 6 Nov 25 06:56 VERSION

You’ve most probably installed restic with your package manager. Can you try this?
sudo dpkg -l | grep restic
If this output includes restic, it means that you indeed used your package manager to install restic. You can use this command to uninstall it:
sudo apt-get remove restic

I think you have downloaded the restic source package, rather than a compiled binary.

Unless you have unusual needs, you should probably stick to the compiled binary. You should delete the /usr/local/bin/restic directory.

Assuming your ubuntu server is running on standard hardware, you need the Linux amd64 image. Download this binary:

https://github.com/restic/restic/releases/download/v0.9.6/restic_0.9.6_linux_amd64.bz2

Once you unzip it, you should get a single statically linked executable. You can then rename it to just restic, copy it to /usr/local/bin, mark it as executable and change the ownership to root, all as @cdhowie suggests above.

1 Like

Hey vellofrell,
Welcome to the forums!

This is likely because you have multiple versions installed to different places. Linux will look for them in a certain order, so it’s probably finding the v0.8.3 version first. If you run
/usr/local/bin/restic version
does it give you the new version? If so it’s there, but it’s just hidden behind the other version.

Here are some methods to fix this, I’d start with the top, and if that doesn’t work, go on to the next. Please copy and paste one line at a time, as with any time you use sudo, they are sensitive to being typed incorrectly, or being fed all at once.

First try (If you installed restic from Ubuntu’s store, repositories, apt or aptitude, etc) :

sudo apt remove restic
hash -r
restic version

After doing the steps cdhowie suggested, you could next try:
The next way I’d try is:

sudo cp /usr/local/bin/restic $(which restic)
hash -r
restic version

That will overwrite the 0.8.3 binary. Check if the version number is right this time.

If that doesn’t work, here’s a full method that only assumes you’re using a 64-bit Intel/AMD install (If not, please let us know and I can change it!):

sudo apt install curl
sudo mv `which restic`{,.bak}
sudo chmod a-x `which restic.bak`
wget https://github.com/restic/restic/releases/download/v0.9.6/restic_0.9.6_linux_amd64.bz2
bunzip2 restic_0.9.6_linux_amd64.bz2
sudo install restic_0.9.6_linux_amd64 -o root -g root -m 0755 /usr/local/bin/restic
hash -r
restic version

Ideally, any one of those would work. But I suggest trying them in the order they’re written.
Please let us know if you get it working!

Good luck!

  • jedi453

This and the post of you here

somehow make me believe you have cloned the repository to your server instead of downloading the provided binaries which do not include all the source code.
Make sure to check out the documentation here: Installation — restic 0.16.3 documentation

So instead of which restic I would use whereis restic. I just tried it and it printed all locations of restic when a file called restic was within $PATH.
image

output of

sudo dpkg -l | grep restic

is

ii restic 0.8.3+ds-1 amd64 backup program with multiple revisions, encryption and more/usr/local/bin/restic version

Running

/usr/local/bin/restic version

outputs to…

-bash: /usr/local/bin/restic: Is a directory

Output of

whereis restic

gives me…

restic: /usr/bin/restic /etc/restic /usr/local/bin/restic /usr/share/man/man1/restic.1.gz

If I understand this better now, I did clone instead of using proper binary. Will begin again with that proper binary link. It is indeed an Intel/AMD 64 bit machine.

Thanks again for the tips so far everyone.

My output for ‘restic version’ now shows as

restic 0.9.6 compiled with go1.13.4 on linux/amd64 (that’s good!)

However I have another n00b issue here, in that when I use a routine restic command like ‘restic snapshots’ I get this output -

bash: /usr/bin/restic: No such file or directory

…leading me to believe I just have restic placed in an improper folder or I have something misconfigured. Any suggestions?

I copied my contents of /usr/local/bin over to /usr/bin where my machine was apparently expecting them to be. Now I am back up and have access to my offsite restic backups through my terminal shell.

Would it be wise for me to reconfigure something on my server in order for this to work from /usr/local/bin as opposed to /usr/bin?

Hey vellofrell,

Glad you got the basic binary working!
Just be careful, /usr/local/bin and /usr/bin are generally important to keep separate! /usr/local/bin is for user installed programs that are not meant to be managed by your package manager, whereas /usr/bin is only supposed to be used by your package manager. Unfortunately, some programs in /usr/bin that don’t belong there will cause your package manager to fail if it tries to overwrite them. This can lead to a large headache later down the road.

The possible reasons I can think of that it expected /usr/bin/restic:

  • You’re using a script, or a cron-job or something that calls restic using the full path /usr/bin/restic
    • You can use sudo crontab -l to see your crontab (Cron is a program manages programs or “jobs” that are meant to be ran automatically on a fixed schedule).
    • Do you know of any scripts that you use to run restic? It could be either automatically or manually. These scripts may contain passwords, so if you post them, for your own sake, PLEASE OMIT THE PASSWORDS! You shouldn’t need to post them either way, but look within the file for the exact string, /usr/bin/restic and if you find it, replace it with /usr/local/bin/restic
  • The shell’s index hasn’t updated. Try running hash -r before running restic.

I hope this helps,
Good luck!

  • jedi453

Hi Jedi - yes I do keep a basic script installed to trigger once-nightly auto backups. I will look into the details you mention later this evening Thanks again.

No, your system is configured to use /usr/local/bin already. The problem was mentioned earlier but appears that it was overlooked:

Please look at the rest of that quoted post. Make sure you are downloading a binary archive and not the source archive, then try again.

@cdhowie Yep, gonna be looking into this.

Something new has arisen I am curious about. Running a normal restic backup now just to test this out. It doesn’t appear to be referring to the most recent prior restic snapshot taken with 0.8.3. Rather, I believe it is starting from scratch. The backup is taking too long considering there is no difference between that most recent snapshot from 0.8.3. Also my storage drive platters are making a lot of noise. Any suggestions?

@vellofrell I don’t want to sound rude, but perhaps instead of asking about the direct solutions, you should take the opportunity to read up on the things that are causing your problems? For example, the PATH environment variable and the which command that’s been mentioned in this thread are key to understanding which of your restic binaries is the one that will be executed when you enter restic on the command line.

If you don’t fully understand those, you don’t know how to control your binaries, and this is something that you as the system administrator really really should know. So perhaps read up on those two things? Once you do that you should be able to get the right version of restic running.

Also, perhaps you should remove that old restic binary you seem to have lying around.

You can check the version of restic that is being run using restic version on the command line.

2 Likes