Cleaning apt archives - how I would like to do it.

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
viking777

Cleaning apt archives - how I would like to do it.

Post by viking777 »

Just answering another question a while ago about apt-get clean / apt-get autoclean made me think of how illogical those commands seem to me, and I just wondered if anyone knows of a more logical alternative. Let me explain.

Imagine a very simplified apt archive with just 4 packages in it eg.

chrome4
chrome3
chrome2
chrome1

They are not real packages just simplified examples. Chrome4 is the newest and Chrome1 is the oldest.

If I run apt-get clean they all disappear - great for saving space, but not much use if you want to reinstall anything.

If I run apt-get autoclean I am just left with chrome4 since the other three are no longer in the package repository and therefore can't be downloaded any more and therefore are removed - fine for space saving and also for saving on downloads IF you want to reinstall chrome4, but what if chrome4 doesn't work for you and you want to go back to chrome3? You have got to resort to searching for old packages in an online package repository.

The kind of archive cleaning that makes sense to me would be one that either saved both the present version and the previous version or, perhaps better still, just saved the previous version, because saving the present version is not really necessary unless you are bandwidth restricted, because it is easily downloaded again from the package manager.

If I just kept chrome3 in my archive and chrome4 turns out to be a disaster, I can easily reinstall version 3 but without consuming too much disk space. That is the kind of archive management that would make sense to me.

I know I could do it manually, but that would be a huge chore, so does anything exist that would do that automatically?

Hope that makes sense btw :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Aging Technogeek

Re: Cleaning apt archives - how I would like to do it.

Post by Aging Technogeek »

If you are running one of the Ubuntu derived versions of Mint, install Ubuntu Tweak. It includes a cache cleaner that allows you to select which files and folders are deleted and which stay. In LMDE, I don't offhand know of anything that will do this.
viking777

Re: Cleaning apt archives - how I would like to do it.

Post by viking777 »

Aging Technogeek wrote:If you are running one of the Ubuntu derived versions of Mint, install Ubuntu Tweak. It includes a cache cleaner that allows you to select which files and folders are deleted and which stay. In LMDE, I don't offhand know of anything that will do this.
Well that is interesting information. I will investigate that, thank you very much AT.
Aging Technogeek

Re: Cleaning apt archives - how I would like to do it.

Post by Aging Technogeek »

Just ran a test. Ubuntu Tweak works in LMDE also.
viking777

Re: Cleaning apt archives - how I would like to do it.

Post by viking777 »

Just ran a test also. Sadly it does not quite do what I want (I doubt anything would, this thread is just a wishlist really). What Ubuntu-tweak does is present you with a list of archived packages and asks you to tick which ones you would like to remove. It certainly works, but is no less manual than ploughing through /var/cache/apt/archives and deleting the files you don't want in there yourself.

As far as I can see, Ubuntu-tweak cannot be set up to automatically remove files of a certain age. I guess that would be very difficult to translate into computer code and that is probably why such a program doesn't exist.

Anyway thanks for the pointer, it was worth a try.
Locked

Return to “Software & Applications”