Tuesday, May 7, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1112  / 3 Years ago, sun, october 31, 2021, 8:36:26

I am absolutely new to Ubuntu. I just migrated to Ubuntu 13.10 from Windows.



While using Windows, it is a common practice to download a software, save the downloaded files in a different partition and then use the executable .exe installer to install the software in the computer.



I have been installing apps in Ubuntu using



sudo apt-get install <package-name>


In this process I am unable to store a copy of the software before installing. Is there a process for doing that? Ubuntu doesn't even ask me for the path where to download the software to. Neither am I asked for a path where the OS wants to install the software.



I am unable to understand the process that is going on.


More From » package-management

 Answers
7

Linux software is organized in packages, and apt is the software that manages those packages. A software package may depend on many other software packages in order to run. For example, if you install the package for Wine, apt will report that wine depends on several other packages, which in turn depend on other packages that do certain things for Wine, like fonts, filesystem utilities, filetype support, etc.



Organizing software this way has many advantages.




  • There is no need to install a piece of software twice.

  • It is incredibly easy to remove and install packages because it is all automated.

  • Removing software is always non-invasive.

  • Upgrading software is a breeze.

  • There is no need to keep track of a bunch of downloaded executable installer files.



In Windows, you would have one big folder for a program holding all the software binaries, icons, configuration files, and the whole blob for a specific program. In Linux, you have a dedicated folder for all the icons the system uses (/usr/share/icons), all the binaries (/bin), all the firmware files (/lib/firmware), and the rest. The package file for a piece of software keeps track of all of its files across the system. Things are a lot easier to find this way.



When you install a package, this is what happens: Say you invoke the command sudo apt-get install libreoffice:




  1. The package lists on your computer (in /var/lib/apt/lists) are checked for a package named libreoffice. The lists provide information about all of the different installable packages, which are stored on http://archive.ubuntu.com/. The website is not meant to be browsed by users (see below), instead it's intended to be used by apt. The package's dependencies are examined (in libreoffice's case the list is extensive). If dependencies need to be installed, they are added to the list of packages to be installed, in the correct order.

  2. The packages are all downloaded from http://archive.ubuntu.com/. If you have selected a different mirror to get more speed, they are downloaded from there.

  3. The package files themselves are ar achives which in turn contain archives for program data, and information on where the data goes with more detailed information about the package. The packages are decompressed individually and then set up according to what is detailed in the package's control information in the archive. Any specific scripts are then run and configuration files are changed.

  4. Meanwhile, apt keeps track of the status of the packages: whether they are installed, partially installed, or not installed.



If you want to know what is going on "behind the scenes", you can check the files that a package installs across the system on http://packages.ubuntu.com/. You can also download .deb package files from there, if you need to, but you wouldn't typically want to. You can also use apt to download and see the details of packages.




  • To download a package file and its dependencies: sudo apt-get download
    <package>

  • To see the details of a package: sudo apt-cache showpkg <package>

  • To see what packages you have downloaded (this directory is normally
    write-protected and not accessible by normal users): ls /var/cache/apt/archives

  • To clear the cache and save disk space: sudo apt-get clean



To conclude, in Linux, it is not necessary to know as the user where all the package's files are kept and what exactly is being done when you install one, unless you are doing advanced operations that explicitly require that knowledge. You have the powerful Software Center to see what programs you have installed and you can use that to install and remove them.


[#27476] Tuesday, November 2, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ndaavi

Total Points: 169
Total Questions: 116
Total Answers: 113

Location: Falkland Islands
Member since Wed, Dec 23, 2020
3 Years ago
;