Kernels galore and no NVIDIA driver in sight
Keith
keithw at caramail.com
Mon Dec 23 01:34:25 UTC 2024
On 12/22/24 2:58 PM, Little Girl wrote:
> Hey there,
>
> Keith via ubuntu-users wrote:
>> On 12/21/24 12:14 PM, Little Girl wrote:
>
>>>> $ sudo apt -s purge ~c
>>>
>>> Ouch. That gave output of 363 lines that I've attached to this
>>> message as a text file.
>>
>> Oof, that's a bit unexpected unless you've never run autoremove with
>> the "--purge" option before.
>
> I haven't. My routine is:
>
> 1. Fetch updates:
> sudo apt update && sudo apt full-upgrade && snap refresh
>
> 2. Reboot if prompted.
>
> 3. Tidy up:
> sudo apt update && sudo apt autoremove && sudo apt clean && sudo apt
> purge
Not really necessary to run update at this point since you've already
performed an upgrade action in the first step. And if you change
autoremove to either "autoremove --purge" or just "autopurge", you won't
need to run "apt purge" by itself. In fact purge by itself doesn't do
anything without something to act on.
If you wanted you could combine upgrade and autoremove into one command
$ sudo apt full-upgrade --autoremove --purge *
*autopurge isn't accepted as a valid option with the upgrade action so
you have to also include "--purge" unless you add the apt config option
listed at the bottom of the page.
And if you put the following line in the example 90aptprefs.conf I
mentioned previously, you won't have to include "apt clean" at all as
apt won't keep any downloaded packages after installation.
apt::keep-downloaded-packages "0";
Or you could change the max age at which the systemd
apt-daily-upgrade.service cleans packages out of the apt cache by
editing /etc/apt/apt.conf.d/20archive. Default is 30 days. If you change
MaxAge to 1 (0 disables checking) and MinAge to 0, the cache will
automatically be cleaned every 1-2 days.
>
>> That's fine. I just wanted to confirm the nvidia module was the 535
>> version loaded with the 5.15.0-130-generic kernel. So the your
>> graphic driver is good with the current kernel.
>
> Interesting. Why is that? I haven't gotten an NVIDIA driver since
> before these three latest kernels. Does the current NVIDIA driver get
> built with new kernels automatically when the kernel is updated?
Yes, the nvidia-dkms-535 package, which is a dependency of the
nvidia-driver-535 package, will automatically build a new nvidia kernel
module whenever the kernel and kernel-headers packages are upgraded.
>
>> I don't believe that you'll harm anything the way it looks now, but
>> autoremove doesn't remove config files unless you add the "--purge"
>> option (autopurge is just a shortcut for that), so you'll have a
>> bunch entries with "rc" still left in your "dpkg -l" output.
>
> Okay, that's a relief that it shouldn't do any harm. I'll be curious
> how much space this buys me, too.
I wouldn't think alot since most config files are typically small in size.
>
>> After you run "apt autoremove (or autopurge)" I would still run
>> "apt purge ~c" afterwards to remove any residual config files.
>
> Okay, good to know. So, does this look like a good new routine that
> would keep things more tidy from now on?
>
> 1. Fetch updates:
> sudo apt update && sudo apt full-upgrade && snap refresh
>
> 2. Reboot if prompted.
>
> 3. Tidy up:
> sudo apt update && sudo apt autoremove --purge && sudo apt clean &&
> sudo apt purge && sudo apt purge ~c
>
I would go ahead run "sudo apt purge ~c" first to get rid of residual
config files that are on the system now. It shouldn't be necessary to
run it after this one time if you start using "autoremove --purge"
$ sudo apt update && sudo apt full-upgrade --autoremove --purge
And if you also wanted, you could make removing and autoremoving action
to default to a purge and autopurge action by putting
apt::get::purge=1;
in that 90aptprefs.conf file referred to earlier.
thus if you use the changes I've included here, you should only have to this
$ sudo apt update && sudo apt upgrade --autoremove
--
Keith
More information about the ubuntu-users
mailing list