Re: Any way to restore or fast reinstall an installed flatpak?

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 gmail com> wrote:
On Thu, Apr 5, 2018 at 10:21 PM, Alexander Larsson <alexl redhat com> wrote:
On Thu, Apr 5, 2018 at 4:08 PM, Alexander Larsson <alexl redhat com> wrote:
On Thu, Apr 5, 2018 at 3:03 PM, Robin Lee <robinlee sysu 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
Corrupted file object; checksum
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
Couldn't find file object

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

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

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 redhat com         alexander larsson gmail com

 Alexander Larsson                                Red Hat, Inc
       alexl redhat com         alexander larsson gmail com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]