Welcome pacman cache cleaner

Found something strange today…

image

@manuel ? :sweat_smile:

It is not universal - here’s a screenshot from a minute ago…

01-pcache

I’m using the new iso, all packages updated, and FS BTRFS…

fstab only has sda entries… no nvme or sdb drives were ever mounted in this system…
So I really don’t know what could have happened here…

$ lsblk 
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 223,6G  0 disk 
├─sda1        8:1    0   512M  0 part /boot/efi
├─sda2        8:2    0  78,1G  0 part /run/media/myuser/ext4
├─sda3        8:3    0  19,5G  0 part [SWAP]
└─sda4        8:4    0 125,4G  0 part /var/log
                                      /var/cache
                                      /home
                                      /
sdb           8:16   0 931,5G  0 disk 
└─sdb1        8:17   0 931,5G  0 part 
nvme0n1     259:0    0 465,8G  0 disk 
├─nvme0n1p1 259:1    0    16M  0 part 
├─nvme0n1p2 259:2    0   100M  0 part 
├─nvme0n1p3 259:3    0 465,1G  0 part 
└─nvme0n1p4 259:4    0   518M  0 part 

You found the easter egg surprise!

I think I understood now, it’s showing my NAS drives… they are mounted in fstab, thus it’s showing there in pacman cache cleaner

Checked the file: /usr/bin/paccache-service-manager to understand how it works, and found this in line 76:

txt+="Free space on disk: $df.</b>\n" \
$ df
Sist. Arq.                  Blocos de 1K     Usado Disponível Uso% Montado em
dev                              8138844         0    8138844   0% /dev
run                              8146736      1648    8145088   1% /run
/dev/sda4                      131503104  22653600  108760672  18% /
tmpfs                            8146736    522776    7623960   7% /dev/shm
/dev/sda4                      131503104  22653600  108760672  18% /home
/dev/sda4                      131503104  22653600  108760672  18% /var/cache
/dev/sda4                      131503104  22653600  108760672  18% /var/log
tmpfs                            8146736     13852    8132884   1% /tmp
/dev/sda1                         523244       576     522668   1% /boot/efi
/dev/sda2                       80056892        32   75944476   1% /run/media/myuser/ext4
tmpfs                            1629344        56    1629288   1% /run/user/1000
//mynas/folder1   1870732988 302458820 1568274168  17% /mnt/folder1
//mynas/folder2     1922688292   2258040 1920430252   1% /mnt/folder2
//mynas/folder3     1870732988 302458820 1568274168  17% /mnt/folder3
//mynas/folder4      1870732988 302458820 1568274168  17% /mnt/folder4

Btw, I have two 2TB hard drives in my NAS working as one for redundancy, so it’s only 2TB space, which matches what is showing in the paccache-service-manager

/etc/fstab

# NAS entries
//mynas/folder1 /mnt/folder1 cifs noauto,x-systemd.automount,x-systemd.mount-timeout=30,_netdev,rw,uid=1000,gid=1000,credentials=/path_to_credentials/file,iocharset=utf8,vers=3.0 0 0
//mynas/folder2 /mnt/folder2 cifs noauto,x-systemd.automount,x-systemd.mount-timeout=30,_netdev,rw,uid=1000,gid=1000,credentials=/path_to_credentials/file,iocharset=utf8,vers=3.0 0 0
//mynas/folder3 /mnt/folder3 cifs noauto,x-systemd.automount,x-systemd.mount-timeout=30,_netdev,rw,uid=1000,gid=1000,credentials=/path_to_credentials/file,iocharset=utf8,vers=3.0 0 0
//mynas/folder4 /mnt/folder4 cifs noauto,x-systemd.automount,x-systemd.mount-timeout=30,_netdev,rw,uid=1000,gid=1000,credentials=/path_to_credentials/file,iocharset=utf8,vers=3.0 0 0

I didn’t remove the fstab entries to confirm if this is really what’s happening…

Yes, that is it…

[myuser@eos ~]$ sudo umount /mnt/folder4

image

That’s not very “terminal centric” :stuck_out_tongue_winking_eye:

sudo pacman -S pacman-contrib
sudo systemctl enable --now paccache.timer

You could edit both paccache.timer and paccache.service to set the desired parameters.

Personally, I just run paccache manually and not that periodically. That’s “terminal centric” :wink:

terminal centric, it’s the best place to learn… :slight_smile: learned a little bit today

Since it’s only a cosmetic issue, I’ll just ignore it, the settings are set correctly in the service and timer despite of the fact that it shows the NAS drives there…

paccache.service
[Service]
Type=oneshot
ExecStart=/usr/bin/paccache -rk2

paccache.timer
OnCalendar=weekly

Interesting find!

Could you please show the output of commands (using the mounts that show this issue)

  • /usr/bin/df -h
  • /usr/bin/lsblk -fm

Hopefully that helps me fix it.

Note that the full path in the commands is necessary to guarantee the exactly right commands (no aliases etc.).

Me too.

alias pcd='paccache -dvk 2'
alias pcr='paccache -rvk 2'
alias pcdu='paccache -dvuk 0'
alias pcru='paccache -rvuk 0'

Preview cache packages to be removed first, then blow them away.

I use hooks :upside_down_face:

/etc/pacman.d/hooks/98-clear-paccache.hook

[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Operation = Remove
Target = *

[Action]
Description = Clear pacman cache...
When = PostTransaction
Exec = /usr/bin/paccache -rk2

/etc/pacman.d/hooks/98-clear-paccache-unused.hook

[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Operation = Remove
Target = *

[Action]
Description = Clear pacman unused cache...
When = PostTransaction
Exec = /usr/bin/paccache -ruk0

Nice!
I haven’t been using --dryrun flag before but it’s good to review the packages to be removed.
I might borrow (read steal) your aliases :innocent:

Yeah, me three :slight_smile:

I just never put sudo in my aliases. When I run sudo, I want to be sure I’m running sudo. Typing it out is a small price to pay. I even typed sudo thr  four five times in this post, not that difficult…

Also, for paccache, you don’t need sudo. It’s a script and it already has sudo in it.

Thanks.

It prompts me for a sudo password, so I assumed sudo was required, learned something today.

alias s='sudo '

:sweat_smile:

I really hate typing.

In general, if it prompts you for password on its own, it doesn’t need sudo.

Yeah, makes obvious sense when you actually think about it, rather than error: you cannot perform this operation unless you are root.

Aliases changed.

Hello Manuel, follows the requested output:

$ /usr/bin/df -h
Sist. Arq.      Tam. Usado Disp. Uso% Montado em
dev             7,8G     0  7,8G   0% /dev
run             7,8G  1,7M  7,8G   1% /run
/dev/sda4       126G   23G  103G  18% /
tmpfs           7,8G     0  7,8G   0% /dev/shm
tmpfs           7,8G   16K  7,8G   1% /tmp
/dev/sda4       126G   23G  103G  18% /home
/dev/sda4       126G   23G  103G  18% /var/cache
/dev/sda4       126G   23G  103G  18% /var/log
/dev/sda1       511M  576K  511M   1% /boot/efi
/dev/sda2        77G   32K   73G   1% /run/media/myuser/ext4
tmpfs           1,6G   56K  1,6G   1% /run/user/1000
[myuser@eos ~]$ 
[myuser@eos ~]$ /usr/bin/lsblk -fm
NAME FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS   SIZE OWNER GROUP MODE
sda                                                                                     223,6G root  disk  brw-rw----
├─sda1
│    vfat   FAT32 NO_LABEL
│                       3F6E-428A                             510,4M     0% /boot/efi     512M root  disk  brw-rw----
├─sda2
│    ext4   1.0   ext4  e60ff1d0-35a4-47d3-b722-5bd1409ab0ce   72,4G     0% /run/media/myuser/ext4
│                                                                                        78,1G root  disk  brw-rw----
├─sda3
│    swap   1           0bcda331-2ec8-46d1-b6dc-afafcc0c79b3                [SWAP]       19,5G root  disk  brw-rw----
└─sda4
     btrfs              54471866-fe87-4ed9-897d-9032d888dcc3  102,8G    18% /var/log    125,4G root  disk  brw-rw----
                                                                            /var/cache                     
                                                                            /home                          
                                                                            /                              
sdb                                                                                     931,5G root  disk  brw-rw----
└─sdb1
     ntfs         Data  1836134E36132BEE                                                931,5G root  disk  brw-rw----
nvme0n1
│                                                                                       465,8G root  disk  brw-rw----
├─nvme0n1p1
│                                                                                          16M root  disk  brw-rw----
├─nvme0n1p2
│    vfat   FAT32       687F-F9C6                                                         100M root  disk  brw-rw----
├─nvme0n1p3
│    ntfs               3ECC8AB9CC8A6ACB                                                465,1G root  disk  brw-rw----
└─nvme0n1p4
     ntfs               9694D2CC94D2AE4D                                                  518M root  disk  brw-rw----