Packages in DEBIAN - Part I (Packages, Repositories and Package Managers.)

Greetings, Dear cyber-readers,

This will be the first publication of a series of 10 related to the Package Study, which are of utmost importance for any user of GNU / Linux Operating Systems in general, but focused on DISTRO DEBIAN.

DEBIAN packages

In this first part we will focus on the conceptual: Packages, Repositories and Package Managers.

  • Packages

A software package in a GNU / Linux Operating System is generally a ZIP file that has a predefined internal structure that facilitates and allows it to be manipulated by Software Management Tools (Package Managers) to achieve its compilation and / or installation, update and / or elimination on the Operating System, in a comfortable, safe, stable and centralized way. A package is compileable if your installation is based on your source code directly (Exm. * .Tar.gz) o installable if you do it in binaries already compiled for a certain architecture or platform (Exm. * .Deb).

Most packages come with your documentation included, Its pre and post installation scripts, Its initial configuration files, Its resource files, And its binaries or source code with everything you need if it's meant to be compiled.

Most package formats come with their corresponding Software Management Tools, the best known are the .deb created for the DEBIAN Distro and all its derivatives, and .rpm created by Red Hat for its own Distro and derived like Fedora and Open SUSE. There are also the compilable packages Gentoo .ebuilds.

The fact that a package has been created for a particular Distro does not imply that it can only be used in that Distro or derivatives, since it is enough to have specialized tools in any other Distro for the Management of these formats to be able to use them. Among those tools we have: Dpkg, Apt-get, Aptitude, RPM, Emerge, Alíen, among others).

Each Distro keeps its parcels in Repositories, both in media and CD / DVD as in Remote serversAllowing update and install by network (Internet) all or part of the Operating System from safe and reliable location (Official repositories) so that you don't have to search for unknown (and insecure) Servers unless strictly necessary.

Each Distro usually contributes its own security packages (patches) and enhancements (updates), in order to make available to their User Communities many perfectly functional software integrated into the Operating System. And as for the dependencies between each package, they usually be managed automatically to avoid potential problems less expert Users.

Compile or Install? The good thing about compiling When installing, it can be said that the main thing is the possibility of specifying compilation options for your system and used software that allow better use of resources and adjust to the preferences of the user / administrator, and the bad how slow and complicated this process can get. Since generally, the installing a package (eg * .deb) is very fast and easy, But usually not get well updated or adjusted to the Distro of our use or Resources of our Computer Equipment.

If you want to know more about the DEBIAN packages I leave the following links below for your detailed reading:

  1. DEBIAN - Packages
  2. Debian Developer's Corner
  3. Debian New Developer's Guide
  4. Debian Package Creation Guide
  • Repositories

Repositories are big Servers (External / Internal) they act like Data Banks that host the applications (packages) that our Linux-based Operating Systems need, Whether old, current, new, or in development, which are installed using a Package manager. All this with the purpose of keep the Operating System up to date especially in matters of security patches. Repositories can be of two (2) types: Official and Unofficial.

Linux-based Operating Systems (Distros) They usually have a file in which the list of Repositories (Official or not) that we can access through the Package manager for your Download, Installation, Update or Removal. This file is generally located at the location / etc / package_manager_name / where "Package_manager_name" this is usually the name of the Distro's package manager. For example in DEBIAN would be in /etc/apt/sources.list.

The Official Repositories store the packages of the applications that our Distro supports. They are always divided into a structure (of branches and versions) that, depending on the policies of their creators, guarantee (ensure) under a very rigorous review protocol that all the packages they contain are in optimal state and do not represent security risks or stability for the system, and new ones or in development in separate branches for those more advanced or experienced users.

In the case of DEBIAN, the Repositories have 3 branches:

  • Main: Branch that stores all packages included in the official Debian distribution that are free according to the Debian Free Software Guidelines. The official Debian distribution is made up entirely of this Branch.
  • Contrib (Contribution): Branch that stores the packages whose creators have given them a free license, but they have dependencies on other programs that are not free.
  • Non-Free: Branch that stores packages that have some onerous license condition that restricts their use or redistribution.

DEBIAN Repositories are divided into Versions:

  • OldStable (Old Stable):  Version that stores packages belonging to the old Stable Version of DEBIAN. Currently this belongs to the Wheezy Version.
  • Stable:  Version that stores the packages belonging to the current Stable Version of DEBIAN. Currently this belongs to the Jessie Version.
  • Testing:  Version that stores the packages belonging to the future Stable Version of DEBIAN. Currently this belongs to the Stretch Version.
  • Unstable: Version that stores packages belonging to future packages that are continually under development and testing, which could eventually belong to Version Testing by DEBIAN. This always belongs to the SID Version.

Note: Many times the version name is usually accompanied by the prefix "-Updates" o "-Proposed-updates" to highlight that said packages stored there although they belong to that version are usually more updated, since they come more recently from the next higher version. At other times when it comes to Security Repository the prefix is ​​usually «/ Updates».

DEBIAN Repositories can be filtered by their content:

  • deb: Repositories that will only contain compiled packages.
  • deb-src: Repositories that will only contain the source codes of the compiled packages available.

Examples of Repositories for DEBIAN:


#######################################################
# REPOSITORIOS OFICIALES DE LINUX DEBIAN 8 (JESSIE)
deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ jessie-updates main contrib non-free
# deb http://ftp.us.debian.org/debian/ jessie-proposed-updates main contrib non-free
# deb http://ftp.us.debian.org/debian/ jessie-backports main contrib non-free
# deb http://www.deb-multimedia.org jessie main non-free
# aptitude install deb-multimedia-keyring
# ####################################################

Note: Those lines that start with the character »#« they are disabled from the Package Manager. This character is also used for insert comments such as Repository Line Descriptions or the command line that should be used to add the Repository Keys described.

  • Package Managers

In the past, many Linux packages (programs) were distributed as source code and needed to be transformed (compiled) into the required program or set of programs, plus their respective documentation (man pages), configuration files and everything else that was necessary. . However, currently, most Linux Distros use packages (pre-made programs or sets of programs), which are ready to be installed in said distribution.

With these Package Management Tools you can easily know, download, install, update and delete any packagee. In our case for DEBIAN we will focus on Apt-get, Aptitude, Apt and DPKG Package Managers. which uses both DEBIAN and the Distros derived from DEBIAN (such as Ubuntu).

Although the basic package management function is much more powerful by means of commands from the Terminal (Console), Linux developers who are always trying to do their best to make Linux easier to use, have complemented these basic tools with others Tools with Graphical User Interfaces (GUI Tools), which try to reduce the possible complexities of the basic tools so as not to complicate the final consumers.

But basically in all of them they can perform the same basic operations already mentioned on the packages. While the basic ones have command line functionality, the additional tools can offer more user-friendly interfaces. And they can all retrieve packages from the Internet, as information for installed packages is usually kept in a single database.

Below are the most useful and common command commands in each of the Package Managers:


Apt-get:

Actualizar Listas: apt-get update
Chequear actualización de Listas: apt-get check
Instalar paquete: apt-get install nombre_paquete
Reinstalar paquete: apt-get install --reinstall nombre_paquete
Actualizar Distro: apt-get upgrade / apt-get dist-upgrade / apt-get full-upgrade
Actualizar paquete: apt-get upgrade nombre_paquete
Actualizar paquetes usando dselect: apt-get dselect-upgrade
Eliminar paquetes: apt-get remove / apt-get autoremove
Purgar paquetes: apt-get purge
Conocer paquete: apt-cache show nombre_paquete / apt-cache showpkg nombre_paquete
Listar paquetes: apt-cache search nombre_paquete
Listar dependencias de un paquete: apt-cache depends nombre_paquete
Listar paquetes instalados: apt-cache pkgnames --generate / apt-show-versions
Validar dependencias incumplidas de un paquete: apt-cache unmet nombre_paquete
Configurar dependencias de un paquete: apt-get build-dep nombre_paquete
Descargar paquetes: apt-get source nombre_paquete
Corregir problemas post-instalación de paquetes: apt-get install -f
Forzar ejecución de orden de comando: apt-get comando  -y
Eliminar descargas de paquetes: apt-get clean
Eliminar paquetes obsoletos y sin usos: apt-get autoclean
Otros importantes: apt-file update / apt-file search nombre_paquete / apt-file list nombre_paquete

Nota: Para mayor información sobre este comando ejecute la orden de comando: man apt-get  
 

Aptitude:

Actualizar Listas: aptitude update
Instalar paquete: aptitude install nombre_paquete
Reinstalar paquete: aptitude reinstall nombre_paquete
Actualizar Distro: aptitude upgrade / aptitude safe-upgrade / aptitude full-upgrade
Actualizar paquete: aptitude upgrade nombre_paquete
Eliminar paquetes: aptitude remove
Purgar paquetes: aptitude purge
Listar paquetes: aptitude search nombre_paquete
Listar paquetes instalados / rotos: apt search [*] | grep "^i" / apt search [*] | grep "^B"
Configurar dependencias de un paquete: aptitude build-dep nombre_paquete
Descargar paquetes: aptitude download nombre_paquete
Corregir problemas post-instalación de paquetes: aptitude install -f
Forzar ejecución de orden de comando: aptitude comando  -y
Eliminar descargas de paquetes: aptitude clean
Eliminar paquetes obsoletos y sin usos: aptitude autoclean
Otros importantes: aptitude (un)hold, aptitude (un)markauto, why, why-not
Conocer paquete:
aptitude show nombre_paquete
aptitude show "?installed ?section(fonts)" | egrep '(Paquete|Estado|Versión)'
aptitude show "?not(?installed) ?section(fonts)" | egrep '(Paquete|Estado|Versión)'
aptitude show "?section(fonts)" | egrep '(Paquete|Estado|Versión)'

Nota: Para mayor información sobre este comando ejecute la orden de comando: man aptitude  

Apt:

Actualizar Listas: apt update
Instalar paquete: apt install nombre_paquete
Reinstalar paquete: apt install --reinstall nombre_paquete
Actualizar Distro: apt upgrade / apt full-upgrade
Actualizar paquete: apt upgrade nombre_paquete
Eliminar paquetes: apt remove / apt autoremove
Purgar paquetes: apt purge
Conocer paquete: apt show nombre_paquete
Listar paquetes: apt search nombre_paquete
Listar paquetes instalados / actualizables: apt list --installed / apt list --upgradeable
Corregir problemas post-instalación de paquetes: apt install -f
Forzar ejecución de orden de comando: apt comando  -y
Eliminar descargas de paquetes: apt clean
Eliminar paquetes obsoletos y sin usos: apt autoclean
Otros importantes: apt edit-sources

Nota: Para mayor información sobre este comando ejecute la orden de comando: man apt

DPKG:

Instalar paquete: dpkg -i nombre_paquete
Eliminar paquete: dpkg -r nombre_paquete / dpkg --force -r nombre_paquete / dpkg --purge -r nombre_paquete
Purgar paquete: dpkg -P nombre_paquete
Descomprimir paquete: dpkg --unpack nombre_paquete
Conocer paquete: dpkg -c nombre_paquete / dpkg --info nombre_paquete / dpkg -L nombre_paquete
Buscar archivos de paquetes instalados: dpkg -S nombre_archivo
Configurar paquetes: dpkg --configure nombre_paquete / dpkg --configure --pending / dpkg --configure -a
Listar paquetes: dpkg -l patrón_búsqueda / dpkg --get-selections nombre_paquete / dpkg --get-selections | grep -v deinstall > lista-paquetes-actuales.txt

Well, so far in this post I hope the content is useful to you.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Kavra kavra said

    One note ... gentoo .ebuilds are not packages as such, they are scripts that indicate how the package will be installed, usually from source code with the packaging chosen by the developer.

  2.   Chaparral said

    Excellent information. I will keep it together with other installments already published on Debian because they will be very useful to me. I thank the author for his extraordinary work and input.

  3.   Melvin said

    Excellent José Albert, you really stand out, congratulations and keep guiding us

  4.   Melvin said

    Very Good José Albert continues to guide us congratulations

  5.   Melvin said

    Very good article

  6.   venturi said

    Thanks for your contribution, although it has some errors. A question out of curiosity, are you a Debian developer or contributor in any way? Thank you for spreading the information on how to collaborate with Debian, for my taste it was necessary to mention the possibility of helping collaborating in the always necessary translations or revisions of translations of packages, installers, web page, etc ... You reserve the same for future deliveries.

    Greetings and encouragement with the publication.

  7.   Jose Albert said

    No! I am not an Official Developer or a direct Contributor to DEBIAN, although I have created about 2 individual packages and many scripts for said Distribution. And I hope to include what you told me in another post. And thanks for your support!

    DEBIAN is my favorite Distro!

    1.    Manuel "Venturi" Porras Peralta said

      As it should be! 🙂

  8.   Alexander TorMar said

    Excellent article ... Congratulations, I am a lover of free software and I study computer science and this is very useful
    Greetings from Bogotá

  9.   oscar said

    Thank you very much for your time and patience… and for sharing !!!

    all the best!
    Thank you!!

  10.   Jose Albert said

    Thank you very much for all your supportive comments, congratulations, and motivation!

  11.   Carlos reyes said

    Thank you, very complete, at least for those of us who still know a lot about it.

  12.   raft said

    Excellent, to file and consult, thanks for the contribution.

  13.   savier said

    What a good material Antonio friend, understandable and of good use ...