-1

I restarted my Ubuntu Laptop after long time and now I can't start Graphical User Interface anymore. To solve this problem I tried to repair the packages from the recovery system, which said that there is not enough memory available. So I tried to free some memory using the root shell, but after freeing some memory, memory usage doesn't change and the calculation seems to be wrong too.

I have a Partition of 92 GB and only use 88 GB but df still says that I use 100% of the memory and 0 GB are available.

Is there any solution to correct the Memory calculation or is there a reason why it doesn't calculate correct?

Franz
  • 101
  • 2
  • Over 95% of that partition is in use, and the 5% is probably reserved, which brings it to 100%. Looks accurate to me. Also, it is unclear how "repair the packages" can free space, and what was wrong with those packages. – mikewhatever Jun 04 '22 at 15:50
  • I needed memory to repair broken packages to make the graphical interface work again. I don't want to repair packages to free memory, I want to free memory to repair packages. – Franz Jun 04 '22 at 16:05

1 Answers1

0

Here is what I use to free up space

apt autoclean && apt autoremove && sudo apt --purge autoremove && sudo apt clean all && sudo apt purge $(dpkg -l | awk '/^rc/ { print $2 }')

Also remove any extra kernels

dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get -y purge; sudo apt-get autoremove -y; sudo update-grub

Caution that the backtick ` has a tendency of not copy pasting correctly.

Czar
  • 580
  • Also remove extra Kernels I've been using this on my servers: dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'uname -r'/q;p' | xargs sudo apt-get -y purge; sudo apt-get autoremove -y; sudo update-grub – Czar Jun 05 '22 at 02:50