before upgrading from F42 to F43 I checked my /var partition and recognized that 2 directories on /var use about 5 GB in total:
/var/cache/akmods/nvidia
/var/cache/akmods/nvidia-open (uses 4.3 GB)
There is a lot of entries for old nvidia dreivers. Any idea how I could remove some files below /var/cache/akmods/ ? Manually delete the ones of the old driver versions?
Usually, I simply delete anything in directories with the name âcacheâ if I feel like it. Any well written software should always fall back to downloading the original data again if there is a cache miss.
no, I did not recognize your last post in the other thread . After Joeâs âIâd suggest making a new thread for that since thatâs a new issue.â I opened this one.
I will check your hints in the other post later today and will keep you informed.
jojo@waldstadion:~$ sudo dnf5 clean all
[sudo] password for jojo:
Removed 149 files, 128 directories (total of 203 MiB). 0 errors occurred.
jojo@waldstadion:~$ sudo dnf4 clean all
60 files removed
The commands above not clean anything in /var/cache/akmods. So I now deleted all files below /var/cache/akmods except those for the currently nvidia driver. That helpedâŠnow /var has 11GB unused, should be sufficient to upgrade from F42 to F42.
Why should it? dnf has no business with akmods. Itâs the location used by akmods to build the kernel modules. You can remove the nvidia and nvidia-open directories. Akmods will recreate the dir when it builds new kernel modules.
EDIT: the modules are build in /tmp/ but the created rpm and build logfiles are saved in /var/cache/akmods/<modulename>
it does not harm, but it provides no advantage to akmod-nvidia, unless you need to apply custom patches to the kernel module sources.
If you have installed only akmod-nvidia, then the nvidia-open directory is of no use anyway. You may have had nvidia-open installed at some point.
In the early days of nvidia-open it was necessary to have different paths of distribution which resulted in conflicts of files/packages with different versioning and ownership. This is why nvidia-open resides in rpmfusion-nonfree-tainted so users can install one or the other at their choice.
Today the full features of nvidia open are included in akmod-nvidia and the system is smart enough to check what gpu is installed so it builds either the proprietary driver for those not supported by the open version or the open version for everything it does support. This has been the case since about the 570 driver if I recall properly.
It is not necessary to have nvidia-open as a separate packaging chain any more.
akmod-nvidia bundles the kernel modules and source released by nvidia in the run installers! Since 515.x, this also includes the so called open kernel modules. But most of those are pre-compiled and only the source files interacting directly with the kernel are included. This leads to shorter compile time compared to the akmod-nvidia-open package.
You got that error from misspelling, the command is âakmodsâ not âakmodâ.
But even with âakmodsâ there is no such argument --from-init so Iâm not sure what youâre doing there.
UPDATE editâ I looked in the âakmodsâ script and there is a ââfrom-initâ option in the code itâs just not shown when you run âakmods --helpâ. So my âno such optionâ statement above was wrong. I was just saying there was no such option because I didnât see it from the âakmods --helpâ output.
Which is BAD. In fact the --help doesnât show several different valid options in this list
The akmods.service, which would normally run at boot time, would normally remove the files from /var/cache/akmods which are no longer related to any installed kernels.
I would expect the dnf removes would have done cleanup already. I would expect the dnf removes would have done cleanup already.
dnf doesnât do anything to /var/cache/akmods/* area other than possibly reading the newly built kmod-<name>-<kversion>-<packageversion> rpm files from there to install them after akmods builds them. As far as âdnf removeâ, dnf is clueless about the /var/cache/akmods/ area.
Could you pls provide output of ls -l /var/cache/akmods/nvidia-open ?
I am very interested why there is such a huge difference in space used. Iâd expect the resulting and cached rpm files to be similar in size compared to the cached files in /var/cache/akmods/nvidia.
So it seems that something else is stored there as well, the object files?
akmods has a cleanup_cachedir function that supposed to run during a system start. But it looks like itâs not doing its job. I have rpms that are ca. 3 months old.
cleanup_cachedir ()
{
local excluded
excluded=$(find /boot -name 'vmlinuz-*' '!' -name '*rescue*' 2>/dev/null | sed 's/.*vmlinuz-//')
local -a file_list
mapfile -t file_list < <(find /var/cache/akmods -mindepth 3 2>/dev/null | grep -Fv -f <(echo "${excluded}"))
for one_file in "${file_list[@]}"; do
if grep -q ".*\.rpm$" <<< "${one_file}" ; then
if ! rpm -q "$(basename "${one_file%.rpm}")" >/dev/null ; then
rm -f "${one_file}"
fi
else
rm -f "${one_file}"
fi
done
}
[deleted]
# first parse command line options
while [ "${1}" ] ; do
case "${1}" in
[deleted]
--from-init)
# just in case: remove stale lockfile if it exists:
rm -f /var/cache/akmods/.lockfile
# Clean old logs and rpm files from no more installed kmod
# packages.
cleanup_cachedir
# akmods --from-init only operates on current kernel
kernels="$(uname -r)"
shift
;;