-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix_boot_disk.sh
More file actions
22 lines (21 loc) · 795 Bytes
/
fix_boot_disk.sh
File metadata and controls
22 lines (21 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
!/bin/bash
# Debian / Ubuntu Linux Delete Old Kernel Images Command
rm -rf fix_boot_disk.sh
echo "#!/bin/bash" > fix_boot_disk.sh
echo "kill -9 \$(ps -ef | grep apt-get | grep -v grep |awk '{print $2}') > /dev/null 2>&1" >> fix_boot_disk.sh
echo "sudo dpkg --configure -a" >>fix_boot_disk.sh
echo -n "apt-get remove " >> fix_boot_disk.sh
dpkg --get-selections | \
grep 'linux-image*' | \
awk '{print $1}' | \
egrep -v "linux-image-$(uname -r)|linux-image-generic" | \
while read n
do
echo -n "$n " >> fix_boot_disk.sh
done
echo "" >> fix_boot_disk.sh
echo "echo \"done !!!\"" >> fix_boot_disk.sh
echo "df -h" >> fix_boot_disk.sh
chmod 755 fix_boot_disk.sh
echo "please run fix_boot_disk.sh script. you are welcome! "
echo " Kun!"