purge-old-kernels deprecated

Ian Bruntlett ian.bruntlett at gmail.com
Sat Jan 7 19:26:07 UTC 2023


Hi,

I found the list of apt commands on this email thread quite interesting.

So I came up with a shell script that I hope follows the advice given on
this thread.

Also, one thing I find necessary in normal use is to use the snap-store
--quit command so that the snap snap-store can be updated. Question: how do
I re-enable the snap-store once the updates have been completed?

*NOTE* largely untested code lies ahead...

#!/usr/bin/env bash
set -e # exit immediately if a command returns a non-zero status
set -x # print a trace of simple commands

apt update # download package information
apt full-upgrade -y # upgrade and remove packages if required
apt autoremove -y
apt autoclean # removes virtually useless files from the cache
apt purge # even more tidying up

# is it ok to do this here? snap-store --quit
snap refresh         # refresh snaps in the system
# how do I restart the snap-store here? By running snap-store?

What do you think? Please don't run this on important systems...

In an ideal world I'd make a script like this runnable from the GUI so that
friends who run Ubuntu Linux but don't like the command line can update
their systems without me having to be physically present.

TIA,


Ian

-- 
-- ACCU - Professionalism in programming - http://www.accu.org
-- My writing - https://sites.google.com/site/ianbruntlett/
-- Free Software page -
https://sites.google.com/site/ianbruntlett/home/free-software
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20230107/75b2b3e8/attachment.html>


More information about the ubuntu-users mailing list