1
0
Fork 0

update presentation

This commit is contained in:
VirtuBox 2018-09-13 17:19:56 +02:00
parent beefe4eb55
commit de9881939c
1 changed files with 21 additions and 8 deletions

View File

@ -66,23 +66,30 @@ MAINTENANCE_APT() {
CEND="${CSI}0m"
CRED="${CSI}1;31m"
CGREEN="${CSI}1;32m"
echo ""
echo -ne ' APT UPDATE [..]\r'
echo "#############################################"
echo -ne ' APT UPDATE '
echo "#############################################"
## Updates package lists
sudo apt update
echo -ne " APT UPDATE [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
echo -ne ' APT FULL-UPGRADE [..]\r'
echo "#############################################"
echo -ne ' APT FULL-UPGRADE '
echo "#############################################"
## Updates packages and libraries
sudo apt full-upgrade -y
echo -ne " APT FULL-UPGRADE [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
echo -ne ' APT-GET AUTOREMOVE [..]\r'
echo "#############################################"
echo -ne ' APT-GET AUTOREMOVE '
echo "#############################################"
## Removes unneeded packages
sudo apt-get -y --purge autoremove
echo -ne " APT-GET AUTOREMOVE [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
echo -ne ' DEBORPHAN [..]\r'
echo "#############################################"
echo -ne ' DEBORPHAN '
echo "#############################################"
## Removes unused config files
if [ ! -x /usr/bin/deborphan ]; then
apt install deborphan -y
@ -90,7 +97,9 @@ MAINTENANCE_APT() {
sudo deborphan -n --find-config | xargs sudo apt-get -y --purge autoremove
echo -ne " DEBORPHAN [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
echo -ne ' APT AUTOCLEAN [..]\r'
echo "#############################################"
echo -ne ' APT AUTOCLEAN '
echo "#############################################"
## Removes package files that can no longer be downloaded and everything except
# the lock file in /var/cache/apt/archives, including directories.
sudo apt-get -y autoclean
@ -101,13 +110,17 @@ MAINTENANCE_APT() {
## clean packages in deinstall state
DEINSTALLED=$(sudo dpkg --get-selections | grep deinstall | cut -f1)
if [ ! -z "$DEINSTALLED" ]; then
echo -ne ' CLEAN DEINSTALL PACKAGES [..]\r'
echo "#############################################"
echo -ne ' CLEAN DEINSTALL PACKAGES '
echo "#############################################"
sudo dpkg --get-selections | grep deinstall | cut -f1 | xargs dpkg --purge
echo -ne " CLEAN DEINSTALL PACKAGES [${CGREEN}OK${CEND}]\\r"
echo -ne '\n'
fi
if [ -x /usr/bin/docker ]; then
echo -ne ' DOCKER CLEANUP [..]\r'
echo "#############################################"
echo -ne ' DOCKER CLEANUP '
echo "#############################################"
list_images=$(docker images --filter "dangling=true" -q --no-trunc)
list_volumes=$(docker volume ls -qf dangling=true)
if [ ! -z "$list_images" ]; then