Any way to restore or fast reinstall an installed flatpak?

Alexander Larsson alexl at redhat.com
Fri Apr 6 07:27:56 UTC 2018


Yeah, but you don't have to re-download them, just re-deploy them from
the local ostree repo.
So, something like
 flatpak install --reinstall --no-pull org.gnome.Platform//3.28 ...
should work.

And btw, thanks for your patience with this, clearly it is possible to
understand and fix this, even if its kind of low-level, but we really
should have some built in tool that combines all these fixes to just
auto-fix-up your repo.


On Thu, Apr 5, 2018 at 6:41 PM, Robin Lee <robinlee.sysu at gmail.com> wrote:
> On Thu, Apr 5, 2018 at 10:21 PM, Alexander Larsson <alexl at redhat.com> wrote:
>> On Thu, Apr 5, 2018 at 4:08 PM, Alexander Larsson <alexl at redhat.com> wrote:
>>> On Thu, Apr 5, 2018 at 3:03 PM, Robin Lee <robinlee.sysu at gmail.com> wrote:
>>>> $ ostree fsck --repo=$HOME/.local/share/flatpak/repo --delete
>>>> Validating refs...
>>>> Enumerating objects...
>>>> Verifying content integrity of 16 commit objects...
>>>>
>>>> fsck objects (48647/72169) [========     ]  67%fsck content object
>>>> b5eeec19a429c594e684f64c1bc84f717b9b6596e3f75fc8197421d94f560c61:
>>>> Corrupted file object; checksum
>>>> expected='b5eeec19a429c594e684f64c1bc84f717b9b6596e3f75fc8197421d94f560c61'
>>>> actual='b7431d71c722e8edb2f4f11b1603ebcfa281e7a598757fa7631355a40fbac986'
>>>> fsck objects (72169/72169) [=============] 100%
>>>> 6 partial commits not verified
>>>> error: Repository corruption encountered
>>>>
>>>> After running this, runtime reinstall will fail:
>>>>
>>>> $ flatpak --user install  flathub org.freedesktop.Sdk/x86_64/1.6
>>>> Installing for user: org.freedesktop.Sdk/x86_64/1.6 from flathub
>>>> [####################] 1 metadata, 0 content objects fetched; 569 B
>>>> transferred in 6 seconds
>>>> error: While trying to checkout
>>>> 07b0e89b0f6c4f72bbeb101f89d5c16ffab2a1f3d2e317b5ecc2adf8ead585ba into
>>>> /home/cheese/.local/share/flatpak/runtime/org.freedesktop.Sdk/x86_64/1.6/.07b0e89b0f6c4f72bbeb101f89d5c16ffab2a1f3d2e317b5ecc2adf8ead585ba-68YTGZ:
>>>> Couldn't find file object
>>>> 'b5eeec19a429c594e684f64c1bc84f717b9b6596e3f75fc8197421d94f560c61'
>>>>
>>>> So the file is still not recovered.
>>>
>>> Hmm, this is the object that was corrupt and deleted above, so its not
>>> unexpected that it is not ther. But I'm not sure why it was not pulled
>>> when you reinstalled...
>>>
>>> o> By the way, shall flatpak prevents apps from modifying files under /etc?
>>>
>>> For technical reasons /etc is a tmpfs, so you can write to it but all
>>> the files from the runtime that are in there are not writable.
>>
>> Actually i know why this is happening. When we pull the new commit as
>> long as there is a commit or a directory locally available in the repo
>> it assumes all the objects it references are there.
>>
>> Can you try to create an empty file called
>> ~/.local/share/flatpak/repo/state/07b0e89b0f6c4f72bbeb101f89d5c16ffab2a1f3d2e317b5ecc2adf8ead585ba.commitpartial
>>
>> And then:
>>
>> flatpak --user install --reinstall flathub org.freedesktop.Sdk/x86_64/1.6
> Yes. This fixed the broken repo. But after reinstalling org.freedesktop.Sdk,
> But I have to also reinstall all other runtimes that based on
> org.freedesktop.Platform.
> Right?
>>
>> Colin: Maybe we should add a flag to ostree pull that assumes all
>> commits are partial, for this kind of "repo repair" operations? I.e.
>> to repair a repo we could do ostree fsck --delete, and then re-pull
>> all refs with this flag.
>>
>>
>>
>> --
>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>  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