When you install packages or perform an upgrade, it is done in two steps:
When a package is downloading, you can interrupt it using Ctrl+C.
You can also interrupt during installation, but that can make the package manager misbehave.
You might end up with a broken package manager and you might not be able to install any more packages using it.
If you interrupt installation of a system package, such as the linux kernel itself,
your Linux OS might not start the next time you turn on your computer.
So be careful while interrupting. Interrupt only during the download phase, not during the installation phase.
Also note that you cannot have multiple instances of apt-get running at the same time. So you cannot install packages in parallel by opening multiple apt-gets in different terminals.
If installation (not download) is going on for 3-4 hours, it’s a sign that there is something wrong with the package or your computer. If that happens, you’ll have no choice but to interrupt the installation. Usually this won’t cause much problems. I have had to interrupt installations a few times. Out of those, a few times my package manager broke down. But I was able to repair it every time.
Sometimes a package depends on another package. For eg, pidgin requires libcairo2. pidgin uses libcairo2 for some graphics-related functionalities. In this case we say that libcairo2 is a dependency of pidgin.
There are other packages which also require libcairo2. If you install those packages, only one copy of libcairo2 is installed and that copy is shared among all these programs.
When you install a package using apt-get install, its dependencies are also downloaded and installed.
Dependency management is one of the main benefits of using a package manager.
When you download a package, it is saved in the cache for some time. It you uninstall that package and install it again, the cached copy will be used. This will speed things up since it is not required to download those packages.
However, sometimes due to disturbence in internet connection, the downloaded package might get corrupt (this happens very rarely, but it does happen). You will get to know that only when installation begins and fails. When this happens, you should usually uninstall the package and install it again. But before that the cache has to be emptied, otherwise the corrupt version in the cache will be used.
To empty the cache, use the command sudo apt-get clean
apt show name-of-package
This command will output a lot of useful info about a package. This includes a description of waht that package does, information about dependency, etc. This information is fetched from your package index, so an internet connection is not required.
Usually you would want to pipe this command to less
apt show name-of-package | less
An archive file is a file in which other files are packed.
For eg, .zip, .rar, .tar.
These archives may or may not be compressed.
For eg, .zip and .rar are compressed while .tar is not.
Packages are archives with the extension .deb.
They contain all neccessary programs, configuration files, etc for the software to function.
apt-get automatically downloads .deb files when you install programs or upgrade.
However, it is possible to manually install .deb files as well.
https://www.google.com/chrome/
Google chrome is not available in Ubuntu’s repositories because only Google holds legal rights to distribute Chrome.
The above link can be used to download Google Chrome.
Google will offer you to download a .deb file.
When you click ‘Accept and Install’ on their site, you will be redirected to
https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb.
Once you download this file, you must install it.
Use the dpkg command to install .deb files.
sudo dpkg -i google-chrome-stable_current_amd64.deb
apt-get uses a single connection to download packages.
This can lead to a very slow download speed if internet connection is shared
(like in BITS campus; more people using internet means less speed per user).
There is a program called apt-fast.
It is a wrapper program around apt-get.
It downloads the packages using multiple connections (which can greatly increase download speed).
Unfortunately, apt-fast is not available in Ubuntu’s repositories and has to be installed separately.