]> git.sur5r.net Git - bacula/rescue/blob - rescue/linux/oldusb/remaster/update_packages
5739e2c427a234951466a8e98e933641002c1072
[bacula/rescue] / rescue / linux / oldusb / remaster / update_packages
1 #!/bin/sh
2 #
3 # Update squashfs -- assumes you start with a Hardy 8.04.1 desktop,
4 #   but it should work even if you have already updated it.
5 #
6
7 if [ ! -d sqfs ] ; then
8   echo "Cannot find squashfs (sqfs directory)"
9   exit 1
10 fi
11 chroot sqfs /bin/sh
12 mount -t proc none /proc/
13 mount -t sysfs non /sys/
14 export HOME=/root
15
16 # remove packages
17 apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep language-pack | egrep -v '\-en'`
18 apt-get remove --purge `dpkg-query -W --showformat '${Package}\n' | grep openoffice\.org-`
19 apt-get remove --purge amarok dictionaries-common
20
21 cat >/etc/resolv.conf <<EOF
22 search sibbald.com
23 nameserver 192.168.68.254
24 nameserver 208.67.222.222
25 nameserver 208.67.220.220
26 EOF
27
28 cat >/etc/apt/sources.list <<EOF
29 deb http://archive.ubuntu.com/ubuntu/ hardy main restricted
30 deb http://archive.ubuntu.com/ubuntu/ hardy-updates main restricted
31 deb http://archive.ubuntu.com/ubuntu/ hardy universe
32 deb http://archive.ubuntu.com/ubuntu/ hardy-updates universe
33 deb http://archive.ubuntu.com/ubuntu/ hardy multiverse
34 deb http://archive.ubuntu.com/ubuntu/ hardy-security main restricted
35 deb http://archive.ubuntu.com/ubuntu/ hardy-security universe
36 deb http://archive.ubuntu.com/ubuntu/ hardy-security multiverse
37 deb http://archive.ubuntu.com/ubuntu/ hardy-updates multiverse
38 EOF
39 apt-get update
40 apt-get upgrade
41
42 # Add new packages
43 apt-get install openssh-server subversion kdetoys kicker-applets kgpg \
44   gftp firefox sg3-utils
45 apt-get install flashplugin-nonfree aircrack-ng g++ nvidia-glx-new \
46   gfxboot syslinux mtools
47 apt-get install sshfs kile kate lsscsi m4 mtx nfs-common \
48   nfs-kernel-server patch \
49   squashfs-tools strace sg3-utils screen scsiadd system-tools-backends \
50   telnet dpkg traceroute usbutils whois apt-file autofs busybox \
51   chkrootkit clamav dmidecode unrar
52
53 apt-get install linux-generic linux-headers-generic
54
55 # Add held back packages
56 apt-get install bind9-host dnsutils libbind9-30 libisccc30 libisccfg30 \
57   linux-generic linux-headers-generic linux-image-generic \
58   linux-restricted-modules-generic ssl-cert
59
60 # Remove old kernel
61 apt-get remove linux-headers-2.6.24-22 linux-headers-2.6.24-22-generic \
62   linux-image-2.6.24-22-generic linux-restricted-modules-2.6.24-22-generic \
63   linux-restricted-modules-2.6.24-22-generic linux-ubuntu-modules-2.6.24-22-generic
64
65 cd /
66 dpkg-query -W --showformat='${Package} ${Version}\n' >filesystem.manifest
67
68 apt-get clean
69 rm -rf /tmp/*
70 rm -f /etc/hosts /etc/resolv.conf
71 umount /proc/
72 umount /sys/
73 exit
74 cp sqfs/filesystem.manifest .
75 rm -f sqfs/filsystem.manifest
76
77 echo "Warning!!!! At this point, it may be better to reboot, since"
78 echo " upgrading packages may have restarted some daemons such as"
79 echo " cups, which uses sqfs/proc.  If you thn try to pack the sqfs"
80 echo " you will get lots of errors reference /proc.  Rebooting"
81 echo " resolves this problem."
82 echo " "