0

Greetings and salutations

Question: I'm new to Linux and want to clean up my first ubuntu server which currently hosting a wordpress website, however have encounter error as I didn't clean up as I went along as I didn't know so is there anyway I can clean up this server to free up boot disk space and once again be able to upgrade, etc. thank you in advance

Server Access: Putty, Webmin, Direct Virtual Server Connection, Bash via Powershell

Tried Solutions: I tried the autoremove - f command and the output below is want I get

Command output:

kg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-130- sudo apt autoremove -f
[sudo] password for (sudo admin account name, which I entered pw)
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  linux-image-4.4.0-130-generic
Suggested packages:
dutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.4.0-130-generic
0 upgraded, 1 newly installed, 0 to remove and 71 not upgraded.
10 not fully installed or removed.
Need to get 0 B/22.1 MB of archives.
After this operation, 68.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 202908 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-130-generic_4.4.0-130.156_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-generic
Done.
Unpacking linux-image-4.4.0-130-generic (4.4.0-130.156) ...
dpgeneric_4.4.0-130.156_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-4.4.0-130-generic' to '/boot/vmlinuz-4.4.0-130-generic.dpkg-new': failed to write (No space                                         left on device)

**No apport report written because the error message indicates a disk full error**
                                                                   dpkg-deb: error: subprocess paste was killed by signal Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.4.0-130-generic_4.4.0-130.156_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Tried apt-get this time (the first was apt only)

(admin account name @server name):~$ sudo apt-get autoremove -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  linux-image-4.4.0-130-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.4.0-130-generic
0 upgraded, 1 newly installed, 0 to remove and 71 not upgraded.
10 not fully installed or removed.
Need to get 0 B/22.1 MB of archives.
After this operation, 68.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 202908 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-130-generic_4.4.0-130.156_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-generic
Done.
Unpacking linux-image-4.4.0-130-generic (4.4.0-130.156) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-130-generic_4.4.0-130.156_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-4.4.0-130-generic' to '/boot/vmlinuz-4.4.0-130-generic.dpkg-new': failed to write (No space                                         left on device)
**No apport report written because the error message indicates a disk full error**
                                                                   d**pkg-deb: error: subprocess paste was killed by signal (Brokn pipe)**

Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-130-generic /boot/vmlinuz-4.4.0-130-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.4.0-130-generic_4.4.0-130.156_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The above is the output from running the autoremove command, any suggestion on further things to try

output from ls -l /boot

ls -l /bs report

Many thanks

Moved up from comment, so it could be formatted:

uname -r
4.4.0-127-generic


total 465226 
-rw-r--r-- 1 root root 1249685 Jan 19 2018 abi-4.4.0-112-generic 
-rw-r--r-- 1 root root 1250569 Feb 13 2018 abi-4.4.0-116-generic 
-rw-r--r-- 1 root root 1251075 Apr 2 19:05 abi-4.4.0-119-generic 
-rw-r--r-- 1 root root 1251054 Apr 13 17:21 abi-4.4.0-121-generic
# small sample – CorpCaleCeo 8 hours ago

UPDATE: after trying to remove using several commands his is the output which explain it the best and as you can see I cannot remove any of them

Cannot remove kernel due to following reason

  • have your tried sudo apt-get autoremove without -f? -f stands for fix broken and not force. – Kev Inski Aug 14 '18 at 13:51
  • I'll try without the f but I assume the same result as I have no space hence why I highlighted it in bold, thanks. – CorpCaleCeo Aug 14 '18 at 17:32
  • yes I used the command twice hence the duplicate and thanks for informing me what the -f stands for, much appciated – CorpCaleCeo Aug 14 '18 at 17:33
  • sudo apt-get autoremove Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: linux-image-extra-4.4.0-130-generic : Depends: linux-image-4.4.0-130-generic but it is not installed linux-signed-image-4.4.0-130-generic : Depends: linux-image-4.4.0-130-generic (= 4.4.0-130.156) but it is not installed E: Unmet dependencies. Try using -f. – CorpCaleCeo Aug 14 '18 at 17:34
  • the above is the result without the -f in the command – CorpCaleCeo Aug 14 '18 at 17:35

2 Answers2

0

You must free some disk space. My method will render an old kernel unbootable, but it is an old kernel.

Do uname -r to get the release version of your current kernel. DO NOT delete anything with this string as part of its name.

Then look at /boot with ls -l /boot.

Pick a file that is BIG, and does not contain the kernel version in its name.

Delete it (you'll have to use sudo rm).

Try your sudo apt autoremove again.

waltinator
  • 36,399
  • I do have access to webmin is it easy using the can I navigate to the file location and just remove the file manually?? – CorpCaleCeo Aug 14 '18 at 17:36
  • used the command and I get this uname -r 4.4.0-127-generic – CorpCaleCeo Aug 14 '18 at 17:36
  • ran the command ls -l /boot (next comment is the list) ROTFL – CorpCaleCeo Aug 14 '18 at 17:38
  • to long to add. – CorpCaleCeo Aug 14 '18 at 17:40
  • I cannot add pictures, uhhhmm – CorpCaleCeo Aug 14 '18 at 17:41
  • total 465226 -rw-r--r-- 1 root root 1249685 Jan 19 2018 abi-4.4.0-112-generic -rw-r--r-- 1 root root 1250569 Feb 13 2018 abi-4.4.0-116-generic -rw-r--r-- 1 root root 1251075 Apr 2 19:05 abi-4.4.0-119-generic -rw-r--r-- 1 root root 1251054 Apr 13 17:21 abi-4.4.0-121-generic small sample – CorpCaleCeo Aug 14 '18 at 17:42
  • I have no idea on how to use sudo rm rotfl its all good – CorpCaleCeo Aug 14 '18 at 17:47
  • OK managed to get into the /boot directory and using the command sudo -I entered the password and then listed the files. now when I tried using the command sudo rm filename e.g. abi-4.4.0-112-generic i get the result no such file exists and i tried other e.g. vmlinuz-4.4.0-87-generic-efi-signed same message no such files exists – CorpCaleCeo Aug 14 '18 at 18:42
  • Did you cd to /boot, or should you type sudo rm -fv /boot/{abi-4.4.0-112-generic,vmlinuz-4.4.0-87-generic-efi-signed}, or sudo rm -fv /boot/*4.4.0-11*? Please read the https://askubuntu.com/help/how-to-ask help. You can Edit your question to add information, and you can format it for readability. – waltinator Aug 15 '18 at 02:35
  • I ran the command from within the /boot folder e.g. Sudo rm abi-4.4.0-112-generic. I got in to the folder by using root command sudo -i and then navigated to the /boot folder e.g. cd /boot then ran ls -l /boot so see all the files then tried manually removing them. Some had dependencies so couldn't be removed and some weren't install so couldn't be remove so i'm stuck with dependencies and uninstalled – CorpCaleCeo Aug 15 '18 at 11:19
0

OK finally fixed this hip hip, now I used webmin and file manager to got to the boot location e.g. /boot and once in I used ls -l /boot to located the files which I could remove with no issues or if I had issue then I did care I backed up the VM both checkpoint and backup so all good. after selecting all the files apart from any with 4.4.0-127 in the file name and deleted them after which I rebooted the system and used the "sudo apt-get remove -f" to force despite which some say other say it means force and sure enough it forced a clean up.

I'm now updating 81 missing updates including 31 security and so far so good. the answer came from a collect collaboration however I could not delete any files using any Linux command suggested so had to use good old fashioned windows know how and it work a charmed.

so I advise anyone to install and use webmin it a fantastic software and give full access to all thinks Linux, its beautiful and I love it