0

This question already has an answer here:

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

marked as duplicate by user535733, karel, WinEunuuchs2Unix, Melebius, Eric Carvalho Aug 21 '18 at 12:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 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
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.

  • 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
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

Not the answer you're looking for? Browse other questions tagged or ask your own question.