Score:2

How do I install and migrate to the official Firefox flatpak?

ru flag

I would like to install Firefox via Flathub while ensuring that I am using an official build from Mozilla and not a repackage/PPA.

Score:3
ru flag

Backing up your existing profile

Before we begin we should always back up our stuff, even if you're using Firefox Sync

Install Flathub

Mozilla publishes Firefox directly into Flathub, however we need to turn this on in Ubuntu. Follow these instructions, I am summarizing them below:

sudo apt install flatpak
sudo apt install gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo    

Install Firefox

This will install Firefox and the corresponding ffmpeg libraries so videos, etc work:

flatpak install flathub org.mozilla.firefox org.freedesktop.Platform.ffmpeg-full/x86_64/20.08

Then the Firefox icon will appear in your menu/overlay, or you can do flatpak run org.mozilla.firefox to launch it from the command line.

Migrating your profile

[todo]

Reusing your old profile

You can also reuse your profile without manually copying it over though this probably isn't a good permanent solution.

Quit firefox, then do

flatpak override --user --filesystem=~/.mozilla org.mozilla.firefox

to have the flatpaked Firefox reuse your old profile.

Checking your work

Clicking on the burger menu -> Help -> About Firefox will show "Mozilla Firefox Flatpak" and "mozilla-flatpak" in the dialog window:

enter image description here

vanadium avatar
cn flag
`firefox run org.mozilla.firefox` should likely read `flatpak run org.mozilla.firefox`
Score:0
in flag

Okay, so I just did this successfully (on Arch / EndeavourOS). So I'm putting it down here, in case anyone wants to know how.

On Linux your Firefox profiles are typically stored at:

~/.mozilla/firefox

There might be multiple profiles in there. Profiles are directories, with random names, but usually followed with something like .default-release or .default. You can find out which your profile is by running Firefox with -P (so just firefox -P on the terminal). That's the profile you want to save (you could move all the profiles over as well).

(Optional Step: even though it's not actually necessary, I would back up your profile data. If you have a folder ~/backups, I'd run rsync -a ~/.mozilla/firefox ~/backups/ to copy it over.)

First, I'd install the native non-Flatpak system Firefox. On Arch, this is done with sudo pacman -R firefox, and on Ubuntu, it's probably sudo apt remove firefox.

Second, install Firefox from Flathub. Run flatpak install org.mozilla.Firefox. Don't launch the newly installed Firefox yet.

Note: the Flathub Firefox's firefox folder lives here:

~/.var/app/org.mozilla.firefox/.mozilla/firefox/

Now, move your old profile(s) into this folder. What I did was:

  1. Move my specific profile folder. So: mv ~/.mozilla/firefox/abcd123e.default-release ~/.var/app/org.mozilla.firefox/.mozilla/firefox/ (where abcd123e.default-release is your profile folder now)

  2. Copy profiles.ini file over similarly (if one doesn't already exist for the Flathub Firefox -- it shouldn't, if you didn't open it). After copying it, delete the [InstallXXX....] section.

(You could just overwrite the whole firefox folder I suppose, but I haven't tried that.)

That's it. I launched the Flathub Firefox, and everything was working perfectly fine, and as expected.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.