domingo, 20 de abril de 2014

Repositorios Debian y Ubuntu Offline |Script


Primeramente
apt-get install debmirror

Script para debian, requiere crear la estructura /home/usuario/debian/debian , /home/usuario/debian/updates
#!/bin/sh
ARQUITECTURA=amd64
METODO=http
RAMA=wheezy
RAMAS=wheezy
HOST=ftp.debian.org
HOST_SEGURIDAD=security.debian.org
DIR_MIRROR=/home/gary/debian/debian
DIR_SEGURIDAD=/home/gary/debian/updates

SECCIONES=main,contrib,non-free
SECCION=main

echo "================================================================"
echo "Actualizando los repositorios PRINCIPALES; main, contrib, non-free"
echo "================================================================"
echo ""
debmirror -a ${ARQUITECTURA} \
-s ${SECCIONES} \
-h ${HOST}/debian \
-d ${RAMA} -r / --progress \
-e ${METODO} --ignore-release-gpg --nosource \
${DIR_MIRROR}

echo "=================================================================="
echo "Actualizando repo de SEGURIDAD; main, contrib, non-free"
echo "=================================================================="
echo ""
debmirror -a ${ARQUITECTURA} \
-s ${SECCIONES} \
-h ${HOST_SEGURIDAD} \
-d ${RAMA}/updates -r /debian-security --progress \
-e ${METODO} --ignore-release-gpg --nosource \
${DIR_SEGURIDAD}


Para ubuntu de igual forma se requiere la estructura: /home/usuario/ubuntu/ubuntu

#!/bin/sh
ARQUITECTURA=amd64
METODO=http
RAMA=trusty
RAMAS=trusty
HOST=cc.archive.ubuntu.com
HOST_SEGURIDAD=cc.archive.ubuntu.com
DIR_MIRROR=/home/gary/ubuntu/ubuntu

SECCIONES=main,restricted,universe,multiverse
SECCION=main

echo "================================================================"
echo "Actualizando los repositorios PRINCIPALES                       "
echo "================================================================"
echo ""
debmirror -a ${ARQUITECTURA} \
-s ${SECCIONES} \
-h ${HOST}/ubuntu \
-d ${RAMA} -r / --progress \
-e ${METODO} --ignore-release-gpg --nosource \
${DIR_MIRROR}

Guardan los script's por separados en un archivo .sh  posteriormente corren los archivo desde una terminal, sh archivo.sh y listo!