Cómo enumerar los repositorios instalados en Ubuntu y Debian

1 mar 2021 3 min di lettura
Cómo enumerar los repositorios instalados en Ubuntu y Debian
Indice dei contenuti

Introducción

Un repositorio es la colección de paquetes para un sistema operativo Linux. Puede crear un repositorio central que contenga los paquetes reales. Puede configurar el sistema para conectarse con el repositorio principal desde donde puede instalar y actualizar paquetes.

Ubuntu y otros sistemas basados en Debian utilizan Advanced Packages Tool (APT ) como su administrador de paquetes. Apt mantiene todos los archivos de configuración en el /etc/apt.

Este tutorial le ayudará a enumerar todos los repositorios instalados en un sistema basado en Ubuntu o Debian a través de la línea de comandos.

Lista de los repositorios instalados en Ubuntu

Las referencias al repositorio remoto se configuran en el /etc/apt/sources.list y todos los archivos en el directorio /etc/apt/sources.list.d/

Utilice el siguiente comando para enumerar todos los repositorios configurados en el sistema basado en apt:

sudo grep -rhE ^deb /etc/apt/sources.list*

Verá la salida de la siguiente manera:

deb http://archive.ubuntu.com/ubuntu focal main restricted
 deb http://archive.ubuntu.com/ubuntu focal-updates main restricted
 deb http://archive.ubuntu.com/ubuntu focal universe
 deb http://archive.ubuntu.com/ubuntu focal-updates universe
 deb http://archive.ubuntu.com/ubuntu focal multiverse
 deb http://archive.ubuntu.com/ubuntu focal-updates multiverse
 deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
 deb http://security.ubuntu.com/ubuntu focal-security main restricted
 deb http://security.ubuntu.com/ubuntu focal-security universe
 deb http://security.ubuntu.com/ubuntu focal-security multiverse.....
 deb http://ppa.launchpad.net/libreoffice/libreoffice-7-0/ubuntu focal main
 deb http://archive.ubuntu.com/ubuntu focal main restricted
 deb http://archive.ubuntu.com/ubuntu focal-updates main restricted
 deb http://archive.ubuntu.com/ubuntu focal universe
 deb http://archive.ubuntu.com/ubuntu focal-updates universe
 deb http://archive.ubuntu.com/ubuntu focal multiverse
 deb http://archive.ubuntu.com/ubuntu focal-updates multiverse
 deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
 deb http://security.ubuntu.com/ubuntu focal-security main restricted
 deb http://security.ubuntu.com/ubuntu focal-security universe
 deb http://security.ubuntu.com/ubuntu focal-security multiverse

Alternativamente, puede usar el apt-cache para listar todos los repositorios. Este comando también proporcionará más detalles sobre el repositorio.

Probemos el comando apt-cache

sudo apt-cache policy

Debería ver un resultado similar al siguiente:

Package files:
 100 /var/lib/dpkg/status
 release a=now
 500 http://ppa.launchpad.net/libreoffice/libreoffice-7-0/ubuntu focal/main i386 Packages
 release v=20.04,o=LP-PPA-libreoffice-libreoffice-7-0,a=focal,n=focal,l=LibreOffice 7.0.x,c=main,b=i386
 origin ppa.launchpad.net
 500 http://ppa.launchpad.net/libreoffice/libreoffice-7-0/ubuntu focal/main amd64 Packages
 release v=20.04,o=LP-PPA-libreoffice-libreoffice-7-0,a=focal,n=focal,l=LibreOffice 7.0.x,c=main,b=amd64
 origin ppa.launchpad.net
 500 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages
 release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=multiverse,b=amd64
 origin security.ubuntu.com.....

 500 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
 release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=i386
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
 release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=amd64
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal/multiverse i386 Packages
 release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=multiverse,b=i386
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages
 release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=multiverse,b=amd64
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages
 release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=i386
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
 release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=amd64
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal/restricted i386 Packages
 release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=restricted,b=i386
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages
 release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=restricted,b=amd64
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal/main i386 Packages
 release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=i386
 origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
 release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=amd64
 origin archive.ubuntu.com

Conclusión

En este tutorial, ha aprendido a ver y encontrar todos los repositorios configurados en sistemas basados en Ubuntu o Debian.

Buy me a coffeeBuy me a coffee

Supportaci se ti piacciono i nostri contenuti. Grazie.

Successivamente, completa il checkout per l'accesso completo a Noviello.it.
Bentornato! Accesso eseguito correttamente.
Ti sei abbonato con successo a Noviello.it.
Successo! Il tuo account è completamente attivato, ora hai accesso a tutti i contenuti.
Operazione riuscita. Le tue informazioni di fatturazione sono state aggiornate.
La tua fatturazione non è stata aggiornata.