Skip to content

Instantly share code, notes, and snippets.

@WinkelCode
Last active March 27, 2025 03:31
Show Gist options
  • Save WinkelCode/dffeb181a4c7903cbc463169324f61b8 to your computer and use it in GitHub Desktop.
Save WinkelCode/dffeb181a4c7903cbc463169324f61b8 to your computer and use it in GitHub Desktop.
Work in progress
#!/usr/bin/env bash
set -e # Exit on error
if [ "$EUID" -ne 0 ]; then
echo "To ensure correct permissions, this script must be run as root."
exit 1
fi
install_location="/var/lib/safing-portmaster" # Must not include trailing slash
echo "-> Creating Portmaster program directory at '${install_location}'"
mkdir -p "${install_location}"
echo "-> Creating Portmaster exports directory at '${install_location}/exports'"
mkdir -p "${install_location}/exports/share/applications"
mkdir -p "${install_location}/exports/share/icons"
mkdir -p "${install_location}/exports/units"
temp_dir=$(mktemp -d)
echo "-> Downloading 'portmaster-start'"
wget -q --show-progress -O "$temp_dir/portmaster-start" https://updates.safing.io/latest/linux_amd64/start/portmaster-start
echo "-> Downloading 'portmaster.service'"
wget -q --show-progress -O "$temp_dir/portmaster.service" https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster.service
echo "-> Downloading 'portmaster.desktop'"
wget -q --show-progress -O "$temp_dir/portmaster.desktop" https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster.desktop
echo "-> Downloading 'portmaster_notifier.desktop'"
wget -q --show-progress -O "$temp_dir/portmaster_notifier.desktop" https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster_notifier.desktop
echo "-> Downloading 'portmaster_logo.png'"
wget -q --show-progress -O "$temp_dir/portmaster_logo.png" https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster_logo.png
echo "-> Patching paths in 'portmaster.service'"
sed -i "s|/opt/safing/portmaster|${install_location}|g" "$temp_dir/portmaster.service"
echo "-> Patching paths in 'portmaster.desktop'"
sed -i "s|/opt/safing/portmaster|${install_location}|g" "$temp_dir/portmaster.desktop"
echo "-> Patching paths in 'portmaster_notifier.desktop'"
sed -i "s|/opt/safing/portmaster|${install_location}|g" "$temp_dir/portmaster_notifier.desktop"
echo "-> Installing 'portmaster-start' and setting security context"
install -m 0755 "$temp_dir/portmaster-start" "${install_location}/portmaster-start"
chcon -t bin_t "${install_location}/portmaster-start"
echo "-> Installing 'portmaster.service'"
install -m 0644 "$temp_dir/portmaster.service" "${install_location}/exports/units/portmaster.service"
echo "-> Installing 'portmaster.desktop'"
install -m 0644 "$temp_dir/portmaster.desktop" "${install_location}/exports/share/applications/portmaster.desktop"
echo "-> Installing 'portmaster_notifier.desktop'"
install -m 0644 "$temp_dir/portmaster_notifier.desktop" "${install_location}/exports/share/applications/portmaster_notifier.desktop"
echo "-> Installing 'portmaster_logo.png' (as 'portmaster.png')"
install -m 0644 "$temp_dir/portmaster_logo.png" "${install_location}/exports/share/icons/portmaster.png"
echo "-> Running 'portmaster-start update' to download Portmaster data"
"${install_location}/portmaster-start" update --data="${install_location}"
echo "-> (Workaround) Moving 'portmaster.service' to '/etc/systemd/system' and reverse-symlinking it since systemd wants units on the same filesystem"
mv "${install_location}/exports/units/portmaster.service" /etc/systemd/system/portmaster.service
ln -s /etc/systemd/system/portmaster.service "${install_location}/exports/units/portmaster.service"
echo "-> Enabling 'portmaster' service"
systemctl daemon-reload
systemctl enable "portmaster.service"
echo "-> Creating 'portmaster_notifier' autostart"
ln -s "${install_location}/exports/share/applications/portmaster_notifier.desktop" /etc/xdg/autostart/portmaster_notifier.desktop
echo "-> Adding '$install_location' to \$XDG_DATA_DIRS to show desktop entries (applies after next login)"
echo "XDG_DATA_DIRS=$install_location/exports/share:\$XDG_DATA_DIRS" >/etc/profile.d/zzz-portmaster-to-xdg-data-dirs.sh # We prepend 'zzz' since profile.d scripts aren't numbered on Fedora, and we want to run after any other scripts that modify XDG_DATA_DIRS.
echo "-> Removing '${temp_dir}'"
rm -rf "$temp_dir"
echo "-> Done, Portmaster and its tray/notifier application will start with the next boot."
@S7venLights
Copy link

Heya are you experiencing issues with the core service not starting at boot anymore? It started presenting today after an update last night . But when I tried rollback, it still didn't launch at boot.
When I startup, the portmaster gui is active in the system tray but red. opening in the GUI and clicking start core service prompts for root password and said something about policy kit.
But entering the password results in no change.
I then ran in CLI: sudo /var/lib/safing-portmaster/portmaster-start core
and Pmaster came online again. But currently I have to run that command after boot every time. I'm on Kinoite if you remember...

@S7venLights
Copy link

output of: systemctl status portmaster

portmaster.service - Portmaster by Safing
Loaded: loaded (/etc/systemd/system/portmaster.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: active (running) since Tue 2023-05-02 10:49:16 CEST; 39min ago
Docs: https://safing.io
https://docs.safing.io
Main PID: 14281 (portmaster-star)
Tasks: 0 (limit: 19018)
Memory: 4.0K
CPU: 45ms
CGroup: /system.slice/portmaster.service
‣ 14281 /var/lib/safing-portmaster/portmaster-start core

May 02 10:49:16 fedora systemd[1]: Started portmaster.service - Portmaster by Safing.
May 02 10:49:16 fedora (er-start)[14410]: portmaster.service: Failed to locate executable /var/lib/safing-portmaster/portmaster-start: Permission denied
May 02 10:49:16 fedora (er-start)[14410]: portmaster.service: Failed at step EXEC spawning /var/lib/safing-portmaster/portmaster-start: Permission denied
May 02 10:49:16 fedora systemd[1]: portmaster.service: Supervising process 14281 which is not our child. We'll most likely not notice when it exits.

@S7venLights
Copy link

Hi @WinkelCode I am still having this issue, I was about to try re-install using your script but not sure how I should go about that, as portmaster is already running and I probably shouldn't install it while it's running.
What should I do?

@WinkelCode
Copy link
Author

WinkelCode commented Jun 3, 2023

I think you should be able to close out of the Portmaster GUI, could be right click on the icon. Alternatively, delete /etc/xdg/autostart/portmaster_notifier.desktop, then restart (log out could also suffice).

Given the error message "permission denied", this might work: chcon -t bin_t "${install_location}/portmaster-start" (install_location="/var/lib/safing-portmaster")

@S7venLights
Copy link

S7venLights commented Jul 22, 2023

So I finally got to this, I made a backup of /var/lib/safing-portmaster and ran your script again, the script failed at the point of copying assets over, but that was actually helpful as it had already reset the systemd service and didn't overwrite my profile settings. After restart, it seems portmaster is launching properly again :) Thanks

[@fedora ~]$ sudo /var/home/user/Applications/install_portmaster_to_var.sh
[sudo] password for user: 
-> Creating Portmaster program directory at '/var/lib/safing-portmaster'
-> Creating Portmaster exports directory at '/var/lib/safing-portmaster/exports'
-> Downloading 'portmaster-start'
[@fedora ~]$ sudo /var/home/D24/Applications/install_portmaster_to_var.sh
-> Creating Portmaster program directory at '/var/lib/safing-portmaster'
-> Creating Portmaster exports directory at '/var/lib/safing-portmaster/exports'
-> Downloading 'portmaster-start'
/tmp/tmp.pXwudeK4P4/portmaster- 100%[====================================================>]  23.16M  5.06MB/s    in 5.4s    
-> Downloading 'portmaster.service'
/tmp/tmp.pXwudeK4P4/portmaster. 100%[====================================================>]   1.58K  --.-KB/s    in 0.001s  
-> Downloading 'portmaster.desktop'
/tmp/tmp.pXwudeK4P4/portmaster. 100%[====================================================>]     210  --.-KB/s    in 0s      
-> Downloading 'portmaster_notifier.desktop'
/tmp/tmp.pXwudeK4P4/portmaster_ 100%[====================================================>]     248  --.-KB/s    in 0s      
-> Downloading 'portmaster_logo.png'
/tmp/tmp.pXwudeK4P4/portmaster_ 100%[====================================================>]  30.63K  --.-KB/s    in 0.003s  
-> Patching paths in 'portmaster.service'
-> Patching paths in 'portmaster.desktop'
-> Patching paths in 'portmaster_notifier.desktop'
-> Installing 'portmaster-start' and setting security context
-> Installing 'portmaster.service'
-> Installing 'portmaster.desktop'
-> Installing 'portmaster_notifier.desktop'
-> Installing 'portmaster_logo.png' (as 'portmaster.png')
-> Running 'portmaster-start update' to download Portmaster data
[pmstart] 2023/07/22 23:30:45 checking for new versions
[pmstart] 2023/07/22 23:30:46 all resources are up to date
-> (Workaround) Moving 'portmaster.service' to '/etc/systemd/system' and reverse-symlinking it since systemd wants units on the same filesystem
-> Enabling 'portmaster' service
-> Creating 'portmaster_notifier' autostart
ln: failed to create symbolic link '/etc/xdg/autostart/portmaster_notifier.desktop': File exists

@Raphty
Copy link

Raphty commented Sep 28, 2023

Thanks for the script, would you like us to link to it from the Safing wiki?
https://wiki.safing.io/en/Portmaster/Install/Linux

@mateowoetam
Copy link

Has anyone tested this out in VanillaOS? I'm not confident on my ability to read nor test this script without borking my system.

@Raphty
Copy link

Raphty commented Oct 19, 2023

@mateowoetam someone from the Portmaster community wrote a guide for VanillaOS https://wiki.safing.io/en/Portmaster/Install/Linux/VanillaOS I did not test it but other on the discord already did thank him for it, so it seems to work 😁

@WinkelCode
Copy link
Author

Hi @Raphty,
Apologies for missing your earlier comment. Yes, please feel free to link it in the wiki.

@zany130
Copy link

zany130 commented Aug 9, 2024

I get

-> Creating Portmaster program directory at '/var/lib/safing-portmaster'
-> Creating Portmaster exports directory at '/var/lib/safing-portmaster/exports'
-> Downloading 'portmaster-start'
Unknown option 'show-progress'

when running the script on bazzite (based on fedora silver-blue)

Removing the argument --show-progress from all the wget commands fixes the issue and the scripts successfully runs

the strange thing is checking the wget help I do have that argument

wget --help | grep progress                                                                                                                                                                                                                            ─╯
       --progress=TYPE             select progress gauge type
       --show-progress             display the progress bar in any verbosity mode

and this works

 wget -q --show-progress -O test  https://updates.safing.io/latest/linux_amd64/start/portmaster-start                                                                                                                                                   ─╯
test                                                            100%[====================================================================================================================================================>]  26.48M  7.44MB/s    in 3.6s 

@breathless19
Copy link

I get

-> Creating Portmaster program directory at '/var/lib/safing-portmaster'
-> Creating Portmaster exports directory at '/var/lib/safing-portmaster/exports'
-> Downloading 'portmaster-start'
Unknown option 'show-progress'

when running the script on bazzite (based on fedora silver-blue)

Removing the argument --show-progress from all the wget commands fixes the issue and the scripts successfully runs

the strange thing is checking the wget help I do have that argument

wget --help | grep progress                                                                                                                                                                                                                            ─╯
       --progress=TYPE             select progress gauge type
       --show-progress             display the progress bar in any verbosity mode

and this works

 wget -q --show-progress -O test  https://updates.safing.io/latest/linux_amd64/start/portmaster-start                                                                                                                                                   ─╯
test                                                            100%[====================================================================================================================================================>]  26.48M  7.44MB/s    in 3.6s 

Thanks, just tested on Bazzite, works great!

@blind-confused
Copy link

thank you a lot for the script. I hope that Portmaster is still able to protect the entire Fedora Silverblue system and it's apps (including flatpaks), even though it's installed into a slightly different directory (I assume?) than it would be on a regular Fedora Workstation, and even though most of the system is read only (I don't know whether that's supposed to be a difficulty or not)

@blind-confused
Copy link

by the way :) can someone please tell me how is this script supposed to be used properly? (sorry, I'm a newbie)
you just place the script file in your home directory and launch it, or?

@S7venLights
Copy link

S7venLights commented Feb 5, 2025 via email

@blind-confused
Copy link

blind-confused commented Feb 7, 2025

Download the script file, Right click on the script file, edit the file properties to make it executable, right click open it with terminal/Konsole(your command line app), if that doesn't work you need to use terminal to find and run the file with these commands: cd ~/Downloads/wherever/you/put/the/file sudo run thefilename.sh (I'm not sure about that 2nd command just going on memory, search online for how to execute sh files)

I got an error... I found how to run sh files, but what happens when I run the script is this:

-> Creating Portmaster program directory at '/var/lib/safing-portmaster'
-> Creating Portmaster exports directory at '/var/lib/safing-portmaster/exports'
-> Downloading 'portmaster-start'
Unknown option 'show-progress'

the line about unknown option is highlighted in red.
could you please let me know what to do here? (I apologize, I'm a tech newbie)
it seems like people in other comments had the same error, but I'm rly not sure how exactly they fixed it.
I'm running the script on a regular Silverblue.

@blind-confused
Copy link

nvm, I got it. I edited the file in a regular text editor and manually removed all the --show-progress lines, and it worked.
I hope no additional workarounds are needed to get anything working (like system tray, auto updates, etc.)
the terminal output did say this:

-> (Workaround) Moving 'portmaster.service' to '/etc/systemd/system' and reverse-symlinking it since systemd wants units on the same filesystem
-> Enabling 'portmaster' service

but I assume it's just explaining what it's doing, rather than suggesting me to do it.

@blind-confused
Copy link

one weird thing I noticed is, it's not taking time to configure filters. Usually when installing Portmaster, it starts with a yellow shield icon, and tells me that it might take a while to download and configure filters. But this time it didn't say anything like that, and started with a green shield icon.

@blind-confused
Copy link

blind-confused commented Feb 8, 2025

^ nevermind, it did it after all (I had to reinstall the system and Portmaster with it too, and this time it started from yellow icon and configured everything)

@S7venLights
Copy link

S7venLights commented Feb 12, 2025 via email

@blind-confused
Copy link

blind-confused commented Feb 12, 2025

Well done, it often takes persistence, trial and error, lots of reading and a bit of luck to configure tech but you got there 😉

well, not really haha, being a non-tech-expert user, if google results don't work, I usually just ask tech users for help.
here it was just easy because someone else already figured it out.

one weird thing I noticed is, a lot of connections from my browser (and perhaps other apps?) are now moved to "Other connections", for whatever reason, haha.
also experiencing connection issues related to DNS and/or captive portals today (whatever that means), but I guess that's unrelated to Silverblue or this user script. Websites are loading for a few minutes, and then not loading, and so on.

@S7venLights
Copy link

Well you read this thread and that solved the issue, so kinda.

I also get 'other connection' attempts on silverblue/kinoite and bazzite.
I think some OS or linux apps don't have proper app ID's attached to them. THey shouldn't be from you browser though.
What system were you on before silverblue?

@blind-confused
Copy link

What system were you on before silverblue?

just Workstation 41, and it didn't happen there, but I guess it's whatever, as long as they're not missed entirely by the firewall

@S7venLights
Copy link

Yeah I have allowed all 'other connections' and blocked all at various stages and it hasn't noticeably affected my apps or work. Besides the annoying notifications.
But yes, nothing gets by the firewall unless you allow it or malware has infected you :)
Portmaster on linux also starts before the internet does at boot so there are no leaks.

@tukusejssirs
Copy link

tukusejssirs commented Feb 24, 2025

install_location="/var/lib/safing-portmaster" # Must not include trailing slash

How about using realpath "$install_location" or even checking if the variable is defined to a non-empty string if the user could update the location? 🤔

Potentially, the script could also accept a CLI argument (e.g. ./install_portmaster_to_var.sh /some/custom/path)? Then, install_location could be defined as "$1-/var/lib/safing-portmaster".

And beside -e, you should also consider addig -u and -o piefail to set (i.e. set -euo pipefail):

  • -e to exit on error;
  • -u to treat undefined variables as errors;
  • -o pipefail to fail on piped command errors.

However, beware that -u can cause you troubles if you want to use an undefined variable, however, the fix is easy: use ${potentially_undefined_var-}, i.e. append - to the variable name within ${}. This makes sure that any variable which must be defined and is undefined will cause an error, however, any variable which can be undefined won’t.

Moreover, you download files from https://raw.githubusercontent.com/safing/portmaster-packaging/master/*, i.e. from the master branch of the safing/portmaster-packaging. While it could work as expected, as those files should not receive many updates, however, IMHO it would be safer to get them from the same version (commit) as the portmaster-start is. YMMV. Moreover, in the repository’s README.md, there is a note to [c]heck out the main project repository safing/portmaster. Why does the script not download the files from https://github.com/safing/portmaster/tree/develop/packaging/linux? 🤔 That said, in the latter repository, I could not find portmaster_notifier.desktop and portmaster_logo.png. Note: I haven’t updated this yet due to missing files in the other repository, however we could use GitHub API to get the latest release metadata (see the docs) and query it using jq.

Also, I prefer using curl instead of wget (which I usually don’t have installed), therefore, it might be a good idea to check which of the two is installed (if none, throw an error). Then, create a function to download the files.

I also added --now switch to systemctl enable --now portainer.

We could also remove the need of creating a temporary folder, as we should be able to patch the files in their final location (and use chmod to change their permissions) without any issues, however, I didn’t change it.

Below is my updated version of the script (without the two change proposals above with a note I did not change).

Updated file
#!/usr/bin/env bash

# Install Portmaster to a custom location

# src: https://gist.github.com/WinkelCode/dffeb181a4c7903cbc463169324f61b8

# Dependencies:
#
#	- Either `curl` or `wget`;
# - Bash 4+;
# - GNU coreutils (for `basename`, `chcon`, `install`, `ln`, `mkdir`, `mktemp`, `mv`, `realpath`, `rm`);
# - GNU `sed`;
# - SystemD;

# Note: The script was tested with GNU dependencies, but it might work with other implementations too.

set -euo pipefail

if [ "$EUID" -ne 0 ]; then
	echo 'To ensure correct permissions, this script must be run as root.'
	exit 1
fi

if ! download_program="$(command -v curl || command -v wget)"; then
	echo 'You need to have installed either curl or wget.'
	exit 2
fi

# Download a file from a given URL to a specified location using either `curl` or `wget`
#
# Arguments:
#	 $1: URL to download the file from
#	 $2: Location where the file should be saved
download() {
	local url="$1"
	local location="$2"
	
	case "$(basename "$download_program")" in
		curl) "$download_program" -o "$location" "$url" ;;
		wget) "$download_program" -q --show-progress -O "$location" "$url" ;;
	esac
}

# User variables
install_location="${1-/var/lib/safing-portmaster}" # Must not include trailing slash

# Internal variables
install_location="$(realpath "$install_location")"
temp_dir="$(mktemp -d)"

echo "-> Creating Portmaster folder structure under '$install_location'"
mkdir -p "$install_location"/exports/{share/{applications,icons},units}

echo "-> Downloading 'portmaster-start'"
download https://updates.safing.io/latest/linux_amd64/start/portmaster-start "$temp_dir/portmaster-start"

echo "-> Downloading 'portmaster.service'"
download https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster.service "$temp_dir/portmaster.service"

echo "-> Downloading 'portmaster.desktop'"
download https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster.desktop "$temp_dir/portmaster.desktop"

echo "-> Downloading 'portmaster_notifier.desktop'"
download https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster_notifier.desktop "$temp_dir/portmaster_notifier.desktop"

echo "-> Downloading 'portmaster_logo.png'"
download https://raw.githubusercontent.com/safing/portmaster-packaging/master/linux/portmaster_logo.png "$temp_dir/portmaster_logo.png"

echo "-> Patching paths in 'portmaster.service'"
sed -i "s|/opt/safing/portmaster|$install_location|g" "$temp_dir/portmaster.service"

echo "-> Patching paths in 'portmaster.desktop'"
sed -i "s|/opt/safing/portmaster|$install_location|g" "$temp_dir/portmaster.desktop"

echo "-> Patching paths in 'portmaster_notifier.desktop'"
sed -i "s|/opt/safing/portmaster|$install_location|g" "$temp_dir/portmaster_notifier.desktop"

echo "-> Installing 'portmaster-start' and setting security context"
install -m 0755 "$temp_dir/portmaster-start" "$install_location/portmaster-start"
chcon -t bin_t "$install_location/portmaster-start"

echo "-> Installing 'portmaster.service'"
install -m 0644 "$temp_dir/portmaster.service" "$install_location/exports/units/portmaster.service"

echo "-> Installing 'portmaster.desktop'"
install -m 0644 "$temp_dir/portmaster.desktop" "$install_location/exports/share/applications/portmaster.desktop"

echo "-> Installing 'portmaster_notifier.desktop'"
install -m 0644 "$temp_dir/portmaster_notifier.desktop" "$install_location/exports/share/applications/portmaster_notifier.desktop"

echo "-> Installing 'portmaster_logo.png' (as 'portmaster.png')"
install -m 0644 "$temp_dir/portmaster_logo.png" "$install_location/exports/share/icons/portmaster.png"

echo "-> Running 'portmaster-start update' to download Portmaster data"
"$install_location/portmaster-start" update --data="$install_location"

echo "-> (Workaround) Moving 'portmaster.service' to '/etc/systemd/system' and reverse-symlinking it since systemd wants units on the same filesystem"
mv "$install_location/exports/units/portmaster.service" /etc/systemd/system/portmaster.service
ln -s /etc/systemd/system/portmaster.service "$install_location/exports/units/portmaster.service"

echo "-> Enabling 'portmaster' service"
systemctl daemon-reload
systemctl enable --now portmaster

echo "-> Creating 'portmaster_notifier' autostart"
ln -s "$install_location/exports/share/applications/portmaster_notifier.desktop" /etc/xdg/autostart/portmaster_notifier.desktop

echo "-> Adding '$install_location' to \$XDG_DATA_DIRS to show desktop entries (applies after next login)"
# Note: We prepend 'zzz-' since profile.d scripts aren't numbered on Fedora, and we want to run after any other scripts that modify XDG_DATA_DIRS.
echo "XDG_DATA_DIRS=$install_location/exports/share:\$XDG_DATA_DIRS" > /etc/profile.d/zzz-portmaster-to-xdg-data-dirs.sh

echo "-> Removing '$temp_dir'"
rm -rf "$temp_dir"

echo '-> Done, Portmaster and its tray/notifier application will start with the next boot.'

@blind-confused
Copy link

blind-confused commented Mar 3, 2025

I have one question.
I heard (I'm not sure, I never had to try this myself yet) that, when you go from Silverblue 24 to Silverblue 25, you have to uninstall your layered packages, and then reinstall them after the upgrade.
how does this go with Portmaster? Because, after installing it with this script, it's... not listed in my layered packages list. It's also not recognized by the software center. It's only visible in my app library and the "apps" section in settings.
is it known whether we need to reinstall it between major version upgrades?

@S7venLights
Copy link

Silverblue 24 to Silverblue 25

Are you talking about Fedora Version 24??! Fedora is on Version 41 already, I hope you aren't saying you've never updated.

uninstall your layered packages, and then reinstall them after the upgrade.

In my experience updating since Fedora version 39, I could rebase to newer versions without uninstalling layered packages. To rebase(update) to new versions of Fedoara Silverblue see this doc

how does this go with Portmaster?

Portmaster is installed through a different mechanism not through any package manager, so it's expected that it doesn't show in your layered packages. The script essentially puts the apps files in local folders and tells your system to run it at boot and put it in your apps list.
In my experience, when you rebase to new versions Portmaster continues to run just fine.
PS Portmaster updates itself, but I've found that it doesn't delete old update downloads.

Fix Update file pile-ups which use up storage:

  • Make backup of whole portmaster directory

sudo cp -r /var/lib/safing-portmaster/ /var/home/user/Desktop/Portmaster_backup/

  • disconnect internet and shutdown portmaster

  • Copy only the latest update files from the update directories eg:
    sudo cp -r /var/lib/safing-portmaster/updates/all/intel/geoip/geoipv6_v20231201-0-1.mmdb /var/home/user/Desktop/Portmaster_backup/

  • remove the whole folder from the original directory:
    sudo rm -r /var/lib/safing-portmaster/updates/all/intel/geoip/
    copy your copy of the latest file back into the directory

sudo cp -r /var/home/user/Desktop/Portmaster_backup/geoip/ /var/lib/safing-portmaster/updates/all/i
ntel/
  • This directory also has the biggest files to remove, do the same for it:

/var/lib/safing-portmaster/updates/linux_amd64/

@blind-confused
Copy link

blind-confused commented Mar 9, 2025

Are you talking about Fedora Version 24??! Fedora is on Version 41 already, I hope you aren't saying you've never updated.

no haha, I just said 24 as a random example number.

In my experience updating since Fedora version 39, I could rebase to newer versions without uninstalling layered packages. To rebase(update) to new versions of Fedoara Silverblue see this doc

oh okay, thanks

how does this go with Portmaster?

Portmaster is installed through a different mechanism not through any package manager, so it's expected that it doesn't show in your layered packages. The script essentially puts the apps files in local folders and tells your system to run it at boot and put it in your apps list. In my experience, when you rebase to new versions Portmaster continues to run just fine. PS Portmaster updates itself, but I've found that it doesn't delete old update downloads.

thanks for the advice, I'll probably avoid changing anything just in case haha

@blind-confused
Copy link

I think some OS or linux apps don't have proper app ID's attached to them. THey shouldn't be from you browser though.

just in case this info is important as feedback, I noticed that my preinstalled Firefox' connections are also present in "Other connections". I'm not sure whether they are doubled from the "Firefox" app category, or perhaps they were moved from there. Their amount is almost the same as in "Firefox" (for example, if "Firefox" has 58 connections, "Other connections" has around 50 or 54, and so on). I don't notice any bugs or problems yet though.

@bayazidbh
Copy link

bayazidbh commented Mar 27, 2025

This script was mentioned in ublue forum by @breathless19, it seems there is some issue with the latest version of Bazzite?

On a related note, is it possible to bake this into an image instead? I have my image builder repo, if there could be any errors, I'd rather shift the risk there than on my local machine.

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