clean out old kernel versions?
Colin Law
clanlaw at gmail.com
Sun Mar 7 17:06:30 UTC 2021
On Sun, 7 Mar 2021 at 16:28, Bret Busby <bret.busby at gmail.com> wrote:
>
> On 07/03/2021, Colin Law <clanlaw at gmail.com> wrote:
> > On Sun, 7 Mar 2021 at 07:10, Bret Busby <bret.busby at gmail.com> wrote:
> >>
> >> On 07/03/2021, Dave Stevens <geek at uniserve.com> wrote:
> >> > Linux user-Satellite-A100 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18
> >> > 18:34:49 UTC 2016 i686 i686 i686 GNU/Linux
> >> >
> >> > cat /etc/issue
> >> > Linux Mint 18 Sarah \n \l
> >> >
> >> > --------------
> >> >
> >> >
> >> > /boot has 440 files in it, almost all of which are old kernel entries.
> >> > Is there a simple way to get rid of all but the most recent few (2 or
> >> > 3)?
> >> >
> >> > I could find a use for that 4.4 GB of disk space.
> >> >
> >> > D
> >> >
> >>
> >>
> >> As has been previously mentioned on the list, try running the
> >> following; initially, and, whenever you perform a system update.
> >>
> >> sudo apt-get -y update && sudo apt-get -y dist-upgrade && sudo apt-get
> >> -y autoremove && sudo apt-get -y autoclean
> >
> > While that set of commands is certainly useful, I think that only the
> > autoremove command will help to answer the question here. I don't
> > think any of the others will affect /boot.
> >
> > Colin
> >
>
>
> Whilst I accept that I am not as knowledgeable as some others on this
> list, especially about the combination command, I believe that, for
> the original poster to run that combination command (or, apparently
> better, the apt, rather than the apt-get version, the apt version
> having been posted by me, in a revised and later version of the post
> to which the response from Colin, is above), initially, and, for
> future system updates, will likely both deal with the current problem,
> and, prevent a recurrence of the current problem.
>
> But, the freedom to choose, should be a right.
I wasn't saying he shouldn't run the commands, I was just pointing
out, in case there was confusion, that the only bit of it that
addressed the question asked is the autoremove command.
Personally I never use -y, I like to see what is going to happen. In
addition I never remove kernel versions until I have rebooted after a
kernel update, in case there is a problem with he new kernel that
stops it booting. Provided it has not been removed one can go back to
the previous one.
There isn't actually anything wrong with using apt-get except that it
is the old version and apt is simpler to use in a number of ways. At
some point apt-get may get deprecated, but not for a very long time I
think. It would break a huge number of scripts, even though there has
long been a warning not to use it in scripts.
Colin
More information about the ubuntu-users
mailing list