Featured image of post Ver Diferentes Paquetes

Ver Diferentes Paquetes

PC 1 (FUNCIONAL)

Sistemas basados en Debian

1
2
#coger todas los paquetes instalados que no sean librerías o common 
dpkg --get-selections | grep -v deinstall  | awk '{print $1}' | egrep -v '^lib.*|common' > i5.tmp

Sistemas basados en Fedora

1
dnf list installed | awk '{print $1}' | egrep -v '^lib.*|common' > i5.tmp

PC 2 (RECIÉN INSTALADO)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#!/bin/bash

#coger todas los paquetes instalados que no sean librerías o common 
dpkg --get-selections | grep -v deinstall  | awk '{print $1}' | egrep -v '^lib.*|common' > i7.tmp

diff i5.tmp i7.tmp > test.tmp

#limpieza de lineas innecesarias creadas por diff
#egrep -v '[0-9]+[a-z]+[0-9]+' test.tmp > test2.tmp # otra forma de sacar las diferencias
sed -Ei '/[0-9]+[a-z]+[0-9]+|> |---/d' test.tmp # con -e no funciona, investigar

# poner los sudo
sed -i 's/< /sudo apt-get -y install /g' test.tmp

bash test.tmp

EN UN FUTURO HACER UN SCRIPT PASANDO PARÁMETRO PARA HACER USARLO

script.py -p origen script.py -p destino script.py -o instalar

comments powered by Disqus
Esto es el footer
Creado con Hugo
Tema Stack diseñado por Jimmy