Cleaning abandoned dependency packages in Yast

This is the story: I occasionally install packages which I happen to remove afterward (via Yast - Install Manager). Some of those packages add dependencies to the system, but don’t delete them when uninstalled. This leads to the system getting cluttered with dependencies that are no longer needed, which I imagine will cause it to become slow over time and wastes disk space.

I looked at package details in Yast, and it seems the software manager knows which packages were installed specifically by the user and which are there as dependencies. Normally, I only install software via Yast repositories, and if external programs have dependency libs (typically compilers like gcc) I manually install those too. My question is if Yast can scan the dependencies of all installed packages and generate a list of all abandoned dependencies, which I can then pick from and delete if I’m sure. It would really help at keeping my system clean, as long as it’s safe. Packages that Yast doesn’t know about should of course be ignored.

In case it’s possible to do, I wanna know how safe this is. Specifically if there’s a risk of making the system no longer boot, or breaking something beyond repair. As far as I know, if Yast lists a package as a dependency for another package that no longer exists, it doesn’t make sense to keep it nor should removing it break anything, but who knows? Anyone know how this can be done?

To be on the safe side, I wouldn’t remove even abandoned packages without <really> knowing what app was associated with the library.
.
Remember, it’s also possible to install packaged libraries for applications installed from source. YAST wouldn’t know about those apps so could mark the library as “abandoned” when the app still exists

AFAIK if a dependency was installed because a packaged app was installed, when that app is removed the dependency will usually be removed at that time as well.

As for performance, as long as the partition is less than 75% full I doubt that your disk i/o should be noticeably affected. If the file is unused, it just sits there affecting nothing.

As for affecting booting or applications, yes IMO you should consider your technical recovery skills. If you’re formatted with EXT4, I recommend pre-installing ext-ext4 which unfortunately is not in the openSUSE repos. A little foresight and preparation can calm nerves! With this app pre-installed, you can recover files from any partition it points to within a few seconds or minutes based on a running database it updates every 20min by default. Most people recover files after the fact which involves scrambling and in some cases risking over-writing the data accidentally.

IMO,
TSU

On 2012-09-25 17:06, MirceaKitsune wrote:
>
> This is the story: I occasionally install packages which I happen to
> remove afterward (via Yast - Install Manager). Some of those packages
> add dependencies to the system, but don’t delete them when uninstalled.
> This leads to the system getting cluttered with dependencies that are no
> longer needed, which I imagine will cause it to become slow over time
> and wastes disk space.

No, a not needed dependency is not loaded by the system, it slows nothing. A library is only
loaded when some other library or application requests it.

There is an experimental feature to do a cleaning when a package is removed of its
dependencies, but I have not used it. I don’t know if all flavours of yast have it. Zypper also
has a similar feature. Also, there are some third party scripts that do some cleaning.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On 09/25/2012 05:06 PM, MirceaKitsune wrote:
> cluttered with dependencies that are no
> longer needed, which I imagine will cause it to become slow over time
> and wastes disk space.

several things to think about:
-a package not being used won’t slow down anything…

-most (not all) dependencies will be libraries of cold, which usually
are not terribly huge…

-unlike some operating systems which might have the same library file
installed for 20 or more different applications, linux would have only
one copy on the whole drive and every application needing it would use it

-so, if you delete it today, you might just be putting it back tomorrow

-disk space is cheap (any usually plentiful)

-if you move from one version to the next with a system format and
install (keeping your /home with its data) then all that old unneeded
stuff gets trashed every year or so any way…

so, many (most?) folks just leave the dependencies (why install the same
one again next week when you wanna try something else that needs it?)

but, others do try to keep a tidy pantry, and the easiest safest way i
know is to use YaST Software Management to uninstall, AND each time you
do that do this:
-open YaST > Software Management
-click on “Options” (in the top line menu), select to x mark “Cleanup
when deleting packages”
-seach as normal for the application to delete
-mark package to “Delete”
-resolve dependencies as required
-click Accept

and, the result will be about as clean as can be AND be safe…

ymmv and there are probably other opinions (and maybe facts) like i’m
really not sure if TSU is correct or not on if you build from source the
dependencies might not be known to YaST–i just don’t know, i’ve not
been that deep into it…well, when i install dependencies to support a
local build i always install the dependency via an rpm and use YaST to
do that…so, therefore YaST knows the dependency is installed…OH
but it wouldn’t know your built from source is, so…

oh wait, maybe that is why some people don’t do a straight ‘make
install’ but instead build an rpm and then install it (via YaST i
presume)…

hmmmmmmm…i exceeded my actual knowledge far back up this page–let me
recap:

easiest: give yourself disk space and don’t waste a lot of time cleaning
and dusting (a dependency sitting on the drive won’t impact anything but
disk space) and Have a lot of fun.


dd http://goo.gl/PUjnL
http://tinyurl.com/DD-Caveat http://tinyurl.com/DD-Hardware
http://tinyurl.com/DD-Software

I’d leave the packages where they are, don’t remove them unless you know that a lib or program is causing trouble.

On 2012-09-25 22:06, Knurpht wrote:
>
> I’d leave the packages where they are, don’t remove them unless you know
> that a lib or program is causing trouble.

Cleaning unused packages has one advantage: faster updates. Specially if your network is slow.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Thanks for the clarifications. One reason I thought it might slow down my system is that from my knowledge, the console searches for packages when executing a command (to know if that command exists in one of them), while Yast and other programs might look through installed applications and take longer the more there are. But that’s probably all cached so it will never make a visible difference.

Another reason is once again a Windows habit. In Win a lot of things are added to the registry when installing programs, and even when uninstalling them not everything is removed. Lots of stuff gets permanently cluttered, and after one or two years Windows installations become very slow for this reason. I haven’t done a full Windows reinstall in 3 years, and it takes more than 10 minutes to boot and login on considerably modern hardware (whereas in openSUSE less than 3). The first months after installing Windows were however lightning-fast. From what I’m seeing so far openSUSE doesn’t become slower the more you add to it, which is another thing I love in comparison to Windows. It knows what to load at startup and doesn’t touch anything unless it needs to (nor keeps caches that turn into a mess over the years).

File size was a silly concern, especially since I have a 2TB drive + another 500GB one. Still, I care about keeping everything organized and not having things I don’t need in my system, which is a main reason I want such cleanup.

I found that setting in Yast to clear dependencies on uninstall, which was disabled by default. I think it will do nicely for what I want, so I can consider this resolved (I wonder if Yum has this too). Previously, Yast would delete some dependencies when uninstalling a program, but rarely. Usually just if I installed the package “something” which in turn installed “something-data”, then “something-data” would get removed if uninstalling “something”. But not when installing “something” added a dependency like a SDL library or Python plugin, and uninstalling it wouldn’t uninstall those as well (since nothing else that needed them was installed in the meantime).

On 2012-09-25 23:16, MirceaKitsune wrote:
>
> Thanks for the clarifications. One reason I thought it might slow down
> my system is that from my knowledge, the console searches for packages
> when executing a command (to know if that command exists in one of
> them),

Rather it searches for applications. Applications can not purged automatically when
uninstalling another application. Consider an application as the start of a branch in the tree
of dependencies.

> while Yast and other programs might look through installed
> applications and take longer the more there are.

Yast looks on the rpm database. The longest time yast uses when loading the package manager is
downloading the lists from the repository servers.

> Another reason is once again a Windows habit. In Win a lot of things
> are added to the registry when installing programs, and even when
> uninstalling them not everything is removed. Lots of stuff gets
> permanently cluttered, and after one or two years Windows installations
> become very slow for this reason. I haven’t done a full Windows
> reinstall in 3 years, and it takes more than 10 minutes to boot and
> login on considerably modern hardware (whereas in openSUSE less than 3).
> The first months after installing Windows were however lightning-fast.
> From what I’m seeing so far openSUSE doesn’t become slower the more you
> add to it, which is another thing I love in comparison to Windows. It
> knows what to load at startup and doesn’t touch anything unless it needs
> to (nor keeps caches that turn into a mess over the years).

Well, that is mostly because many Windows applications install an applet in the panel, and that
has to be loaded, and many libraries besides. The registry is a beast on its own… Linux as a
whole doesn’t have one, except perhaps gnome - although gnomists grumble when they hear this
:-p What we have is a zillion configuration files (kde, gnome).

Linux is a slow starter if you add services to boot: databases, email servers, named, apache,
ftp…

> I found that setting in Yast to clear dependencies on uninstall, which
> was disabled by default. I think it will do nicely for what I want, so I
> can consider this resolved (I wonder if Yum has this too). Previously,
> Yast would delete some dependencies when uninstalling a program, but
> rarely. Usually just if I installed the package “something” which in
> turn installed “something-data”, then “something-data” would get removed
> if uninstalling “something”. But not when installing “something” added a
> dependency like a SDL library or Python plugin, and uninstalling it
> wouldn’t uninstall those as well (since nothing else that needed them
> was installed in the meantime).

I never remember to use that option when I uninstall something. It was added recently.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On 09/25/2012 11:16 PM, MirceaKitsune wrote:
>
> Another reason is once again a Windows habit.

there are lots of those which will initially get in the way…like a
lot of new folks set off trying to make Linux do stuff the way they are
used to it being done in Windows–now i know you wouldn’t do that :slight_smile:

well, its not a problem to expect things to go as have been experienced
in the past…but, there is a LOT to unlearn when you get to
Linux…like some folks get here and just demand that they don’t need
to be pushed into using root for admin duties…and, of course they
know that in their past they just logged into windows as Admin, but then
the people here say don’t do that here…

etc.

> I found that setting in Yast to clear dependencies on uninstall, which
> was disabled by default.

and it will be disabled every time you open yast, which is why i wrote:
each time you [uninstall] open YaST > Software Management > Options
“Cleanup when deleting packages”

> But not when installing “something” added a
> dependency like a SDL library or Python plugin, and uninstalling it
> wouldn’t uninstall those as well (since nothing else that needed them
> was installed in the meantime).

as mentioned by tsu2: yast won’t ‘know’ about application dependencies
compiled/installed from source, so if you uninstall application named
‘something’ and all its dependencies, and one of those dependencies is
needed by ‘another-something’ which you installed outside of yast you
can expect that ‘another-something’ will stop working…

hence the reason many here say to just leave all that stuff alone.
(takes a little space, hurts nothing!! break your Windows habit and need
to buy cleanup applications, or search the disk for “orphaned
files”…waste of time [and a little space])

i just told you about the little used YaST cleanup option
because…hmmmm don’t know why, except i usually remember to use it
(and i also do other things that meet my requirements–like i ran 10.3
nearly two years after it past its end of life…AND actually needed to
keep junk down [and move stuff off drive to other media].)


dd http://goo.gl/PUjnL

dd@home.dk: I’ve been learning about the problem users like me have, who after years of Windows come to Linux and expect things to work in a similar way. I don’t complain when they don’t (except when major and silly errors occur) but it’s part of my reflex to expect things to work the same. I’m trying to fix that as I learn the differences. It’s like having lived in a tribe for all your life then being taken to New York and taught how to live like a city person or the other way around :slight_smile:

If the option to “cleanup when deleting packages” should disable itself each time I restart Yast, something odd is happening. I just restarted the computer several times and opening up the Install Manager I still find the setting enabled (which is the behavior I want). It might be an error with your configuration that it won’t stick, since this feels like it’s the normal behavior (or maybe it only happens in 12.1, I have 12.2).

And yes, a Yast application installing dependencies then a program Yast doesn’t know about needing them too is the only real risk with this. But such cases are very rare for me, and if it happens the failing application will print what dependencies it’s missing to the console, so I can usually find them and install them manually.

On 2012-09-26 12:16, MirceaKitsune wrote:
>
> dd@home.dk: I’ve been learning about the problem users like me have, who
> after years of Windows come to Linux and expect things to work in a
> similar way.

Linux is Not Windows

Take it with a bit of humor :slight_smile:

The reverse is also true: for me it is difficult to go back to windows when I need to.

> If the option to “cleanup when deleting packages” should disable itself
> each time I restart Yast, something odd is happening.

It may have changed, the feature sticking on.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

I remember reading that page some time ago. It’s a good explanation and also well written :slight_smile: And yes it’s probably been changed, since I never heard of an error causing a setting to stick in a program when the feature to store it doesn’t exist.

On 09/26/2012 12:16 PM, MirceaKitsune wrote:
>
> If the option to “cleanup when deleting packages” should disable itself
> each time I restart Yast, something odd is happening. I just restarted
> the computer several times

hmmmmm…actually i am running 11.4 so maybe they “fixed it” to once
enabled it stays enabled…

but, you say you “restarted the computer several times” and i said
“every time you open YaST” [with ‘open’ having the meaning of
‘executing’ or ‘starting’ yast from a not-running state]…

so, if you have enabled the cleanup option, and without shutting down
Software Management, clicked through to any of hibernate, sleep or
complete power down shutdown and then bring it back to life/reboot and
click on your still running exactly like it was when you commanded
sleep/off then you have not yet done what i did:

  • close software management
  • open software management…

as said: maybe they fixed it, but maybe not.


dd

Pretty certain it’s always a new instance. I closed and reopened the Install Manager several times, and restarted the computer while it was closed. When I opened it again I was asked for root password, which is only requested once at each login IIRC. I don’t use Sleep or Hibernate either. So I’m sure it sticks.

I think the remember root password (if checked) is only good for 5-10 min not forever after entering the password for a given session.

Ah, that’s why it DOES ask me again sometimes during the same login. But I didn’t know when and why and if there are other triggers. It’s safest that way so I approve.

On Thu, 27 Sep 2012 00:26:01 GMT, gogalthorp
<gogalthorp@no-mx.forums.opensuse.org> wrote:

>
>I think the remember root password (if checked) is only good for 5-10
>min not forever after entering the password for a given session.

The only tool i remember having that behavior is sudo.

?-)

kdesudo has an option to remember for some short period of time. So say you start Yast enter password and box is checked if you quit Yast and then restart it you will not be asked for the password again. But wait 15 min and you will asked