# Putting the binary in \`/bin\`

**URL:** https://forum.syncthing.net/t/putting-the-binary-in-bin/21404
**Category:** Support
**Created:** [January 7, 2024, 4:30am UTC](https://forum.syncthing.net/t/putting-the-binary-in-bin/21404 "2024-01-07T04:30:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![shetozz](https://forum.syncthing.net/user_avatar/forum.syncthing.net/shetozz/32/15631_2.png) [@shetozz](https://forum.syncthing.net/u/shetozz)
#### Post date: [January 7, 2024, 4:30am UTC](https://forum.syncthing.net/t/putting-the-binary-in-bin/21404/1 "2024-01-07T04:30:22Z")

</div>

I downloaded the latest release and just moved the binary into `/bin` to replace my previously installed binary that I got through `dnf` -I’m using Fedora-.

Is there anything else I should take into consideration for it to work well, or this will do the trick?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [January 7, 2024, 6:11pm UTC](https://forum.syncthing.net/t/putting-the-binary-in-bin/21404/2 "2024-01-07T18:11:56Z")

</div>

It might not be able to self update this way.

---

<div class="post-metadata">

### Author: ![gadget](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/g/dec6dc/32.png) [@gadget](https://forum.syncthing.net/u/gadget)
#### Post date: [January 7, 2024, 6:35pm UTC](https://forum.syncthing.net/t/putting-the-binary-in-bin/21404/3 "2024-01-07T18:35:05Z")

</div>

> [@shetozz](#):
>
> Is there anything else I should take into consideration for it to work well, or this will do the trick?

**`/bin`**

Ideally, stuff under `/bin` (technically `/usr/bin` because `/bin` is a symlink) should be left to the OS. Manually replacing a file installed by the package manager will cause conflicts when upgrading packages to newer releases – i.e. DNF still thinks that it was the one who installed Syncthing, so DNF will either downgrade your newer `/usr/bin/syncthing` or spit out an error the next time `dnf upgrade` is run.

It also means that Syncthing’s built-in auto-upgrade and the upgrade button in its web UI won’t work because `/usr/bin/syncthing` is normally owned by `root`, so you’ll need to manually replace `/usr/bin/syncthing` as needed. _(Fedora compiles Syncthing with auto-upgrade disabled.)_

If Syncthing must be available to multiple users, it’s better to put it under `/opt` (short for “optional”) in a `/opt/bin`, `/opt/syncthing`, or some other choice of subdirectory. `/opt/syncthing` is ideal because the directory and file ownership are easy to manage to allow Syncthing to auto-upgrade itself (if that’s of interest).

**`/usr/local/bin`**

Alternatively, `/usr/local/bin` is another option, but setting up auto-upgrade is more complicated because Syncthing can’t normally write anything else there so it won’t be able to create a temporary file during upgrades.

**`~/bin`**

If Syncthing is only going to be used by a single user, the best option is `~/bin`. By default the subdirectory doesn’t exist, but it’s part of the default search path. Since it’s owned by the user running Syncthing, the upgrade button in the web UI and auto-upgrades work as expected.

- Some users don’t like to see a `~/bin` subdirectory, so `~/.local/bin` is another option if having it hidden is preferred.
- It’ll avoid confusion later if the system package is uninstalled, but since `~/.local/bin` and `~/bin` are searched before `/usr/bin` there’s generally no conflict at a shell prompt.
- However, it’s not necessarily true for a desktop environment. For example, launching Syncthing from the “Activities” menu in GNOME loads `/usr/share/applications/syncthing-start.desktop`, which in turn runs `/usr/bin/syncthing`.

**systemd**

If using systemd to auto-start Syncthing, anything other than `/usr/bin/syncthing` requires updating the systemd unit file for Syncthing (e.g. `/usr/lib/systemd/user/syncthing.service`).

And if you remove the system package for Syncthing, you’ll have to create your own systemd unit file (e.g. `/usr/local/lib/systemd/user/syncthing.service`).

**SELinux**

As a service, Syncthing runs unconfined under SELinux on Fedora, so no potential issues there.

---

<div class="post-metadata">

### Author: ![239](https://forum.syncthing.net/user_avatar/forum.syncthing.net/239/32/14312_2.png) [@239](https://forum.syncthing.net/u/239)
#### Post date: [January 7, 2024, 10:30pm UTC](https://forum.syncthing.net/t/putting-the-binary-in-bin/21404/4 "2024-01-07T22:30:33Z")

</div>

> [@gadget](#):
>
> And if you remove the system package for Syncthing, you’ll have to create your own systemd unit file (e.g. `/usr/local/lib/systemd/user/syncthing.service`).

Or copy [it](https://github.com/syncthing/syncthing/blob/main/etc/linux-systemd/user/syncthing.service) to `~/.config/systemd/user/syncthing.service` and replace

```plaintext
ExecStart=/usr/bin/syncthing serve --no-browser --no-restart --logflags=0

```

with

```plaintext
ExecStart=%h/.local/bin/syncthing serve --no-browser --no-restart --logflags=0

```

or any other path in your home, without root access.

---

<div class="post-metadata">

### Author: ![shetozz](https://forum.syncthing.net/user_avatar/forum.syncthing.net/shetozz/32/15631_2.png) [@shetozz](https://forum.syncthing.net/u/shetozz)
#### Post date: [January 8, 2024, 1:42pm UTC](https://forum.syncthing.net/t/putting-the-binary-in-bin/21404/5 "2024-01-08T13:42:57Z")

</div>

Thanks guys for the useful tips, I totally missed the point of dnf getting confused, The only reason I did it this way, I didn’t want to modify the `.desktop` file, but that turned out to be lazy and dumb 😅

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [February 7, 2024, 1:43pm UTC](https://forum.syncthing.net/t/putting-the-binary-in-bin/21404/6 "2024-02-07T13:43:49Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
