Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM package cannot be installed on Fedora 25 #1555

Closed
ghost opened this issue Dec 17, 2016 · 21 comments
Closed

RPM package cannot be installed on Fedora 25 #1555

ghost opened this issue Dec 17, 2016 · 21 comments
Labels
Prio:3 Low priority: Minor problems and nice to have features Type:Bug Errors and problems

Comments

@ghost
Copy link

ghost commented Dec 17, 2016

It appears as if it wasn't possible to install the latest RPM build on Fedora 25, at least it didn't work for me:

[root@falcon mozilla_jonas0]# dnf install ./TrenchBroom-Linux-2.0.0-Beta-2f3c498-RelWithDebInfo.x86_64.rpm 
github_git-lfs-source                           565  B/s | 1.3 kB     00:02    
github_git-lfs                                  874  B/s | 1.7 kB     00:01    
Failed to synchronize cache for repo 'pkerling-seafile', disabling.
Last metadata expiration check: 0:00:01 ago on Sat Dec 17 23:19:35 2016.
Dependencies resolved.
================================================================================
 Package           Arch         Version                Repository          Size
================================================================================
Installing:
 freeimage         x86_64       3.17.0-7.fc25          fedora             324 k
 jxrlib            x86_64       1.1-5.fc24             fedora             435 k
 libpng12          x86_64       1.2.56-2.fc24          fedora             156 k
 trenchbroom       x86_64       2.0.0-1                @commandline        70 M

Transaction Summary
================================================================================
Install  4 Packages

Total size: 71 M
Installed size: 188 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] freeimage-3.17.0-7.fc25.x86_64.rpm: Already downloaded               
[SKIPPED] libpng12-1.2.56-2.fc24.x86_64.rpm: Already downloaded                
[SKIPPED] jxrlib-1.1-5.fc24.x86_64.rpm: Already downloaded                     
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Transaction check error:
  file /opt from install of trenchbroom-2.0.0-1.x86_64 conflicts with file from package filesystem-3.2-37.fc24.x86_64

Error Summary
-------------

[root@falcon mozilla_jonas0]#
@kduske kduske added this to the TrenchBroom 2.0.0 milestone Dec 17, 2016
@kduske kduske added Type:Bug Errors and problems Platform:Linux Prio:3 Low priority: Minor problems and nice to have features labels Dec 17, 2016
@eGax
Copy link
Contributor

eGax commented Dec 20, 2016

I've never ran Fedora before, but a simple web search revealed similar issues with other 3rd party packages in recent past. It's most definitely a packaging issue with the Trenchbroom RPM that needs to be sorted out by whoever created it. From my limited understanding the spec file inside the Trenchbroom RPM used to build the package has at least one of the directories listed with 755 permissions that's owned by the file system, causing the conflict making it fail to install. The offending line is the 1st under the %files section:

%dir %attr(0755, root, root) "/opt"

I went ahead and installed Fedora 25 into virtualbox and following what I learned produced an installable rpm from the bugged one. I have no desire to map inside of Fedora, but it seemed to run fine for me. Fine as in made a quick quake map, put in a few models, used textures and everything loaded, looked and operating fine in the 30 minutes I putzed around. :-) So the good news is until it's fixed and you have met the dependencies you can just extract the trenchbroom folder and contents from the dep or rpm files and run trenchbroom manually or you can rebuild the package without that conflicting line yourself in only a few minutes. I'll write a little guide for you and anyone else that comes along on Fedora who might want to install TrenchBroom also.

screenshot from 2016-12-20 11-36-58

We are going to use rpmrebuild to extract the spec file to edit and then rebuild the package. We need to open a terminal any so if rpmrebuild is not already installed open a terminal window and enter:

sudo dnf install rpmrebuild

By default rpmrebuild will use the Vim terminal text editor to edit the spec file extracted from the RPM. If you want to use any other installed text editor we can specify that before we rebuild the package by entering this in the terminal: export EDITOR=/usr/bin/gedit
(Replace with whatever /pathto/favoriteditoryouprefer)

OK, now let's do THIS! In the same terminal enter the command, options and path to the RPM that needs rebuilding:

rpmrebuild -pe '/home/youraccountname/Downloads/TrenchBroom-Linux-2.0.0-Beta-2f3c498-RelWithDebInfo.x86_64.rpm'
(Change the name of the rpm if different and the directory above to where ever YOU have placed the rpm.)

By default the spec file should load via Vim in the same terminal window. Use the down arrow key to bring down the Vim block cursor to the %files section. Look for the line:

%dir %attr(0755, root, root) "/opt"

Put your Vim cursor on that line and delete it by tapping the [d] key twice followed by typing :wq to save file and exit Vim. Now you'll see the prompt, "Do you want to continue ? (y/N)" Press [y].

rpmrebuild will now build a new "valid" package that should be located in /home/youraccountname/rpmbuild/RPMS/x86_64/trenchbroom-2.0.0-1.x86_64.rpm, but it will print the location when it's finished. For me in virtualbox with an i5 intel CPU it takes just a few minutes to rebuild the rpm.

Now you can install Trenchbroom with:

sudo dnf install /home/youraccountname/rpmbuild/RPMS/x86_64/trenchbroom-2.0.0-1.x86_64.rpm

Enjoy!

@kduske
Copy link
Collaborator

kduske commented Dec 20, 2016

Support for linux packages was added by @pnahratow -- maybe he's still around and willing to fix this?

@kduske
Copy link
Collaborator

kduske commented Dec 20, 2016

@eGax thanks for investigating btw. -- good work!

@eGax
Copy link
Contributor

eGax commented Dec 20, 2016

Not a problem, trying to help where I can in return for great free software.

@ericwa
Copy link
Collaborator

ericwa commented Dec 20, 2016

/opt appears in the cpack configuration here:
https://github.com/kduske/TrenchBroom/blob/develop/cmake/TrenchBroomApp.cmake#L286

Possibly a cmake bug?

@pnahratow
Copy link
Contributor

pnahratow commented Dec 20, 2016

I have fixed this issue once before. The problem was that the rpm claims to own the /opt directory which it of course does not. This fix was just one line in the cmake file. I'll have to look through some old commits. I'm not sure where the development went since I thought we already switched to the /usr directory.

@pnahratow
Copy link
Contributor

Yeah here it is #1301

@pnahratow
Copy link
Contributor

So what's the status? Want me to fix this or do we finally want to move to /usr

@kduske
Copy link
Collaborator

kduske commented Dec 20, 2016

From that issue report:

However since we recently moved from /opt to /usr/... this won't be an issue anymore.

That sounds like that already happened.

@pnahratow
Copy link
Contributor

Its on branch Feature/1163
The exact commit is 70e5c9b

What happened to it?

@eGax
Copy link
Contributor

eGax commented Dec 20, 2016

This any use to you guys?

https://stackoverflow.com/questions/24983181/cpack-generates-rpms-with-files-entries-that-conflict-with-the-rpm-spec-how-to

OR

Lensfun had a similar issue recently:

The problem can be avoided by passing an extra parameter to cmake, together with a list of directories that should be excluded from the file list of the RPM.
What I did was:
$ cmake -DCPACK_BINARY_RPM:BOOL=ON -DCPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION="/usr/local;/usr/local/bin;/usr/local/include;/usr/local/lib;/usr/local/lib64;/usr/local/share" ../

Found those when I was trying to track down what caused this issue with the rpm.

pnahratow probably already knows how to fix since he already has before.

@kduske
Copy link
Collaborator

kduske commented Dec 20, 2016

@pnahtarow Look at the merge commit: #1297

I bungled that one up.

@pnahratow
Copy link
Contributor

I'm not sure I understand. All I see is that the featurebranch never really went into develop. As far as I remember the whole thing also depended on the switch to using wxStandardPaths instead of the old way.

Well you just decide how to to proceed from here and I'll be happy to assist.

@kduske
Copy link
Collaborator

kduske commented Dec 20, 2016

I don't understand it myself, it looks like I merged it into the wrong branch or something. I have just updated my own feature/1163 branch with all changes on develop that have happened since then. Now I'm waiting for the builds to finish.

@kduske
Copy link
Collaborator

kduske commented Dec 21, 2016

Ok, I merged that branch finally. Thanks!

@ericwa
Copy link
Collaborator

ericwa commented Dec 21, 2016

Do we want it on the release/v2.0.0 branch as well? Currently only in develop

@kduske
Copy link
Collaborator

kduske commented Dec 21, 2016

Yeah, good point.

@kduske
Copy link
Collaborator

kduske commented Dec 21, 2016

Ok, it's on release/v2.0.0 now, too.

@ericwa
Copy link
Collaborator

ericwa commented Dec 24, 2016

Fixed by a56e992 912314d 85c3c67

@ghost
Copy link
Author

ghost commented Jan 2, 2017

Thanks for looking into this so quickly!

I don't understand the order of anything listed on http://kristianduske.com/trenchbroom/downloads.php?platform=linux_rpm but the one marked as "latest" in the green box still has this bug.

Do I simply need to wait until the RPM packages are updated?

@kduske
Copy link
Collaborator

kduske commented Jan 2, 2017

They are listed by release date, descending, so latest is first. You will have to wait for new builds, which will happen soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio:3 Low priority: Minor problems and nice to have features Type:Bug Errors and problems
Projects
None yet
Development

No branches or pull requests

4 participants