You are not logged in.

#1 2021-07-07 14:04:13

Cvlc
Member
Registered: 2020-03-26
Posts: 295

[SOLVED] Modify paccache.timer to only keep one version of packages

Hi

I'd like to modify paccache.timer so as to only keep one version on packages in the cache instead of 3. (default)
I tried :

$ sudo nano /usr/lib/systemd/system/paccache.service
------------------------------------------------
ExecStart=/usr/bin/paccache -rk1

but this gets reverted after a while to the default paccache -r command

Any idea how I can make this permanent ?

Last edited by Cvlc (2021-08-18 14:15:33)

Offline

#2 2021-07-07 14:31:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 66,750

Re: [SOLVED] Modify paccache.timer to only keep one version of packages

https://wiki.archlinux.org/title/System … ided_units
Also (unrelated here) "man sudoedit"

Offline

#3 2021-08-18 14:03:24

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: [SOLVED] Modify paccache.timer to only keep one version of packages

Hi

Thanks very much, exactly what I was looking for !

for anyone looking for a quick answer to the same question :

$ sudo systemctl edit paccache.service 

and add

[Service]
ExecStart=
ExecStart=/usr/bin/paccache -rk1

Have good day !

Offline

#4 2022-01-02 18:54:05

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: [SOLVED] Modify paccache.timer to only keep one version of packages

Hi

Digging up this old question of mine, I'm trying to modify the service again so that it also cleans the cache from uninstalled packages (# paccache -ruk0)

I can't get this to work, I've tried

[Service]
ExecStart=
ExecStart=/usr/bin/paccache -rk1 && /usr/bin/paccache -ruk0

which throws no error, but doesn't run the second command, and

[Service]
ExecStart=
ExecStart=/usr/bin/paccache -rk1
ExecStart=/usr/bin/paccache -ruk0

which throws an error..

do I need to make a script with those two commands first, and link to that ? seems like there should be a nicer way to do it

Thanks for your help and happy new year !

Offline

#5 2022-01-02 20:20:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,391
Website

Re: [SOLVED] Modify paccache.timer to only keep one version of packages

Systemd service files are not shell scripts nor interpreted by a shell, so && would not work.  Instead:

man system.service wrote:

COMMAND LINES
       This section describes command line parsing and variable and specifier substitutions for ExecStart=, ExecStartPre=, ExecStartPost=, ExecReload=, ExecStop=, and ExecStopPost= options.

       Multiple command lines may be concatenated in a single directive by separating them with semicolons (these semicolons must be passed as separate words).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2022-01-03 00:23:33

Cvlc
Member
Registered: 2020-03-26
Posts: 295

Re: [SOLVED] Modify paccache.timer to only keep one version of packages

Slapped my own hand for not reading the docs... damn wiki being too good you end up forgetting there's more smile

Thanks !

$ sudo systemctl edit paccache

### Editing /etc/systemd/system/paccache.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Service]
ExecStart=
ExecStart=/usr/bin/paccache -rk1 ; /usr/bin/paccache -ruk0

### Lines below this comment will be discarded

### /usr/lib/systemd/system/paccache.service
# [Unit]
# Description=Remove unused cached package files
#
# [Service]
# Type=oneshot
# ExecStart=/usr/bin/paccache -r

Last edited by Cvlc (2022-01-03 00:30:46)

Offline

Board footer

Powered by FluxBB