1

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.

2

1 Answer 1

3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .