Skip to content

Instantly share code, notes, and snippets.

@nakamuraos
Last active October 14, 2025 00:26
Show Gist options
  • Save nakamuraos/717eb99b5e145ed11cd754ad3714b302 to your computer and use it in GitHub Desktop.
Save nakamuraos/717eb99b5e145ed11cd754ad3714b302 to your computer and use it in GitHub Desktop.
Reset trial Navicat 15, Navicat 16, Navicat 17 on Linux
#!/bin/bash
set -euo pipefail
# Author: NakamuraOS <https://github.com/nakamuraos>
# Latest update: 03/19/2025
# Tested with Navicat 15.x, 16.x, and 17.x on Debian and Ubuntu.
BGRED="\e[1;97;41m"
ENDCOLOR="\e[0m"
echo -e "${BGRED} ${ENDCOLOR}"
echo -e "${BGRED} ┌──────────────────────────────────────┐ ${ENDCOLOR}"
echo -e "${BGRED} │ !!! WARNING !!! │ ${ENDCOLOR}"
echo -e "${BGRED} ├──────────────────────────────────────┤ ${ENDCOLOR}"
echo -e "${BGRED} │ ALL DATA can be destroyed. │ ${ENDCOLOR}"
echo -e "${BGRED} │ Always BACKUP before continuing. │ ${ENDCOLOR}"
echo -e "${BGRED} └──────────────────────────────────────┘ ${ENDCOLOR}"
echo -e "${BGRED} ${ENDCOLOR}"
echo -e "Report issues:\n> https://gist.github.com/nakamuraos/717eb99b5e145ed11cd754ad3714b302\n"
echo -e "Reset trial \e[1mNavicat Premium\e[0m:"
if [[ ! "${1:-}" =~ ^--?[Yy]([eE][sS])?$ ]]; then
read -p "Are you sure? (y/N) " -r
echo
if [[ ! $REPLY =~ ^[Yy]([eE][sS])?$ ]]; then
echo "Aborted."
exit 0
fi
fi
echo "Starting reset..."
DATE=$(date '+%Y%m%d_%H%M%S')
# Backup
echo "=> Creating a backup..."
mkdir -p ~/.config/dconf/user-backup ~/.config/navicat/Premium/preferences-backup
cp ~/.config/dconf/user ~/.config/dconf/user-backup/user.$DATE
echo "The user dconf backup was created at $HOME/.config/dconf/user-backup/user.$DATE"
cp ~/.config/navicat/Premium/preferences.json ~/.config/navicat/Premium/preferences-backup/preferences.json.$DATE
echo "The Navicat preferences backup was created at $HOME/.config/navicat/Premium/preferences-backup/preferences.json.$DATE"
if ! command -v dconf &>/dev/null; then
echo "=> dconf is not installed. Installing..."
if command -v apt-get &>/dev/null; then
sudo apt-get update
sudo apt-get install -y dconf-cli
elif command -v dnf &>/dev/null; then
sudo dnf install -y dconf
elif command -v yum &>/dev/null; then
sudo yum install -y dconf
elif command -v pacman &>/dev/null; then
sudo pacman -Sy --noconfirm dconf
else
echo "Package manager not supported. Please install dconf manually."
exit 1
fi
fi
# Clear data in dconf
echo "=> Resetting..."
dconf reset -f /com/premiumsoft/navicat-premium/
echo "The user dconf data was reset"
# Remove data fields in config file
sed -i -E 's/,?"([A-F0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/Premium/preferences.json
echo "The Navicat preferences was reset"
# Done
echo "Done."
exit 0
@i-oc
Copy link

i-oc commented Sep 22, 2025

It works but it doesn't in 17.3.2. I am using Ubuntu 22.04.

@nakamuraos
Copy link
Author

It works but it doesn't in 17.3.2. I am using Ubuntu 22.04.

@i-oc Can you show me a screenshot after running this script?

@MIchale-GPT
Copy link

image (base) michale@michale-PC:~/tools$ ./reset-trial-navicat.sh

┌──────────────────────────────────────┐
│ !!! WARNING !!! │
├──────────────────────────────────────┤
│ ALL DATA can be destroyed. │
│ Always BACKUP before continuing. │
└──────────────────────────────────────┘

Report issues:

https://gist.github.com/nakamuraos/717eb99b5e145ed11cd754ad3714b302

Reset trial Navicat Premium:
Are you sure? (y/N) y

Starting reset...
=> Creating a backup...
The user dconf backup was created at /home/michale/.config/dconf/user.20250923_094844.bk
cp: 对 '/home/michale/.config/navicat/Premium/preferences.json' 调用 stat 失败: 没有那个文件或目录
The Navicat preferences backup was created at /home/michale/.config/navicat/Premium/preferences.json.20250923_094844.bk
=> Resetting...
./reset-trial-navicat.sh: 行 43: dconf: 未找到命令
The user dconf data was reset
sed:无法读取 /home/michale/.config/navicat/Premium/preferences.json:没有那个文件或目录
The Navicat preferences was reset
Done.

@nakamuraos
Copy link
Author

./reset-trial-navicat.sh: 行 43: dconf: 未找到命令

@MIchale-GPT It seems that dconf is not installed on your system. You can install it using the command:

sudo apt install dconf-cli

@i-oc
Copy link

i-oc commented Sep 23, 2025

It works but it doesn't in 17.3.2. I am using Ubuntu 22.04.

@i-oc Can you show me a screenshot after running this script?

image I try delete '~/.config/navicat/Premium/' but doesnt't. image I used the lite version before using it, could it be related to this?

@nakamuraos
Copy link
Author

It works but it doesn't in 17.3.2. I am using Ubuntu 22.04.

@i-oc Can you show me a screenshot after running this script?

image

@i-oc I've run this script on Navicat 17.3.2 and Ubuntu 22.04, and it still works. Did you completely exit Navicat before running this script? Can you check that the output of ps aux | grep navicat does not include any Navicat process?

@i-oc
Copy link

i-oc commented Sep 23, 2025

It works but it doesn't in 17.3.2. I am using Ubuntu 22.04.

@i-oc Can you show me a screenshot after running this script?

image

@i-oc I've run this script on Navicat 17.3.2 and Ubuntu 22.04, and it still works. Did you completely exit Navicat before running this script? Can you check that the output of ps aux | grep navicat does not include any Navicat process?

I checked,but doesn't.
image

@nakamuraos
Copy link
Author

I checked,but doesn't. image

I’m not sure why it isn’t working on your computer. How did you install and run Navicat?

@i-oc
Copy link

i-oc commented Sep 26, 2025

I’m not sure why it isn’t working on your computer. How did you install and run Navicat?
Sorry,I think I found the reason.Since the lite version has not been deleted and is in the same directory, you can reset it by deleting and reinstalling it.

@garrychrstn
Copy link

is there any way to "hide" the trial reminder?

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