Simply, to purge and reinstall something like Libreoffice, I cannot find a method to do this without downloading all its packages again.

Is there something obvious I'm missing on how to do this?


  • Use apt-get instead of apt to install software if you want debs to stay in cache. There is most likely a related, if not duplicate, question. By the way, purging and reinstalling may not do much if you leave the corresponding config files in your home folder intact. – DK Bose Sep 9 '18 at 9:56
  • See askubuntu.com/a/926850/248158 – DK Bose Sep 9 '18 at 9:57
  • Indeed, the accepted answer there answers your question, and even shows how to set "apt" to also use the cache by default, like apt-get does. – vanadium Sep 9 '18 at 10:26
  • 3
    Possible duplicate of Does apt have a directory where it stores all downloads? – vanadium Sep 9 '18 at 10:27

It seems by remove a package, all are removed from the system except modified configuration (which is removed if use purge) man apt:

install, remove, purge (apt-get(8))
           Performs the requested action on one or more packages specified via regex(7), glob(7) or exact match. The requested action can be overridden for specific packages by append a plus (+) to the package name to install this
           package or a minus (-) to remove it.

           A specific version of a package can be selected for installation by following the package name with an equals (=) and the version of the package to select. Alternatively the version from a specific release can be selected
           by following the package name with a forward slash (/) and codename (stretch, buster, sid ...) or suite name (stable, testing, unstable). This will also select versions from this release for dependencies of this package
           if needed to satisfy the request.

           Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed
           package will restore its function as before in that case. On the other hand you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration
           stored in your home directory.

I'm not sure it is possible to do.

  • Question is not to clean the apt cache, but to reinstall from the existing cache without having to redownload again (for example if internet connection is weak) – vanadium Sep 9 '18 at 10:23
  • I had edited my own answer to correct my mistake, and what I posted later is the man page of apt, and seems the remove operation clean cache too. I improve the modification of my answer because I saw it now it is not clear – AtomiX84 Sep 9 '18 at 10:26

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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