This is the old SliTaz forum - Please use the main forum.slitaz.org

[SOLVED] File lost! Problems with installed files
  • Hi all

    In the package manager I saw, that many of my files are lost. But looking through all installed packages, if there are files lost, seems a little bit awkward to do. Is there a command with which I detect these files and automatically reinstall the packages?

    Thanks in advance
    Killerkaninchen
  • Is there a manual to study about tazpkg, so I can find the command myself? I couldn't find one online...
  • erniaernia April 2010
    sorry, double post
  • Thanks for this link.
    I don't see a way to automatically find lost files and reinstall the packages, but I'll try further...
  • mojomojo April 2010
    When you say files lost do you mean tazpkgs you thought were installed but tazpkgbox the GUI version of tazpkg doesn't show them at all or as installed.

    There are bugs in tazpkgbox, I don't trust what it says.

    I put a new repository in for slitaz-2.0 after a recharge it showed fewer than 50 tazpkgs. The package statistics are correct,but the package display is wrong.

    tazpkg on the commandline as root listed everything correctly

    root@slitaz: tazpkg list
    shows whats installed.

    root@slitaz: tazpkg check
    verify consistency of installed packages

    I get alot of dependency loops, modified and lost files.

    Everything works so I ignore it.

    Remember, if it ain't broke don't fix it.
  • Some of my programs didn't work. And on the command line I saw that some programs were missing. In package manager I found out that files referring to the programs were missing. Reinstallation solved the problem.

    tazpkg check shows me many lost files. How do I pipe this to a "reinstallation command"?
    tazpkg check | ??? get-install --forced ???
  • erniaernia April 2010
    you may want to try this:
    tazpkg check | sed 'N;s/\n / /;P;D;' | grep "Files lost from" | sed -n /\ $/!p | cut -d \  -f 4 > lostfilepackages.txt

    check lostfilepackages.txt content and then, if you dare
    tazpkg get-install-list lostfilepackages.txt --forced

    i'm not responsible of what happens :-)
    if you are really crazy you can pipe the two commands with &&
  • I'll try the two single commands. For now I have Slitaz installed to check it out, so I'll dare...
    Can you tell me, what the first command does? "tazpkg check" and "grep..." are obvious to me, but the rest...

    And how do I get these code blocks?
  • erniaernia April 2010
    sed 'N;s/\n / /;P;D;' has been stealed from wikipedia sed page :-) :
    http://en.wikipedia.org/wiki/Sed
    it removes newlines from sentences where the second sentence starts with one space. when i'll grow old i will understand how does it works ...
    sed -n /\ $/!p removes lines ending with a space
    cut -d \ -f 4 select the 4th field in every row using a space as separator

    you can copy-paste the code, if you add a command at a time to the pipe you can check every single output
  • I tried the first command. It worked partially...
    I only had to add another » | sed 'N;s/\n / /;P;D;'«.
    Using this sed command only once, results in some lines with spaces at its end, but which contain packages with lost files.

    example:
    Files lost from libcdio 0.80 : [space][space]
    /usr/lib/libcdio.so.7.1.1 /usr/lib/libudf.so.0.0.0

    The second sed command then removes them.

    So
    tazpkg check | sed 'N;s/\n / /;P;D;' | sed 'N;s/\n / /;P;D;' | grep "Files lost from" | sed -n /\ $/!p | cut -d \ -f 4 > lostfilepackages.txt
    and
    tazpkg get-install-list lostfilepackages.txt --forced
    work perfect!

    Thanks
    Killerkaninchen
  • erniaernia April 2010
    i did not miss /usr/lib/libcdio.so.7.1.1 so i've tried to delete it and checked the output of tazpkg check: i don't know the reason why but the output is
    Files lost from libcdio 0.80 :

    /usr/lib/libcdio.so.7.1.1
    target of symlink /usr/lib/libcdio.so.7
    target of symlink /usr/lib/libcdio.so

    and not as i would expect
    Files lost from libcdio 0.80 :
    /usr/lib/libcdio.so.7.1.1
    target of symlink /usr/lib/libcdio.so.7
    target of symlink /usr/lib/libcdio.so

    The empty line is not an empty line but a line with two spaces in it, so get caught by sed 'N;s/\n / /;P;D;' and the resulting output is the one you posted.
    So in my opinion it would make more sense, instead of repeating sed 'N;s/\n / /;P;D;' 2 times, delete all lines which contains just two spaces with sed '/^ $/d' before to run sed 'N;s/\n / /;P;D;' . This would catch 3 occurence of only two space lines too. Then, with the last sed, catch the lines ending with : instead the ones ending with spaces.
    do you agree on this?
    so the final command line could be
    tazpkg check | sed '/^  $/d' | sed 'N;s/\n / /;P;D;' | grep "Files lost from" | sed '/:$/d' | cut -d \  -f 4 > lostfilepackages.txt
    followed by

    tazpkg get-install-list lostfilepackages.txt --forced

    sure a solution of this kind depends a lot on tazpkg check output.
  • I'm on Ubuntu at the moment, so I will try that later, but it sounds plausible.
  • Yes, I agree. It works!

    Thanks
    Killerkaninchen
This discussion has been closed.
← All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social