Instalar sin Red
A pedido de mi primo, quien ultimamente no tiene internet para poder jugar con su ubuntu, me puse a hacer un pequeño script en python para obtener las URIs de los paquetes necesarios para instalar cualquier software.
#!/usr/bin/pythonimport sys
import getopt
import re
import commandsdef main():
try:
opts, args = getopt.getopt(sys.argv[1:], “h” , [”help”])
except getopt.error, msg:
print msg
print “For help usr –help”
sys.exit(2)
# La orden geturls indica que todos los nombres isguientes son
# paquetes, el resultado es una lista con la URL de todos los
# deb necesarios para instalar los paquetes
if args[0] == “geturls” :
for pkg in args[1:]:
[a,out] = commands.getstatusoutput(’apt-get –print-uris -y install ‘ + pkg)
getURL(out)
def getURL(buffer):
results = []
buffer = buffer.split(’\n’)
for line in buffer:
url = re.search(”‘([A-Za-z0-9\-\./\:_]*)’”,line)
if url == None : continue
print url.group(1)if __name__ == “__main__”:
main()
Supongo, y es casi seguro, que tiene fallas. Si alguien sugiere alguna mejora o encuentra algun error, se lo agradecere.
Pero igual de momento sirve para lo que fue creado
[necudeco@kelthuzad naptitude]$ naptitude geturls tuxpaint
http://pe.archive.ubuntu.com/ubuntu/pool/main/t/tuxpaint-stamps/tuxpaint-stamps-default_2005.11.25-1ubuntu2_all.deb
http://pe.archive.ubuntu.com/ubuntu/pool/main/t/tuxpaint/tuxpaint-data_0.9.15b-1ubuntu4_all.deb
http://pe.archive.ubuntu.com/ubuntu/pool/main/t/tuxpaint/tuxpaint_0.9.15b-1ubuntu4_i386.deb
Como instalar sin red
Alguna vez has tenido que instalar paquetes en una PCDebian que no tenia conexion a internet? O en tu casa la conexion es desastrozamente lenta ?
Pues, usando este script podes obtener la lista de paquetes que debes bajar, irte a una cabina publica …
Trackback by meneame.net — June 7, 2006 @ 1:23 am
Debian (y por tanto ubuntu) ya tiene una herramienta para hacer precisamente esto. Se llama apt-zip.
Saludos
Comment by pnongrata — June 9, 2006 @ 8:44 am
Juaz me entere tarde .. pero no importa
!! Al menos me entretuve haciendola.
Comment by NeCuDeCo — June 9, 2006 @ 11:24 am