Autoclean in xbps
- staryvyr
- Posts: 16
- https://dekodeco.com.pl/producent-mebli-na-wymiar-w-warszawie-nowoczesne-kuchnie/
- Joined: Mon Feb 12, 2024 7:39 am
Autoclean in xbps
Hi,
I am running Linux Void since a couple of months on serveral machines and my /var/cache/xbps folders are becoming more and more crowed.
Is there an option for XBPS to do an autoclean, that can be employed to do something similar like the autoclean option of APT? (i,.e. to remove the xbps from the cache folder for that a newer version is already installed and to keep the xbps files containing the currently installed version?
Bests,
staryvyr
I am running Linux Void since a couple of months on serveral machines and my /var/cache/xbps folders are becoming more and more crowed.
Is there an option for XBPS to do an autoclean, that can be employed to do something similar like the autoclean option of APT? (i,.e. to remove the xbps from the cache folder for that a newer version is already installed and to keep the xbps files containing the currently installed version?
Bests,
staryvyr
- incident
- Posts: 31
- Joined: Tue Oct 24, 2023 7:29 am
- Location: Germany
Re: Autoclean in xbps
staryvyr wrote: Mon Feb 12, 2024 7:58 am Is there an option for XBPS to do an autoclean, that can be employed to do something similar like the autoclean option of APT?
Found at this source.// Cleaning package cache
# xbps-remove -yO
// Removing orphaned packages
# xbps-remove -yo
// Purging old kernels...
# vkpurge rm all
Best regards.
- staryvyr
- Posts: 16
- Joined: Mon Feb 12, 2024 7:39 am
Re: Autoclean in xbps
Thanks a lot!incident wrote: Mon Feb 12, 2024 8:26 am
// Cleaning package cache
# xbps-remove -yO
// Removing orphaned packages
# xbps-remove -yo
// Purging old kernels...
# vkpurge rm all
Found at this source.
Best regards.
But if I not want to clean the whole cache, is there any option to clean only these xbps-files that are assigned to older versions of an installed package -- i.e. I want to keep the xbps-files of of the current versions???
- colin
- Posts: 110
- Joined: Sun Jan 21, 2024 4:05 am
- Location: Germany
Re: Autoclean in xbps
hey staryvyr ,
you might take a look at the manual https://man.voidlinux.org/xbps-remove.1
the option -O removes obsolete packages
you might take a look at the manual https://man.voidlinux.org/xbps-remove.1
the option -O removes obsolete packages
- staryvyr
- Posts: 16
- Joined: Mon Feb 12, 2024 7:39 am
Re: Autoclean in xbps
Oh, I read at first something else in the man page, my fault. Thank you both again!
- incident
- Posts: 31
- Joined: Tue Oct 24, 2023 7:29 am
- Location: Germany
Re: Autoclean in xbps
staryvyr wrote: Mon Feb 12, 2024 9:07 am But if I not want to clean the whole cache, is there any option to clean only these xbps-files that are assigned to older versions of an installed package -- i.e. I want to keep the xbps-files of of the current versions???
andxbps-remove -O removes packages from cache which have a newer version available in remote repositories. It doesn't remove uninstalled up to date packages because that's how cache is supposed to work.
That's what I found there.xbps-remove -o uninstalls orphaned packages, it has nothing to do with the cache
Is that what you're looking for?
- incident
- Posts: 31
- Joined: Tue Oct 24, 2023 7:29 am
- Location: Germany
Re: Autoclean in xbps
Oh, @colin was faster! 
- colin
- Posts: 110
- Joined: Sun Jan 21, 2024 4:05 am
- Location: Germany
Re: Autoclean in xbps
staryvyr wrote: Mon Feb 12, 2024 9:23 am Oh, I read at first something else in the man page, my fault. Thank you both again!
you may join the german section ...
- incident
- Posts: 31
- Joined: Tue Oct 24, 2023 7:29 am
- Location: Germany
Re: Autoclean in xbps
Me toostaryvyr wrote: Mon Feb 12, 2024 9:23 am Oh, I read at first something else in the man page, my fault. Thank you both again!
- staryvyr
- Posts: 16
- Joined: Mon Feb 12, 2024 7:39 am
Re: Autoclean in xbps
I just was to stupid to read correcty
So thank you, @incident and @colin!
-
pid1
- Site Admin
- Posts: 277
- Joined: Sun Nov 21, 2021 2:50 am
- Location: USA
Re: Autoclean in xbps
xbps-remove -O, as recommended above, would be the ideal way to clean the XBPS cache of old, no-longer installed, or outdated package files. Use caution as you may encounter a situation where you wish to install a previous version of a package after an undocumented change - especially when it comes to network or GUI related packages.
Additionally, you can consider using a tmpfs filesytem for /var/cache/xbps so all of the package files are stored solely in a volatile tmpfs - cleared on each reboot. I use this method on my desktops and servers, however let my laptop store the files normally for events where I need to revert to a package and WiFi internet is not available or a problem.
/etc/fstab file:
Commands:
Now all package files will be downloaded to virtual memory (RAM/swap) and will be cleared upon reboot. This is not recommended on low memory systems.
Additionally, you can consider using a tmpfs filesytem for /var/cache/xbps so all of the package files are stored solely in a volatile tmpfs - cleared on each reboot. I use this method on my desktops and servers, however let my laptop store the files normally for events where I need to revert to a package and WiFi internet is not available or a problem.
/etc/fstab file:
Code: Select all
tmpfs /var/cache/xbps tmpfs mode=0755 0 0Code: Select all
rm -rf /var/cache/xbps
mkdir /var/cache/xbps
chmod 000 /var/cache/xbps
mount /var/cache/xbpsLinux/BSD since 2001. Void Linux+KDE/Plasma since 2015. Windows? Not even in a virtual machine 
- staryvyr
- Posts: 16
- Joined: Mon Feb 12, 2024 7:39 am
Re: Autoclean in xbps
Thanks @pid1 also for these suggestions that I am going to consider.
- Pullockaran
- Posts: 9
- Joined: Tue May 21, 2024 11:22 am
- Location: Kochi, Bhaarath (India)
Re: Autoclean in xbps
Namaskaram pid1, thank you very much for the script and the commands. Works perfectly for me. Wish I had chanced upon this earlier. Keeps Void really trim and fit, without an iota of bloat. After installing all the programmes I use, the space used by Void is 3.7GiB or (4,002,107,324 bytes) as measured by Thunar. Namaskaram.