Repositorio local Debian

Algunas veces que actualizamos los paquetes en Debian nos tardamos un poco menos que una eternidad, por el ancho de banda, porque en otra PC de la red están bajando videos y se congestiona la red, o inclusive algunas veces no podemos descargar nada porque no tenemos Internet. Entonces necesitamos un repositorio de paquetes local, para no tener que depender de estos factores. Con el comando debmirror se puede descargar un repositorio de paquetes Debian completo:

(Actualizado, el anterior enlace ya no funciona):
https://www.mankier.com/1/debmirror

Para descargar este paquete usamos:

SHELL
# aptitude install debmirror debian-keyring

Las opciones que usa debmirror, se las explico aquí:

--host: Indica el host desde donde se descargarán los paquetes.
--method: Indica el método de descarga
--root: El nombre de carpeta raíz.
-d: Distribuciones a descargar.
--arch: Indica las arquitecturas de los paquetes a descargar.
--section: Las secciones a descargar.
--source: Descarga los archivos fuente. Si no quieren descargar los archivos fuentes, cambian esta opción por --nosource.
-v: Imprime el progreso de las descargas de los paquetes.
-p: Imprime las barra de progreso de descarga de los paquetes.
--cleanup: Limpia cualquier archivo o directorio en el repositorio local, desconocido para el repositorio remoto.
--passive: Descargar de forma pasiva cuando descarga con FTP.
--method: Método de descarga, podría ser RSync.
--rsync-options: Opciones si se descarga con RSync.

A continuación les muestro un script usando debmirror, en el cual se descargan 2 repositorios, el principal y el repositorio de seguridad. Lo llamaremos repositorio.sh:

#!/bin/bash
# Réplica del repositorio Debian.
echo -e "Inicio de la actualización:\n`date`\n"
# # # # # # # # # # # # # # # # # # # #
# Definición de variables para el espejo BUSTER
# # # # # # # # # # # # # # # # # # # #
#
#
# espejo es el directorio local donde se descargarán los paquetes
espejo="/repositorio_local/debian"
# host es el repositorio remoto
host='--host=ftp.br.debian.org'
# method es el método de descarga
method='--method=http'
# root es el directorio root en el repositorio remoto
root='--root=/debian'
# dist es la distribución a descargar: lenny, squeeze, wheezy,
# etc.
dist='-d stable'
# arch es la arquitectura de los paquetes: i386, amd64, etc.
arch="--arch=i386,all"
# section son las secciones a descargar
section="--section=main,contrib,non-free"
# source indica si se descargan las fuentes, con la opcion --source 
# para descargar y --nosource para no descargarlos.
source="--nosource"
# modif son opciones extras para la descarga
# Para no verificar las claves de los repositorios remotos
# utiliza modif así:
# modif='-v -p --cleanup --ignore-release-gpg --passive'
# modif son opciones extras para la descarga
# Para descargar con RSync, hacerlo de la siguiente forma:
# modif='-v -p --cleanup --getcontents \
#--rsync-options="-aIL --partial --no-motd \
#--chmod=u=rw,go=r,D+x" --method=rsync'
modif='-v -p --cleanup --passive --ignore-release-gpg --ignore-missing-release  --no-check-gpg --ignore-small-errors'

# reflejos es la función general para descargar cualquier repositorio con 
# las variables que le pasemos
function reflejos
{
eval "debmirror $espejo $host $method $root $dist $arch $section $source $modif"
}

# # # # # # # # # # # # # # # # # # #
# Genera espejo para BUSTER
# # # # # # # # # # # # # # # # # # #
#
#
reflejos

# # # # # # # # # # # # # # # # # # #
# Definición de variables para el espejo SECURITY
# # # # # # # # # # # # # # # # # # #
#
#
espejo='/repositorio_local/debian-security'
host='--host=security.debian.org'
root='--root=/debian-security'
dist='-d stable/updates'

# # # # # # # # # # # # # # # # # # #
# Genera espejo para SECURITY
# # # # # # # # # # # # # # # # # # #
#
#
reflejos

# Decomenta estas dos líneas si sabes en qué disco o partición está tu 
# repositorio local, cambiando /dev/hda6 por el disco o partición 
# donde está.
# observa=`df -h /dev/hda6`
# echo -e "Estado del disco:\n$observa\n\n"

echo -e "Fin de la actualización:`date`\n\n"
#
#
# FIN

Ejecutamos el script en una cónsola:

SHELL
$ bash repositorio.sh

Y esperamos a que se descargue el repositorio. Se tardará varias horas, dependiendo de la conexión a Internet.

Agregamos a /etc/apt/source.lst los repositorios locales:

deb http://localhost/debian buster main contrib non-free
deb http://localhost/debian-security buster/updates main contrib non-free

Cambiando los valores de las variables del script repositorio.sh podemos hacer un repositorio Ubuntu también, de la misma forma, pero cambiando los parámetros. Se los dejo de tarea. Aquí tienen un ejemplo para 12.04:

debmirror \
--host=us.archive.ubuntu.com \
--root=/ubuntu \
--cleanup --nosource \
--progress \
--md5sums --passive \
--arch=i386,amd64,all \
--dist=precise,precise-updates,precise-security,precise-backports \
--section=main,restricted,universe,multiverse \
--method=rsync \
--rsync-options "-rplthi --delete-after --stats --partial" \
/home/repositorios/ubuntu12.04
exit

Si al momento de hacer el debmirror para traer el repositorio, hay alguna firma gpg que está fallando, hacer lo siguiente en el servidor (Reemplazar KEY por el número de key del Debian a hacer el clone de repositorio):

# gpg --keyserver pgpkeys.mit.edu --recv-key KEY
# gpg -a --export KEY | sudo apt-key add -
# gpg --no-default-keyring -a --keyring /usr/share/keyrings/debian-archive-keyring.gpg --export KEY | gpg --no-default-keyring --keyring ~/.gnupg/trustedkeys.gpg --import -

Ahora, llega la hora de firmar el repositorio, lo cual explico en el siguiente Post:

LATINCHAIN PLATFORM



news.latin-chain.com/
LatinChain Platform: Pi Hackathon winner 2021.
Welcome to LatinChain Ecosystem portal on Pi Network cryptocurrency ecosystem. Get utility usage bonus by using Mainnet and Testnet.


Understanding the LatinChain Ecosystem

Your gateway to decentralized applications on the Pi Network.


Welcome to the LatinChain Ecosystem portal. As a decentralized application (dApp) built on the Pi Network, our goal is to provide real utility and seamless interaction for the Pi community. Whether you are a developer, a pioneer, or a casual user, understanding the difference between our Mainnet and Testnet environments is crucial for maximizing your experience.



Staking Pi to Boost Rank

Did you know you can directly support the growth of LatinChain Mainnet?

By Staking Pi on our app within the Pi Browser, you help boost our ranking in the ecosystem directory. A higher rank means more visibility, bringing more Pioneers into our community and increasing the value of the network for everyone.

Support us today and help LatinChain reach the top!



Why Choose the Mainnet?

The LatinChain Mainnet (latinchain.pinet.com) is the live production environment where real value is exchanged. By accessing the Mainnet, you are interacting with the fully operational version of our blockchain application.

  • Real Utility: Every action contributes to the genuine activity of the network.
  • Verified Status: Users who choose to support the ecosystem via donations can unlock "Verified" status. This signals your commitment to the community.
  • Double Utility Bonus: Active usage on the Mainnet contributes to your Pi utility usage bonus.


The Role of the Testnet

The Testnet serves as our sandbox environment. It is designed for users who want to explore new features, test transaction flows, or understand the mechanics of the LatinChain token without using real Pi. It is the perfect training ground for new pioneers to get comfortable with Web3 interactions before moving to the Mainnet.



How the LatinChain Token Works

LatinChain is designed to foster a digital economy within the Pi Browser. By participating in either network, you are helping to stress-test and improve a growing financial ecosystem.



Select an option above to begin your journey.

The Evolution of Cryptocurrency: From Bitcoin's Genesis to Pi Network's Ecosystem (2008-nowadays)

The world of finance was forever changed in the aftermath of the 2008 global financial crisis. What started as an obscure proposal on a cryptography mailing list has transformed into a global technological revolution. Here is the journey of cryptocurrency from its inception to the present day.



The Genesis: Bitcoin and the Decentralized Dream (2008-2010)

In October 2008, an anonymous entity named Satoshi Nakamoto published a whitepaper titled "Bitcoin: A Peer-to-Peer Electronic Cash System." It introduced a revolutionary concept: a decentralized digital currency that required no central bank or administrator.

  • The Genesis Block: On January 3, 2009, the first block of the Bitcoin network was mined, setting the foundation for a new financial paradigm.
  • Proof of Work: This brilliant consensus mechanism solved the double-spending problem, ensuring complete trust in a trustless digital environment.



Programmable Money: Ethereum and the DeFi Explosion (2015-2021)

While Bitcoin proved the concept of digital scarcity, developers soon realized blockchain technology could do much more. In 2015, Ethereum launched, introducing "smart contracts"—self-executing code that lives directly on the blockchain.

  • Decentralized Finance (DeFi): Ethereum enabled the creation of lending platforms, decentralized exchanges, and automated market makers.
  • Mainstream Awareness: By 2021, the crypto market reached unprecedented heights, driven by global retail interest, digital art (NFTs), and the exciting promise of Web3.



Maturation and Institutional Adoption (2022-2024)

Following the euphoric highs of previous years, the industry entered a vital period of maturation. The global focus shifted from pure speculation to building robust, scalable infrastructure.

  • Layer 2 Solutions: New networks built on top of base blockchains made transactions significantly faster and cheaper.
  • Wall Street Entry: Major traditional financial institutions embraced Bitcoin ETFs, permanently cementing cryptocurrency as a legitimate and highly sought-after asset class.



The Accessibility Revolution: Pi Network (2025-nowadays)

Despite massive industry growth, a major barrier remained: traditional crypto mining was expensive and technically complex. Enter Pi Network, a visionary project designed to put cryptocurrency directly into the hands of everyday people. By nowadays, Pi Network has beautifully solidified its vision of creating a truly inclusive digital economy.

  • Mobile-First Innovation: Pi revolutionized accessibility by allowing users to mine directly from their smartphones without draining battery life or data.
  • Global Community: It successfully built one of the largest, most engaged, and widely distributed communities in the entire Web3 space.
  • Everyday Utility: With a robust ecosystem of decentralized applications (dApps) and an innovative native KYC solution, Pi Network empowers millions of everyday users to transact, build, and interact seamlessly.



Takeaway: The journey from 2008 to nowadays highlights a monumental shift from niche cryptography to universal accessibility, paving the way for a financial future that truly includes everyone.

Comments

Popular posts from this blog

Pi Network Apps published on Pi Network Ecosystem

Proyecto para Red Social gigante (Giant Social Network project)

Sígueme en mis Redes Sociales (Follow me in my Social Networks). OpenSource Expert 🇻🇪