2022-11-06 21:27:50 +01:00
|
|
|
#!/bin/bash
|
2022-12-12 13:57:02 +01:00
|
|
|
|
|
|
|
# Test du user ROOT
|
|
|
|
if [ "$EUID" -ne 0 ]
|
|
|
|
then echo "Please run as root"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-11-06 21:27:50 +01:00
|
|
|
# Suppression des kernels non utilisé
|
|
|
|
echo -e "\n [INFO] Kernel installé mais plus utilisé"
|
|
|
|
dpkg --list 'linux-image*' | grep ^ii | awk '{print $2}' | sort | egrep "[0-9]-generic" | head -n 3 | tr '\n' ' ' > list-kernel
|
|
|
|
echo -e "\n"
|
|
|
|
|
|
|
|
apt update
|
|
|
|
apt -y upgrade
|
|
|
|
apt -y autoremove
|
|
|
|
do-release-upgrade
|
|
|
|
|