How to delete files from archives
The directory /var/cache/apt/archives
contains cached downloaded packages (*.deb
files - the applications you installed using apt
or the Software Center, etc).
The most simple way to free up space here is to tell apt
to remove these cached packages by running
sudo apt autoclean
This removes all old cached packages which are no longer downloadable only, but leaves those that could still be useful intact. To remove them all, use the one below instead:
sudo apt clean
Note that on older Ubuntu releases, you might have to use apt-get
instead of apt
.
Related videos on Youtube
![OUBAD Anass](https://lh3.googleusercontent.com/-sFNKCaKk8OE/AAAAAAAAAAI/AAAAAAAAACk/K8tJUBun-SI/photo.jpg?sz=256)
OUBAD Anass
Updated on September 18, 2022Comments
-
OUBAD Anass almost 2 years
I need to resize my ubuntu partition and I found that I need to install Gparted! And to do that I need to delete files from
/var/cache/apt/archives
because it's FULL!I can't do it manually! and from terminal I tried with different commands such as
sudo rm -rf
... but it doesn't delete files!Can you please help me!?
$ df -h /var/cache/apt/archives Sys. de fichiers SIZE USED Dispo Uti% Monté sur /dev/sda5 8,9G 8,9G 0 100% / $ sudo du -h /var/cache/apt/archives 4,0K /var/cache/apt/archives/partial 424M /var/cache/apt/archives
-
George Udosen over 7 yearsTry:
sudo apt-get autoclean
-
-
OUBAD Anass over 7 yearsFirst, thank you for your answer! I did it! but still doesn't gave me any free space ...
-
Byte Commander over 7 yearsCan you give the output of
df -h /var/cache/apt/archives
andsudo du -h /var/cache/apt/archives
please? Edit your question and add them there, then leave me a comment to notify me when you're done. -
OUBAD Anass over 7 yearsThere is the output of the 2 commands.
-
Byte Commander over 7 yearsTry
sudo rm -f /var/cache/apt/archives/*.deb
and then check the free space again. However, looking for other things occupying space which you don't need might be useful too, those few hundred MB will not save you much. Maybe growing the partition is also an option? -
OUBAD Anass over 7 yearsThe last command made all files disappear from /var/cache/apt/archives but when I tried to install Gparted, I got the same error wich is : not enough space on /var/cache/apt/archives !!! Yes Growing the partition is the reason why i'm doing all this! is there any other way to do it without ' sudo get install gparted ' ??
-
Byte Commander over 7 yearsEither you clean up stuff in other locations, or (even better for partitioning) you boot from a live CD (or USB, whatever you used to install Ubuntu) and run the GParted there.