Hi All,
Can I get rid on any of these? All the non fc38 ones? All of them?
# ls -al /usr/src/kernels total 44 drwxr-xr-x. 11 root root 4096 Aug 26 16:05 . drwxr-xr-x. 5 root root 4096 Jan 18 2023 .. drwxr-xr-x. 23 root root 4096 Dec 10 2022 5.18.10-200.fc36.x86_64 drwxr-xr-x. 24 root root 4096 Jul 6 21:48 6.0.11-300.fc37.x86_64 drwxr-xr-x. 24 root root 4096 Dec 10 2022 6.0.12-200.fc36.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.2.12-200.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.3.12-100.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.3.8-100.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:05 6.4.10-200.fc38.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:05 6.4.11-200.fc38.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:04 6.4.12-200.fc38.x86_64
Many thanks, -T
On 8/28/23 23:35, ToddAndMargo via users wrote:
Can I get rid on any of these? All the non fc38 ones? All of them?
# ls -al /usr/src/kernels total 44 drwxr-xr-x. 11 root root 4096 Aug 26 16:05 . drwxr-xr-x. 5 root root 4096 Jan 18 2023 .. drwxr-xr-x. 23 root root 4096 Dec 10 2022 5.18.10-200.fc36.x86_64 drwxr-xr-x. 24 root root 4096 Jul 6 21:48 6.0.11-300.fc37.x86_64 drwxr-xr-x. 24 root root 4096 Dec 10 2022 6.0.12-200.fc36.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.2.12-200.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.3.12-100.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.3.8-100.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:05 6.4.10-200.fc38.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:05 6.4.11-200.fc38.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:04 6.4.12-200.fc38.x86_64
I assume you installed kernel-devel. You can delete any that aren't owned by installed kernel packages. I'm really curious now how you ended up with so many leftover kernel bits.
On 28 Aug 2023 at 23:35, ToddAndMargo via users wrote:
Date sent: Mon, 28 Aug 2023 23:35:29 -0700 To: Community support for Fedora users users@lists.fedoraproject.org Subject: /usr/src/kernels Send reply to: Community support for Fedora users users@lists.fedoraproject.org From: ToddAndMargo via users users@lists.fedoraproject.org Copies to: ToddAndMargo ToddAndMargo@zoho.com
Hi All,
Can I get rid on any of these? All the non fc38 ones? All of them?
# ls -al /usr/src/kernels total 44 drwxr-xr-x. 11 root root 4096 Aug 26 16:05 . drwxr-xr-x. 5 root root 4096 Jan 18 2023 .. drwxr-xr-x. 23 root root 4096 Dec 10 2022 5.18.10-200.fc36.x86_64 drwxr-xr-x. 24 root root 4096 Jul 6 21:48 6.0.11-300.fc37.x86_64 drwxr-xr-x. 24 root root 4096 Dec 10 2022 6.0.12-200.fc36.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.2.12-200.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.3.12-100.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.3.8-100.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:05 6.4.10-200.fc38.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:05 6.4.11-200.fc38.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:04 6.4.12-200.fc38.x86_64
Had modified my cleanmodules2 to cleanmodule3 to compare directories with kernels in /boot
cat cleanmodules3 #!/bin/bash ls -1 | grep x86_64>x1 y=$(ls -1 /boot/vmlinuz* | grep -v rescue| cut -b15-100) for a in $y; do grep -v $a <x1 >x2; mv x2 x1; done for a in $(cat x1); do echo "$a"; rm ./"$a"/* -f -r; rmdir "$a"; done rm x1
gets a listing of directorys in the /lib/modules or could do in the /usr/src/kernels directory The it sets $y to be the current kernels from /boot Then removes the current ones from listing in file x1 Then removes file and directories that are not those.
My /usr/src/kernels only have the latest 3. In modules directory, I had a special module for a USB wifi card that I had to build since Fedora wasn't seeing the adapter with native ones. But didn't have any left over source directories.
For me running script seems to work in either directory. created an older directory in both and run script from within each directory, and it removed the ones not list in /boot as kernels. But would recommand doing a backup of files before testing.
If someone knows of better way to accomplish the same. Seems there should be a better method, but it seems to work.
Many thanks, -T _______________________________________________ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
+------------------------------------------------------------+ Michael D. Setzer II - Computer Science Instructor (Retired) mailto:mikes@guam.net mailto:msetzerii@gmail.com Guam - Where America's Day Begins G4L Disk Imaging Project maintainer http://sourceforge.net/projects/g4l/ +------------------------------------------------------------+
On 8/29/23 00:15, Samuel Sieb wrote:
On 8/28/23 23:35, ToddAndMargo via users wrote:
Can I get rid on any of these? All the non fc38 ones? All of them?
# ls -al /usr/src/kernels total 44 drwxr-xr-x. 11 root root 4096 Aug 26 16:05 . drwxr-xr-x. 5 root root 4096 Jan 18 2023 .. drwxr-xr-x. 23 root root 4096 Dec 10 2022 5.18.10-200.fc36.x86_64 drwxr-xr-x. 24 root root 4096 Jul 6 21:48 6.0.11-300.fc37.x86_64 drwxr-xr-x. 24 root root 4096 Dec 10 2022 6.0.12-200.fc36.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.2.12-200.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.3.12-100.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Jul 6 21:48 6.3.8-100.fc37.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:05 6.4.10-200.fc38.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:05 6.4.11-200.fc38.x86_64 drwxr-xr-x. 25 root root 4096 Aug 26 16:04 6.4.12-200.fc38.x86_64
I assume you installed kernel-devel.
Ah Ha!
# rpm -qa kernel-devel kernel-devel-6.4.10-200.fc38.x86_64 kernel-devel-6.4.11-200.fc38.x86_64 kernel-devel-6.4.12-200.fc38.x86_64
You can delete any that aren't owned by installed kernel packages. I'm really curious now how you ended up with so many leftover kernel bits.
Maybe it was all the years of usage and I forgot what I did? Other than that I have no clue.
Thank you!
On Tue, 29 Aug 2023 18:17:34 +1000 "Michael D. Setzer II via users" users@lists.fedoraproject.org wrote:
If someone knows of better way to accomplish the same. Seems there should be a better method, but it seems to work.
I don't know if it is better, but if you run rpm -qf [directory in either /lib/modules or /usr/src/kernels] it will tell you the name of the rpm package that owns it, or if there is no owner, [directory name] is not owned by any package. Maybe you can use that in some way to simplify the script.
On 29 Aug 2023 at 8:41, stan wrote:
Date sent: Tue, 29 Aug 2023 08:41:58 -0700 From: stan upaitag@zoho.com To: users@lists.fedoraproject.org Copies to: mikes@guam.net Subject: Re: /usr/src/kernels Organization: zohofree
On Tue, 29 Aug 2023 18:17:34 +1000 "Michael D. Setzer II via users" users@lists.fedoraproject.org wrote:
If someone knows of better way to accomplish the same. Seems there should be a better method, but it seems to work.
I don't know if it is better, but if you run rpm -qf [directory in either /lib/modules or /usr/src/kernels] it will tell you the name of the rpm package that owns it, or if there is no owner, [directory name] is not owned by any package. Maybe you can use that in some way to simplify the script.
Thanks for the quick reply.. Will do that after next kernel update that has the orphaned sub directory. Only happens to me on machines that have the extra custom module that needs to be built for USB wifi adapter. Seems update doesn't handle there directores link to that.
Have modified script a little after running shelldir on script. Latest is: #!/bin/bash find ./*x86_64 -maxdepth 0 >x1 y=$(find /boot/vmlinuz*x86_64 | cut -b15-100) for a in $y; do sed -i "/$a/d" x1; done while read -r line; do echo "$line"; rm -rf ./"$line"/; done <x1 rm x1
It didn't like the ls and grep and recommended read and the sed improved the processing.
Seems to work for me, but don't know all the variations that people might have. So would recommend commenting out the rm line or putting an echo in front to see what it would do first.
Interesting...
+------------------------------------------------------------+ Michael D. Setzer II - Computer Science Instructor (Retired) mailto:mikes@guam.net mailto:msetzerii@gmail.com Guam - Where America's Day Begins G4L Disk Imaging Project maintainer http://sourceforge.net/projects/g4l/ +------------------------------------------------------------+