You are not logged in.

#1 2013-10-31 09:00:42

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Clean up system files not owned by any package

Hello,

I recently wanted to install nginx and passenger on my laptop for some tests. Passenger requires ruby-rack and it fails to install on my system:

% sudo pacman -S passenger
resolving dependencies...
looking for inter-conflicts...

Packages (2):

Name                 New Version  Net Change

community/ruby-rack  1.5.2-2        4.68 MiB
community/passenger  4.0.21-1      74.39 MiB

Total Installed Size:   79.07 MiB

:: Proceed with installation? [Y/n] y
(2/2) checking keys in keyring                                                                                                           [------------------------------------------------------------------------------------] 100%
(2/2) checking package integrity                                                                                                         [------------------------------------------------------------------------------------] 100%
(2/2) loading package files                                                                                                              [------------------------------------------------------------------------------------] 100%
(2/2) checking for file conflicts                                                                                                        [------------------------------------------------------------------------------------] 100%
error: failed to commit transaction (conflicting files)
ruby-rack: /usr/bin/rackup exists in filesystem
Errors occurred, no packages were upgraded.

Therefore, I wondered why I do have /usr/bin/rackup on my sytem already. So I wanted to find which files in /usr/bin are not owned by any package:

% find /usr/bin -exec pacman -Qo {} + >/dev/null
error: No package owns /usr/bin/sequel
error: No package owns /usr/bin/serve
error: No package owns /usr/bin/nokogiri
error: No package owns /usr/bin/haml
error: No package owns /usr/bin/minitar
error: No package owns /usr/bin/update_rubygems
error: No package owns /usr/bin/rake2thor
error: No package owns /usr/bin/launchy
error: No package owns /usr/bin/dw
error: No package owns /usr/bin/sass
error: No package owns /usr/bin/sass-convert
error: No package owns /usr/bin/erubis
error: No package owns /usr/bin/bundle
error: No package owns /usr/bin/scss
error: No package owns /usr/bin/kramdown
error: No package owns /usr/bin/jekyll
error: No package owns /usr/bin/rackup
error: No package owns /usr/bin/rails
error: No package owns /usr/bin/thor
error: No package owns /usr/bin/posix-spawn-benchmark
error: No package owns /usr/bin/turn
error: No package owns /usr/bin/compass
error: No package owns /usr/bin/tt
error: No package owns /usr/bin/marutex
error: No package owns /usr/bin/maruku
error: No package owns /usr/bin/coderay
error: No package owns /usr/bin/tilt
error: No package owns /usr/bin/gpgen
error: No package owns /usr/bin/rdiscount
error: No package owns /usr/bin/redcloth
error: No package owns /usr/bin/b2sum
error: No package owns /usr/bin/html2haml

It appears that most of these files are ruby gems (nokogiri, redcloth, etc.). I cannot remember how nor when they ended up here (this is a 2 years old Arch installation).
I already remove all manually installed gems from my system but these files remain. If any of you has an opinion on what would be the best way to clean this, I'd be glad to hear.

Offline

#2 2013-10-31 09:58:29

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,464
Website

Re: Clean up system files not owned by any package


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2013-10-31 12:16:34

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Re: Clean up system files not owned by any package

I think you haven't read what I wrote:

Rolinh wrote:

I already remove all manually installed gems from my system but these files remain.

Offline

#4 2013-10-31 12:32:12

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: Clean up system files not owned by any package

So what's the problem with using rm?…

Offline

#5 2013-10-31 13:18:39

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Re: Clean up system files not owned by any package

I just want to make sure there is no files left over from non-clean gem installations. But I guess I'll just go find what is not owned by any package under /usr/lib, /usr/bin and so on and remove with care what I think can be safely removed.
I just thought that maybe someone would come up with a more clever idea.

Offline

#6 2013-10-31 13:26:40

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,464
Website

Re: Clean up system files not owned by any package

Rolinh wrote:

I think you haven't read what I wrote:

Rolinh wrote:

I already remove all manually installed gems from my system but these files remain.

I interpreted that as in you used pacman to remove them, my bad. Just to make sure though, you did 'gem uninstall' as root, right? Running it as a normal user just removes the gem files from your user's home directory.

If they're not known by pacman or gem, then you'll need to identify and remove them manually.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2013-10-31 13:52:35

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Re: Clean up system files not owned by any package

Sorry then if it's just a misunderstanding.

But yes, I ran gem uninstall as root. I have no pacman installed gems on my system. I kept all user installed gems.

So yes, I guess I'll just need to go for manual check and removal of system files not owned by any package then.

Offline

#8 2013-10-31 13:58:29

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,464
Website

Re: Clean up system files not owned by any package

You could use https://aur.archlinux.org/packages/lostfiles to help find unowned files. The script is quite slow though, and does return a number of files which, while not tracked by pacman, are meant to be there. Use caution when removing files, don't just nuke them all. wink


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#9 2013-10-31 14:00:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Clean up system files not owned by any package

Have you tried using https://aur.archlinux.org/packages/lostfiles ?
Damn time dilatation!

Last edited by karol (2013-10-31 14:01:53)

Offline

#10 2013-10-31 14:12:27

Rolinh
Member
From: Switzerland
Registered: 2011-05-07
Posts: 144
Website

Re: Clean up system files not owned by any package

Ok, thanks for the tip. smile
I already used this one from the wiki. But same things: it returns files not owned by pacman but that are actually needed.
Anyway, it helps and I'll remove with care.

Offline

Board footer

Powered by FluxBB