How can I resolve "x conflicts with file y"

Hello!
I have a question. How can I solve file conflicts when I install something? I recently cannot install more software because of these errors :


Can you guys can tell me how to solve these errors (in general)?

One way is to use tools that have been provided and tested for use with fedora. PacketTracer is from a 3rd party source and obviously has not been configured to work with fedora. It is showing conflicts in trying to create paths that already exist and because it is 3rd party the conflict cannot be handled by rpm.

While rpm is a very powerful tool it has been superseded by first yum, then dnf which is the currently used package manager.

Dnf has the ability to read an rpm package, find out what its dependencies and conflicts are, and pull in the needed packages to complete the install. It also keeps and updates a database of installed software and allows different packages to share files & directories.

Please try again with sudo dnf install ./PacketTracer-8.2-2.x86_64.rpm. I suspect that will work.

Additionally, when you post information from a screen in the future I suggest that you use copy&paste of the text using the </> Preformatted text tags available on the tool bar above the text input window here so we can more easily read and respond to your posts. I had to type the entire command with file name that could have been mostly copied if it had been posted as text.

Thanks for reply and for the suggestion !
I ran the command you said but the file still conflicts with another.
The error is still the same

Error: Transaction test error:
  file /usr/share/mime from install of PacketTracer-8.2-2.x86_64 conflicts with file from package shared-mime-info-2.1-3.fc35.x86_64
  file /usr/share/mime/packages from install of PacketTracer-8.2-2.x86_64 conflicts with file from package shared-mime-info-2.1-3.fc35.x86_64
  file /opt from install of PacketTracer-8.2-2.x86_64 conflicts with file from package filesystem-3.18-2.fc36.x86_64
  file /usr from install of PacketTracer-8.2-2.x86_64 conflicts with file from package filesystem-3.18-2.fc36.x86_64
  file /usr/share from install of PacketTracer-8.2-2.x86_64 conflicts with file from package filesystem-3.18-2.fc36.x86_64
  file /usr/share/applications from install of PacketTracer-8.2-2.x86_64 conflicts with file from package filesystem-3.18-2.fc36.x86_64
  file /usr/share/icons from install of PacketTracer-8.2-2.x86_64 conflicts with file from package filesystem-3.18-2.fc36.x86_64

[jjpg@192 Apps]$ 

Is there another method to resolve the error ? or should I use a virtual machine to run the app?

I don’t think there is a “good” way to resolve this sort of error. Typically, one chooses one or the other package when such a conflict arises. Also, such errors usually only arise if you try to install two versions of the same program (e.g. the 32-bit version and the 64-bit version).

In this case, I think there is something wrong with the PacketTracer package and it might be appropriate to file a bug report upstream. All the conflicts are directories and I think the package itself should only create those if needed rather than listing them as hard requirements.

Since all the conflicts are directories, you might get away with forcing the install. But it would be dangerous. It could, for example, delete all the contents of the directory. I don’t think it would though. If I really wanted to do this, I would take a snapshot of my root file system, download the other packages that PacketTracer is conflicting with, force-install PacketTracer, and then (force) re-install the other packages (shared-mime-info and filesystem) just to be sure that the package manager sees those directories as properly owned by those packages rather than the third-party PacketTracer package. I would also add the line exclude=PacketTracer to /etc/dnf/dnf.conf so that future upgrades of the system should ignore the presence of PacketTracer and not see any conflicts again. This is really the sort of thing that only someone who is very experienced with working with Linux systems would do though. Or someone who is ready to do a reinstall of their system. Third-party packages in general can cause all sorts of problems. Really, the best answer is to file a bug report upstream.

Note that every error there is a path name and not a specific file. It seems to be trying to create those paths and does not properly share them.

I cannot download the file and test the install without setting up an account on the cisco site. I did find a site that describes how to use the .deb file and do the install on fedora although it will require that you modify those instructions for fedora.
https://grupp-web.de/cms/2020/01/03/installation-of-packet-tracer-7-3-on-rpm-linux-systems-without-alien/

It is also possible to unpack the .rpm file and alter it so it does not error in the way you are seeing; then repackage the rpm so it can be properly installed. While I know it can be done I do not have the instructions handy nor have I actually done so.

Thanks for help!