huge zypper cache never cleaned up?
I just noticed that my zypper cache in /var/cache/zypp/ is almost 45 GiB in size on one machine. Now I could clean this myself of course, but I wondered if there is no service that does this automatically. regards
Op maandag 22 februari 2021 13:58:12 CET schreef Maximilian Trummer:
I just noticed that my zypper cache in /var/cache/zypp/ is almost 45 GiB in size on one machine. Now I could clean this myself of course, but I wondered if there is no service that does this automatically.
regards AFAIK that should happen automatically after updating/dupping . But sudo zypper clean should do the job.
-- Gertjan Lettink a.k.a. Knurpht openSUSE Board openSUSE Forums Team
Am Montag, 22. Februar 2021, 14:05:42 CET schrieb Knurpht-openSUSE:
Op maandag 22 februari 2021 13:58:12 CET schreef Maximilian Trummer:
I just noticed that my zypper cache in /var/cache/zypp/ is almost 45 GiB in size on one machine. Now I could clean this myself of course, but I wondered if there is no service that does this automatically.
regards
AFAIK that should happen automatically after updating/dupping . But sudo zypper clean should do the job.
Like I said I can do it myself, but why is it not done automatically? It also seems like machines installed with the server role clean up the cache, while ones installed with a desktop environment don't. The servers each have a few dozen megabytes, and the desktops a few gigabytes.
On Mon, Feb 22, 2021 at 4:10 PM Maximilian Trummer <maximilian@trummer.xyz> wrote:
Am Montag, 22. Februar 2021, 14:05:42 CET schrieb Knurpht-openSUSE:
Op maandag 22 februari 2021 13:58:12 CET schreef Maximilian Trummer:
I just noticed that my zypper cache in /var/cache/zypp/ is almost 45 GiB in size on one machine. Now I could clean this myself of course, but I wondered if there is no service that does this automatically.
regards
AFAIK that should happen automatically after updating/dupping . But sudo zypper clean should do the job.
Like I said I can do it myself, but why is it not done automatically?
It is unless you told zypper not to.
It also seems like machines installed with the server role clean up the cache, while ones installed with a desktop environment don't. The servers each have a few dozen megabytes, and the desktops a few gigabytes.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Content-ID: <alpine.LSU.2.21.2102221641280.5355@Legolas.valinor> El 2021-02-22 a las 14:10 +0100, Maximilian Trummer escribió:
Am Montag, 22. Februar 2021, 14:05:42 CET schrieb Knurpht-openSUSE:
Op maandag 22 februari 2021 13:58:12 CET schreef Maximilian Trummer:
...
Like I said I can do it myself, but why is it not done automatically?
Because you told zypper not to clean. Ie, you one or more repositories configured to "keep downloaded packages" But perhaps you should see below /var/cache/zypp/ to find what subdirectories are bigger. - -- Cheers Carlos E. R. (from openSUSE 15.2 (Legolas)) -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCYDPRChwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVsWIAn3saTCbpGH1vnKtk1O9J oxjQOPv7AKCWNe28feJqDFVqDgw/5DOTMpwhqw== =TgG9 -----END PGP SIGNATURE-----
Am Montag, 22. Februar 2021, 16:43:06 CET schrieb Carlos E. R.:
Content-ID: <alpine.LSU.2.21.2102221641280.5355@Legolas.valinor>
El 2021-02-22 a las 14:10 +0100, Maximilian Trummer escribió:
Am Montag, 22. Februar 2021, 14:05:42 CET schrieb Knurpht-openSUSE:
Op maandag 22 februari 2021 13:58:12 CET schreef Maximilian Trummer: ...
Like I said I can do it myself, but why is it not done automatically?
Because you told zypper not to clean. Ie, you one or more repositories configured to "keep downloaded packages"
But perhaps you should see below /var/cache/zypp/ to find what subdirectories are bigger.
-- Cheers Carlos E. R.
(from openSUSE 15.2 (Legolas))
None of my repos have "keep downloaded packages" checked in yast's repository module, and I don't remember enabling such a setting either.
On Mon, 22 Feb 2021, 18:02:55 +0100, Maximilian Trummer wrote:
Am Montag, 22. Februar 2021, 16:43:06 CET schrieb Carlos E. R.:
Content-ID: <alpine.LSU.2.21.2102221641280.5355@Legolas.valinor>
El 2021-02-22 a las 14:10 +0100, Maximilian Trummer escribió:
Am Montag, 22. Februar 2021, 14:05:42 CET schrieb Knurpht-openSUSE:
Op maandag 22 februari 2021 13:58:12 CET schreef Maximilian Trummer: ...
Like I said I can do it myself, but why is it not done automatically?
Because you told zypper not to clean. Ie, you one or more repositories configured to "keep downloaded packages"
But perhaps you should see below /var/cache/zypp/ to find what subdirectories are bigger.
-- Cheers Carlos E. R.
(from openSUSE 15.2 (Legolas))
None of my repos have "keep downloaded packages" checked in yast's repository module, and I don't remember enabling such a setting either.
You can check by running "grep keeppackages=1 /etc/zypp/repos.d/*o" Cheers. l8er manfred
On 22/02/2021 18.02, Maximilian Trummer wrote:
Am Montag, 22. Februar 2021, 16:43:06 CET schrieb Carlos E. R.:
Content-ID: <alpine.LSU.2.21.2102221641280.5355@Legolas.valinor>
El 2021-02-22 a las 14:10 +0100, Maximilian Trummer escribió:
Am Montag, 22. Februar 2021, 14:05:42 CET schrieb Knurpht-openSUSE:
Op maandag 22 februari 2021 13:58:12 CET schreef Maximilian Trummer: ...
But perhaps you should see below /var/cache/zypp/ to find what subdirectories are bigger.
None of my repos have "keep downloaded packages" checked in yast's repository module, and I don't remember enabling such a setting either.
And the other thing? cer@Legolas:~> du -hsc /var/cache/zypp/* 4.0K /var/cache/zypp/notas 12K /var/cache/zypp/packages 5.0M /var/cache/zypp/raw 7.9M /var/cache/zypp/solv 13M total cer@Legolas:~> -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.2 (Legolas))
Am Montag, 22. Februar 2021, 19:34:53 CET schrieb Carlos E. R.:
And the other thing?
cer@Legolas:~> du -hsc /var/cache/zypp/* 4.0K /var/cache/zypp/notas 12K /var/cache/zypp/packages 5.0M /var/cache/zypp/raw 7.9M /var/cache/zypp/solv 13M total cer@Legolas:~>
$ du -shc /var/cache/zypp/* 45G /var/cache/zypp/packages 0 /var/cache/zypp/pubkeys 53M /var/cache/zypp/raw 63M /var/cache/zypp/solv 45G total So as you can see, the *packages* take up the vast majority of space, I should've been more clear about that in the OP.
On 22/02/2021 19.54, Maximilian Trummer wrote:
Am Montag, 22. Februar 2021, 19:34:53 CET schrieb Carlos E. R.:
And the other thing?
$ du -shc /var/cache/zypp/* 45G /var/cache/zypp/packages 0 /var/cache/zypp/pubkeys 53M /var/cache/zypp/raw 63M /var/cache/zypp/solv 45G total
So as you can see, the *packages* take up the vast majority of space, I should've been more clear about that in the OP.
Well, repeat the operation in that directory. Investigate :-) du -shc /var/cache/zypp/packages/* -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.2 (Legolas))
Am Montag, 22. Februar 2021, 13:58:12 CET schrieb Maximilian Trummer:
I just noticed that my zypper cache in /var/cache/zypp/ is almost 45 GiB in size on one machine. Now I could clean this myself of course, but I wondered if there is no service that does this automatically.
regards I believe I found the culprit: https://forums.opensuse.org/showthread.php/530387-old-RPMs-in-var-cache-zypp...
So apparently when you start an update, don't finish it and then run it again later while a package in question has been updated in the meantime, the stale package doesn't get removed. On Tumbleweed I often download packages in advance so the actual update process is faster afterwards. When a snapshot has known bugs or package conflicts, I sometimes skip the snapshot which would mean that at least some of the packages in the cache are stale by the time the next snapshot rolls around. This also explains why there are hardly any stale packages on my Tumbleweed servers - I don't download packages in advance there because they're on fast connections, and due to the smaller package count on my servers there are also less moving parts and thus reasons to skip a snapshot. I can't help but think that zypper not removing stale packages from the cache automatically isn't very elegant though... Anyway thanks to everyone who tried to help!
On 22/02/2021 20.14, Maximilian Trummer wrote:
Am Montag, 22. Februar 2021, 13:58:12 CET schrieb Maximilian Trummer:
I just noticed that my zypper cache in /var/cache/zypp/ is almost 45 GiB in size on one machine. Now I could clean this myself of course, but I wondered if there is no service that does this automatically.
regards I believe I found the culprit: https://forums.opensuse.org/showthread.php/530387-old-RPMs-in-var-cache-zypp...
So apparently when you start an update, don't finish it and then run it again later while a package in question has been updated in the meantime, the stale package doesn't get removed.
On Tumbleweed I often download packages in advance so the actual update process is faster afterwards. When a snapshot has known bugs or package conflicts, I sometimes skip the snapshot which would mean that at least some of the packages in the cache are stale by the time the next snapshot rolls around. This also explains why there are hardly any stale packages on my Tumbleweed servers - I don't download packages in advance there because they're on fast connections, and due to the smaller package count on my servers there are also less moving parts and thus reasons to skip a snapshot.
I can't help but think that zypper not removing stale packages from the cache automatically isn't very elegant though...
Zypper is not a daemon, it has no way to know that there are other packages from other runs still there, if the name has changed. Seems you have a feature request to do :-) -- Cheers / Saludos, Carlos E. R. (from openSUSE 15.2 (Legolas))
participants (6)
-
Andrei Borzenkov
-
Carlos E. R.
-
Carlos E. R.
-
Knurpht-openSUSE
-
Manfred Hollstein
-
Maximilian Trummer