Skip to content

Instantly share code, notes, and snippets.

@kamkarthi
Last active November 26, 2024 23:02
Show Gist options
  • Save kamkarthi/7d71bf951d44c87321ca227e66796810 to your computer and use it in GitHub Desktop.
Save kamkarthi/7d71bf951d44c87321ca227e66796810 to your computer and use it in GitHub Desktop.
QNAP Qsync Client for Fedora Linux

QNAP Qsync Client for Fedora Linux

Hello folks, I managed to setup Qsync client under fedora linux 37, so I thought myself to share this simple guide. Basically downloaded Debian qsync utility provided from QNAP and then tweaked missing library paths and related filenames.

INSTALL:

Download and extract the debian package

mkdir QNAPCLIENT
cd QNAPCLIENT
curl -O https://download.qnap.com/Storage/Utility/QNAPQsyncClientUbuntux64-1.0.8.0623.deb
ar x QNAPQsyncClientUbuntux64-1.0.8.0623.deb

xz -d control.tar.xz
tar xvf control.tar 

xz -d data.tar.xz
tar xf data.tar 

To install execute below scripts.

sudo qsync-install.sh
qsync-postinstall.sh

NOTE: Please make sure you retain the dirlists.txt, filelists.txt inorder to cleanup later whenever needed, I suggest you to have backup of this folder as such intact :)

UNINSTALL:

To cleanup qsync pro from the system just execute below uninstall script, which will clean most things that have been setup before. The related QNAP utility files are copied under /usr/local/bin/QNAP, /usr/lib/nautilus, /usr/local/lib/QNAP, /usr/share/nautilus-qsync and the desktop files are located under ~/.config/autostart/QNAPQsyncClient.desktop ~/.local/share/applications/QNAPQsyncClient.desktop ~/Desktop/QNAPQsyncClient.desktop. So if you clean manually all these files that should be suffice enough, although i've covered the same in this below script

cd QNAPCLIENT
sudo qsync-uninstall.sh
#!/bin/bash
ID=$(id -u)
if [ $ID -ne 0 ]; then
echo -e "Script exiting due not privleged user......\n"
exit 1
fi
if [ -d /usr/local/bin/QNAP ]; then
echo "QSync pro seems to be already installed"
exit 0
fi
rm -f dirlists.txt filelists.txt
for i in `find usr -type d`; do if [ ! -d /$i ]; then echo $i >> dirlists.txt; fi; done
for i in `find usr -type f`; do if [ ! -f /$i ]; then echo $i >> filelists.txt; fi; done
while read -r line;
do
mkdir -p /$line
done < dirlists.txt
while read -r line;
do
cp ./$line /$line
done < filelists.txt
ln -s /usr/local/lib/QNAP/QsyncClient/libQUiLib.so.1.0.0 /usr/local/lib/QNAP/QsyncClient/libQUiLib.so.1
ln -s /usr/lib64/libjson-c.so.5 /usr/lib64/libjson-c.so.4
#!/bin/bash
DESKTOPDIR=$(xdg-user-dir DESKTOP)
NOTIFYREBOOT='Y'
ID=$(id -u)
GID=$(id -g)
install -o $ID -g $GID -m 755 -d ~/.config/autostart
if [ -e ~/.config/autostart/QNAPQsyncClient.desktop ]
then
rm ~/.config/autostart/QNAPQsyncClient.desktop || true
NOTIFYREBOOT='N'
fi
if [ -e ~/.config/autostart/QNAPQsyncClient.desktop.tmp ]
then
rm ~/.config/autostart/QNAPQsyncClient.desktop.tmp || true
NOTIFYREBOOT='N'
fi
install -o $ID -g $GID -m 755 ./usr/share/applications/QNAPQsyncClient.desktop ~/.config/autostart/QNAPQsyncClient.desktop
desktop-file-install --dir=~/.local/share/applications ./usr/share/applications/QNAPQsyncClient.desktop
install -o $ID -g $GID -m 755 ./usr/share/applications/QNAPQsyncClient.desktop $DESKTOPDIR/QNAPQsyncClient.desktop
if [ -e ~/.config/QNAP/Qsync.conf.tmp ]
then
mv ~/.config/QNAP/Qsync.conf.tmp ~/.config/QNAP/Qsync.conf
chmod u=rwx ~/.config/QNAP/Qsync.conf
fi
if [ -e ~/.local/share/QNAP/QsyncTmp ]
then
mv ~/.local/share/QNAP/QsyncTmp ~/.local/share/QNAP/Qsync
chmod u=rwx -R ~/.local/share/QNAP/Qsync
fi
if [ $NOTIFYREBOOT == 'Y' ]
then
echo You must restart your computer to complete the Qsync installation.
echo Before restarting, please save all open files and close all programs.
echo Do you want to restart now?
read -p "[Y/N] " reStartOS
if [ $reStartOS == 'Y' ] || [ $reStartOS == 'Yes' ] || [ $reStartOS == 'y' ] || [ $reStartOS == 'yes' ]
then
reboot -p
fi
fi
xz -d control.tar.xz#!/bin/bash
ID=$(id -u)
if [ $ID -ne 0 ]; then
echo -e "Script exiting due not privleged user......\n"
exit 1
fi
if [ ! -d /usr/local/bin/QNAP ]; then
echo "QSync pro doesn't seems to be installed"
exit 0
fi
rm -f /usr/local/lib/QNAP/QsyncClient/libQUiLib.so.1
rm -f /usr/lib64/libjson-c.so.4
while read -r line;
do
rm -f /$line
done < filelists.txt
while read -r line;
do
rm -fr /$line
done < dirlists.txt
rm -f dirlists.txt filelists.txt
rm -f ~/.config/autostart/QNAPQsyncClient.desktop ~/.local/share/applications/QNAPQsyncClient.desktop ~/Desktop/QNAPQsyncClient.desktop
@kamkarthi
Copy link
Author

sorry for replying late, actually I was not reading these emails these days
just had look it looks QNAP have changed their package compression methods to XZ recently thus no usr directory is not found
actually after the ar x you may require to execute uncompress xz and tar commands which I have updated in the instructions above and after that everything should work as expected

@fxpro32
Copy link

fxpro32 commented May 19, 2024

Hi Kamkarthi,

Thanks for your great work on this, works a treat, however I had to modify your code slightly to include the updated (latest) version of Qsync as well as some file structure adjustments and logging features.

Note that the 64bit version of QSYNC as of 20th May 2024 is version QNAPQsyncClientUbuntux64-1.0.11.0509.deb
So the instructions should be as follows:

mkdir QNAPCLIENT
cd QNAPCLIENT
curl -O https://download.qnap.com/Storage/Utility/QNAPQsyncClientUbuntux64-1.0.11.0509.deb
ar x QNAPQsyncClientUbuntux64-1.0.11.0509.deb

xz -d control.tar.xz
tar xvf control.tar

xz -d data.tar.xz
tar xf data.tar

And see below code for update to the qsync-postinstall.sh make it work on Fedora 39 / Nobara 39
Cheers !!!

@fxpro32
Copy link

fxpro32 commented May 19, 2024

#!/bin/bash

DESKTOPDIR=$(xdg-user-dir DESKTOP)
NOTIFYREBOOT='Y'

ID=$(id -u)
GID=$(id -g)

echo "Starting installation..."
echo "User ID: $ID, Group ID: $GID"
echo "Desktop Directory: $DESKTOPDIR"

install -o $ID -g $GID -m 755 -d ~/.config/autostart

if [ -e ~/.config/autostart/QNAPQsyncClient.desktop ]; then
    echo "Removing existing QNAPQsyncClient.desktop from autostart..."
    rm ~/.config/autostart/QNAPQsyncClient.desktop || true
    NOTIFYREBOOT='Y'
fi

if [ -e ~/.config/autostart/QNAPQsyncClient.desktop.tmp ]; then
    echo "Removing existing QNAPQsyncClient.desktop.tmp from autostart..."
    rm ~/.config/autostart/QNAPQsyncClient.desktop.tmp || true
    NOTIFYREBOOT='Y'
fi

install -o $ID -g $GID -m 755 ./usr/share/applications/QNAPQsyncClient.desktop ~/.config/autostart/QNAPQsyncClient.desktop
desktop-file-install --dir=~/.local/share/applications ./usr/share/applications/QNAPQsyncClient.desktop

# Create the Desktop directory if it doesn't exist
mkdir -p $DESKTOPDIR

install -o $ID -g $GID -m 755 ./usr/share/applications/QNAPQsyncClient.desktop $DESKTOPDIR/QNAPQsyncClient.desktop

if [ -e ~/.config/QNAP/Qsync.conf.tmp ]; then
    echo "Moving Qsync.conf.tmp to Qsync.conf..."
    mv ~/.config/QNAP/Qsync.conf.tmp ~/.config/QNAP/Qsync.conf
    chmod u=rwx ~/.config/QNAP/Qsync.conf
fi

if [ -e ~/.local/share/QNAP/QsyncTmp ]; then
    echo "Moving QsyncTmp to Qsync..."
    mv ~/.local/share/QNAP/QsyncTmp ~/.local/share/QNAP/Qsync
    chmod u=rwx -R ~/.local/share/QNAP/Qsync
fi

echo "NOTIFYREBOOT is set to: $NOTIFYREBOOT"

if [ "$NOTIFYREBOOT" == 'Y' ]; then
    echo "You must restart your computer to complete the Qsync installation."
    echo "Before restarting, please save all open files and close all programs."
    echo "Do you want to restart now?"
    read -p "[Y/N] " reStartOS

    if [[ "$reStartOS" == 'Y' || "$reStartOS" == 'Yes' || "$reStartOS" == 'y' || "$reStartOS" == 'yes' ]]; then
        reboot -p
    fi
fi

echo "Script finished."

@Lufthoheit
Copy link

Hi everybody, does this work with fedora 40, too?

@sz3lbi
Copy link

sz3lbi commented Sep 26, 2024

@Lufthoheit Yes, it works on Fedora 40.
You just have to use the qsync-postinstall.sh from this comment and other scripts from the original gist.

@Lufthoheit
Copy link

Doesn't work on my system. I can't open the application. A window shows up but it stays black.
Maybe because I switched from Debian to Fedora and kept /home.
Any idea how to remove the remaining parts of the old debian qsync installation? I already executed the uninstall script and searched for any file named qnap or qsync...

@sz3lbi
Copy link

sz3lbi commented Oct 4, 2024

@Lufthoheit I also switched from Debian (12) to Fedora (40). However, I created a new set of partitions, including /home, so I had a completely clean installation. So I cannot help you with this :(
For me, the application opens just fine. I had a connection wizard and everything, just like in Debian.

Maybe try running it in a VM? Then you will have a nice comparison between your case and a clean installation.

@fxpro32
Copy link

fxpro32 commented Oct 5, 2024

@Lufthoheit This works fine on my Nobara (Fedora Fork - Highly Recommended), I have it running everyday (Nobara is my daily driver), automatically starts and no significant issues. The only complaint that I have is that it doesn't like some long named files, but that can be easily fixed.
I would however like to advise that the above code didn't work straight out, I had to modify it, but it was easy because I put it through GPT4 and it resolved the issues. The working version is the one I posted previously on May 19th. My suggestion to you is to do the same, you will find it will work very well, if you follow all of the steps that GPT4o advises you. Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment