23

When we install a package in Ubuntu using apt-get install, where can we find the .deb files ?

I installed Python using this method but I did not find its .deb file in /var/cache/apt/archive/.

  • Yes, it is included by default, but I installed an other version of it –  Apr 03 '14 at 07:23
  • @SOStinks I... don't understand what you mean. Google is a search engine and the idea is that you click on the links it provides and read them. I don't see how it can be lying. In any case, yes, that was a typo but I cannot edit old comments, so I will just delete it since the answer below explains it nicely. I suspect, however, that what you saw in Google was the text of the question and not my comment. – terdon Jan 05 '23 at 16:51
  • The problem is, people want to know what they've installed onto the system, and they want a copy of THOSE deb files. Not any other deb files, but those specific ones. How do you get those debian files out of system? – Owl May 10 '23 at 12:17

1 Answers1

28

By default, apt stores the .deb files in /var/cache/apt/archives. If you can't find them here, you or someone else or something else(a software like Ubuntu tweak) may have run a clean-up command like sudo apt-get clean to clear up the .deb files. However, you can manually search all .deb files in your system by doing the following(may require superuser privileges):

sudo updatedb

This will update locate's database to search for newly created/removed files, this may take a while depending upon the difference in time when the last time updatedb was run(it is usually run as a cron job daily) and then

locate *.deb

which will search your / folder recursively for all files ending with .deb.

jobin
  • 27,708
  • Thank you Jobin. Yes, I performed the clean several times, indeed before I searched for the .deb file –  Apr 03 '14 at 07:25
  • Unfortunately it doesn't have the debian files that i need. – Owl May 10 '23 at 12:18