Any way to restore or fast reinstall an installed flatpak?

Alexander Larsson alexl at redhat.com
Thu Apr 5 12:40:29 UTC 2018


This is tricky, especially if you edited a shared file. For example
say you have both the freedesktop.org and a gnome runtime installed.
The later is based on the former, so it contains all its files. You'll
have two different checkout for these two plus a repo, and any shared
file will be hardlinked in all of these. If you modify the file itself
you run into two issues:

1) ostree assumes that all files in the repo are valid (i.e. they are
named by the sha256 of the content and the content doesn't match that
if it changed without renaming it). So, ostree will never re-download
such a file.
2) If the invalid file is shared, then even uninstalling one of the
runtimes will not get rid of the invalid object.

Maybe you can try ostree fsck --repo=$HOME/.local/share/flatpak/repo --delete


On Thu, Apr 5, 2018 at 1:23 PM, Robin Lee <robinlee.sysu at gmail.com> wrote:
> Yes, I am facing the exact case as you said.
> Using install --reinstall does not recover some config file.
> So, how can I recover it under this situation?
>
> On Tue, Apr 3, 2018 at 4:13 PM, Alexander Larsson <alexl at redhat.com> wrote:
>> By the way, when you do something like this, make sure you replace the
>> file you're editing, rather than edit it in place, because the files
>> in ~/.local/share/flatpak/runtime/... are hardlinked to the ostree
>> repo, so an in-place change will break the ostree repo.
>>
>> Most tools like e.g. editors do this, but some might not.
>>
>> On Tue, Apr 3, 2018 at 8:29 AM, Robin Lee <robinlee.sysu at gmail.com> wrote:
>>> On Tue, Apr 3, 2018 at 2:17 PM, Bartłomiej Piotrowski <b at bpiotrowski.pl> wrote:
>>>> On 2018-04-02 18:53, Robin Lee wrote:
>>>>> Hi,
>>>>>
>>>>> I deleted and modified some files under
>>>>> ~/.local/share/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/
>>>>> .
>>>>> Is there any special method to restore the original whole tree of an
>>>>> installed flatpak?
>>>>>
>>>>> -robin
>>>>> _______________________________________________
>>>>> Flatpak mailing list
>>>>> Flatpak at lists.freedesktop.org
>>>>> https://lists.freedesktop.org/mailman/listinfo/flatpak
>>>>>
>>>>
>>>> flatpak install --reinstall org.freedesktop.Platform//1.6 should do that.
>>> Thanks! I missed this since it is not in the man page (0.10.4).
>>>>
>>>> Bartłomiej
>>> _______________________________________________
>>> Flatpak mailing list
>>> Flatpak at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/flatpak
>>
>>
>>
>> --
>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>  Alexander Larsson                                Red Hat, Inc
>>        alexl at redhat.com         alexander.larsson at gmail.com



-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                Red Hat, Inc
       alexl at redhat.com         alexander.larsson at gmail.com


More information about the Flatpak mailing list