Sunday, October 30, 2022

[SOLUSI] Gagal Update Linux Di "Update Manager" karena partisi boot penuh

 Cek di terminal :  df -h

akan tampil ini : 100% /boot

Saya pernah baca, lebih jangan memperbesar ukuran partisi boot ini.


Saya coba solusi yang ada di : Berhasil

https://forums.linuxmint.com/viewtopic.php?t=297676

------------

Re: Help, my BOOT partition is full


Post by gm10 » Fri Jul 12, 2019 8:07 am

To increase the boot partition, you'd have to decrease another partition in size. Assuming that your other partition is an encrypted container (disk encryption should be the only reason for the installer to create a boot partition), that's not entirely trivial to do, see https://help.ubuntu.com/community/Resiz ... Partitions.


I'd say first try to make some room in the boot partition by removing old kernels. Either do that via Update Manager > View > Linux kernels or copy & paste the followin script into a terminal window and press Enter to run it and remove all but your current kernel:


Code: Select all


dpkg-query -Wf'${Version}\n' 'linux-image-[^gl]*'|sort -u|sed "/^$/d;s/\~[^~]*$//;s/\.[^.]*$//;/$(uname -r|sed 's/-generic\|-lowlatency//')/d;s/.*/linux-*-&*/"|tr '\n' ' '|xargs -r sudo apt-get remove --purge -y


If either of those fail, your boot partition is too full, only in that case run these commands:


Code: Select all


dpkg-query -W -f '${Version}\n' 'linux-image-[^gl]*'|sort -u|sed -e "/^$/d;s/\~[^~]*$//;s/\.[^.]*$//;/$(uname -r|sed s/-generic//)/d;s/.*/sudo rm -rfv \/boot\/*-&-*/"|source /dev/stdin

sudo apt-get install -f -y

sudo apt-get autoremove --purge -y


If the last line produces errors, do post them, otherwise you'll be all set then - just make sure to remove old kernels once in a while to prevent your boot partition from filling up again.


Meskipun muncul pesan error, saya teruskan sampai baris terakhir. dan berhasil.

Sayakembali update manager, dan melakukan update berhasil.

------------



Ada solusi yang lebih baru, tetapi saya belum coba.  :

https://forums.linuxmint.com/viewtopic.php?t=377968


Tuesday, October 4, 2022

Untuk clear log dan lain" di CyberPanel [GUIDE] Logs Cleaner for CyberPanel

https://community.cyberpanel.net/t/guide-logs-cleaner-for-cyberpanel/37324

I recently had a serious problem with the logs, the switchLSWSStatus file weighed over 700GB. Therefore I decided to share my script with you to always keep the server logs clean.

FOLLOW MY GUIDE

sudo -i
cd /root/
nano logscleaner.sh

Paste this code:

#!/bin/bash
# Software Logs Cleaner v1.0alpha, use only for test
# Powered by Nicholas Sciortino

# clear all logs of CP
rm -rf /usr/local/lsws/logs/*

# clear OpenLiteSpeed cache folder
rm -rf /usr/local/lsws/cachedata

# remove old CyberPanel versions
rm -rf /usr/local/*.tar.gz

# clear other logs
rm -f /home/cyberpanel/switchLSWSStatus
rm -f /home/cyberpanel/stderr.log
rm -f /home/cyberpanel/error-logs.txt

After you have to give permissions to the executable file

chmod +x logscleaner.sh

Now you can run it manually with the command, after you have cleared all logs and freed up a lot of memory ^^

sh logscleaner.sh

We can also automate cleanup using a cron

crontab -e

At the end of the file add

0 0 * * 0 sh /root/logscleaner.sh

Once a week the script will be executed which will delete all the logs