Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm a recent convert from Windows to Linux and I have a question about how Ubuntu/Linux takes care of duplications of files when installing software gets messy. To use an example, let me talk about something I'm having problems with right now; installing Ruby On Rails. At some point in downloading it there was an error (not relevant to this thread) and to solve it I went back to the beginning of the installation and ran all of the required steps, re-downloading much of what I had already downloaded. I'm used to Windows just clogging everything up with duplicated files, and my sense is that Ubuntu is smarter than that. How does Ubuntu handle a user downloading multiple things? Before each installation does it check to see if some key file is already located within the system, and if it is, it doesn't download any of the files? In Terminal I've never received a message from the system saying something along the lines of,

"User Alex has already downloaded this package"

which is what I would expect. I would really like a detailed but non-technical explanation of what's going on here.

share|improve this question
    
Take a look at this: help.ubuntu.com/community/InstallingSoftware . If you have specific questions after that, do ask. –  user25656 Jan 13 '13 at 15:27
    
How did you try to install that software? –  guntbert Jan 13 '13 at 17:04
add comment

1 Answer

Ubuntu is based on Debian, and thus uses APT. If you ever want to dive into more details, have a look at that wiki page.

...but to address some of your question:

  • first, the installation packages are cached in /var/cache/apt/archives. If a package has been cached, it won't be downloaded again unless a newer version is available.

  • second, APT keeps track of installed packages, so that, if you try installing something that's already installed, you'll get a message, that the package is already the newest version:

     ~$ sudo apt-get install zsync
     Reading package lists... Done
     Building dependency tree       
     Reading state information... Done
     zsync is already the newest version.
     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    
  • third, APT usually runs as root, so that regular, unprivileged users do not download and install software.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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