Advertisement
tutorfree

Script para atualização e remoção de pacotes e kernel antigo

Aug 24th, 2015
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. apt-get update
  4. apt-get dist-upgrade -y
  5. apt-get upgrade -y
  6. apt-get install -f
  7. apt-get autoclean
  8. apt-get autoremove -y
  9. apt-get clean
  10.  
  11. dpkg --purge `COLUMNS=300 dpkg -l "*" | egrep "^rc" | cut -d" " -f3`  
  12.  
  13. echo -n "# Removendo núcleos antigos..."
  14.  
  15. dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get --dry-run remove
  16. dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs
  17. sudo apt-get -y remove
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement