Skip to content

Commit

Permalink
Added kernel and kernel headers to apt-get upgrade command.
Browse files Browse the repository at this point in the history
  • Loading branch information
reneoelke authored and Julian C. Dunn committed Jul 31, 2014
1 parent 6825f15 commit ed086b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packer/scripts/ubuntu/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash -eux
#

# delete all linux headers
dpkg --list | awk '{ print $2 }' | grep linux-headers | xargs apt-get -y purge

# this removes specific linux kernels, such as
# linux-image-3.11.0-15-generic but
# * keeps the current kernel
# * does not touch the virtual packages, e.g.'linux-image-generic', etc.
#
dpkg --list | awk '{ print $2 }' | grep 'linux-image-3.*-generic' | grep -v `uname -r` | xargs apt-get -y purge

# delete all linux headers
dpkg --list | awk '{ print $2 }' | grep linux-headers | xargs apt-get -y purge

# delete linux source
dpkg --list | awk '{ print $2 }' | grep linux-source | xargs apt-get -y purge

Expand Down
5 changes: 4 additions & 1 deletion packer/scripts/ubuntu/update.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash -eux

# Update the package list
apt-get update
apt-get -y upgrade

# Upgrade all installed packages incl. kernel and kernel headers
apt-get -y upgrade linux-server linux-headers-server

# ensure the correct kernel headers are installed
apt-get -y install linux-headers-$(uname -r)
Expand Down

0 comments on commit ed086b9

Please sign in to comment.