purge-old-kernels deprecated

Bret Busby bret at busby.net
Thu Jan 5 18:09:13 UTC 2023


On 05/01/2023 18:52, Grizzly via ubuntu-users wrote:
> 05 January 2023  at 8:04, David Fletcher wrote:
> Re: purge-old-kernels deprecated (at least in part)
> 
>> On Thu, 2023-01-05 at 01:46 -0500, Jeffrey Walton wrote:
>>>
>>> How does one use Apt(8) to remove old kernels with a --keep argument?
>>
>> I'm not aware of any keep argument. For a while now I've been using
>>
>> sudo apt autoremove
>>
>> which I believe automatically keeps two kernels. I also use
>>
>> sudo apt autoclean
>>
>> which sometimes deletes some redundant files.
> 
> There is a script (not sure who wrote it)
> 
> rm-kernels
> 
> that clears out old kernels giving you the choice remove the ones you want to
> 
> 
I do not understand why people do not simply, when performing system 
updates/upgrades, apply the sequence repeatedly previously mentioned on 
the mailing list;

apt update
apt full upgrade -y
apt autoremove
apt autoclean

It is simple an effective, and, it takes care of redundant kernel images 
and associated packages, and other superseded and otherwise redundant 
packages.

I preface the set of four commands, with
sudo -i
which acts like the (non-Ubuntu) command
su -root
and I follow the four commands with
exit, so as to avoid inadvertently abusing the superuser mode to 
inadvertently cause system level problems.

..
Bret Busby
Armadale
West Australia
(UTC+0800)
..............




More information about the ubuntu-users mailing list