0

While trying to move a file into /usr/lib/x86_64-linux-gnu, I accidentally overwrote x86_64-linux-gnu itself. The system(ArchLinux) is still running, but I'm not sure how to safely recover x86_64-linux-gnu, what exactly/how important it is, or what will happen if the system reboots. How can I fix/recover x86_64-linux-gnu, and anything else that might have happened with the system?

edit: The command that accidentally overwrote x86_64-linux-gnu, is mv /usr/lib/liblatencyflex_layer.so /usr/lib/x86_64-linux-gnu, the intended command was mv /usr/lib/liblatencyflex_layer.so /usr/lib/x86_64-linux-gnu/ (first I had accidentally moved into /usr/lib/ instead of /usr/lib/x86_64-linux-gnu/). I'm trying to do a manual install of program that needs a liblatencyflex_layer.so file in x86_64-linux-gnu.

edit2: Apparently /usr/lib/x86_64-linux-gnu is a Debian directory not ArchLinux, and I was following the wrong tutorial; more info in the comments below twelfth's answer.

5
  • How did you manage to do that?
    – muru
    Commented Aug 1, 2023 at 1:36
  • how important it is ... of the 1564 packages I have installed (in Debian) 803 of them install something in that folder, for a total of 5703 files/links/folders - so, I would say it's quite important Commented Aug 1, 2023 at 1:54
  • @JaromandaX, So what should I do? Is there some sort of way to undo/recover files after a mv? I assume I'm not able to reinstall that folder because it seems it varies by system.
    – Shringe_
    Commented Aug 1, 2023 at 1:57
  • The steps you say you took to get yourself into this situation can't be right - you can't overwrite a directory with a file ... you must have moved the directory out of the way before "mv"ing a file into its place.
    – tink
    Commented Aug 1, 2023 at 2:35
  • @tink, I gave the exact command I did to get into this situation. So I'm not sure what to tell you.
    – Shringe_
    Commented Aug 1, 2023 at 2:43

1 Answer 1

0

what exactly... it is

Please see here for further information, as this answer explains that quite well.

Arch Linux users, please ignore the above link, which pertains to the Debian or Ubuntu handling of multiarch. For Arch handling of this, please see the Arch wiki file hierarchy.

How can I fix/recover x86_64-linux-gnu, and anything else that might have happened with the system?

There is nothing to fix. The directory does not ordinarily exist in Arch installations. Please check when manually installing whether the instructions pertain to your distribution, as differences can arise.

Assuming you did, for some reason, have the /usr/lib/x86_64-linux-gnu/ directory in your Arch installation, execute the following.

Please back up your data before running the second command.

Open a terminal and try running:

# pacman -Qk

See here and here for further explanation of the command above. This locates missing files. Then, with the results from that copied, paste them as follows:

# pacman -Syu [INSERT RESULTS FROM ABOVE]

See here for further explanation of the command above.

14
  • Thank you I'll try that once a timeshift backup completes.
    – Shringe_
    Commented Aug 1, 2023 at 2:03
  • No problem. I presume the timeshift is going to an external storage device?
    – twelfth
    Commented Aug 1, 2023 at 2:05
  • Should I keep or delete the new file that has overridden /usr/lib/x86_64-linux-gnu before doing either of those?
    – Shringe_
    Commented Aug 1, 2023 at 2:05
  • You would need to provide further details as to what this new file is and your intentions for moving it. Please edit your OP to reflect this. Ordinarily, Arch advises users to move files into the home directory.
    – twelfth
    Commented Aug 1, 2023 at 2:07
  • 1
    Oops you are right, the tutorial I was following I thought was an Arch tutorial, not Debian. I feel pretty silly right now, but thank you so much for all the help you have given me. I swore I had used this same tutorial for installation on a previous Arch system, so not sure what I'm remembering. github.com/ishitatsuyuki/LatencyFleX
    – Shringe_
    Commented Aug 1, 2023 at 3:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .