客製化 Ubuntu Mac Style myPrecise2015_0420 光碟

參考文件:Franklin ezgo 打包技術初窺探
1. 切換成 root
$ sudo su –

2. 安裝 squashfs-tools 套件
# apt-get install squashfs-tools

3. 建立 myPrecise 目錄
# mkdir myPrecise

4. 掛載 iso 光碟
# mount -o loop myPrecise2015_0420.iso myPrecise[@more@]
5. 複製 myPrecise 目錄成 iso.myPrecise 以進行修改作業
# cp -af myPrecise iso.myPrecise

6. 搬移 iso.myPrecise/casper/filesystem.squashfs 到現在的目錄之下
# mv iso.myPrecise/casper/filesystem.squashfs .

7. 解開 filesystem.squashfs
# unsquashfs -d os.myPrecise filesystem.squashfs

8. chroot 到 os.myPrecise 目錄之下,前置字元改成 /# 代表在 chroot 之下
# chroot ./os.myPrecise

9. 掛載目錄
/# mount -t proc none /proc
/# mount -t sysfs none /sys
/# mount -t devpts none /dev/pts

10. 增加 DNS Server 設定
/# echo “nameserver 168.95.1.1” > /etc/resolv.conf

11. 切換到 /etc/apt 目錄之下
/# cd /etc/apt

12. 修改套件庫來源
/# sed -ri ‘s/tw.archive.ubuntu.com/free.nchc.org.tw/g’ sources.list
/# sed -ri ‘s/archive.ubuntu.com/free.nchc.org.tw/g’ sources.list
/# sed -ri ‘s/security.ubuntu.com/free.nchc.org.tw/g’ sources.list

13 . 更新套件庫
/# apt-get update

14. 移除遊戲
/# apt-get remove –purge aisleriot gnome-games-data gnome-sudoku gnomine mahjongg

15. 移除 Apache OpenOffice
/# apt-get remove –purge openoffice-calc openoffice-core01 openoffice-debian-menus openoffice-ure openoffice.org-hyphenation

16. 安裝 LibreOffice
/# apt-get install libreoffice libreoffice-l10n-zh-tw
/# apt-get install libreoffice-style-crystal libreoffice-style-hicontrast libreoffice-style-oxygen

17. LibreOffice 功能表修改
/# rm -rf /etc/skel/.local/share/applications/openoffice4-*
/# rm -rf /etc/skel/.local/share/applications/libreoffice*
/# cd /usr/share/applications
/# cp libreoffice-base.desktop libreoffice-calc.desktop libreoffice-draw.desktop libreoffice-impress.desktop libreoffice-math.desktop libreoffice-writer.desktop /etc/skel/.local/share/applications

18. 移除 gimp
/# apt-get remove –purge gimp gimp-data gimp-data-extras gimp-help-common gimp-help-en gimp-resynthesizer libgimp2.0

19. 移除 inkscape
/# apt-get remove –purge inkscape-trunk
/# rm -rf /etc/skel/.local/share/applications/inkscape.desktop

20. 移除 Empathy
/# apt-get remove –purge empathy empathy-common nautilus-sendto-empathy

21. 移除 Gwibber
/# apt-get remove –purge gwibber gwibber-service gwibber-service-facebook gwibber-service-identica gwibber-service-twitter libgwibber-gtk2 libgwibber2

22. 移除 Pidgin
/# apt-get remove –purge pidgin pidgin-data pidgin-libnotify
/# rm -rf /etc/skel/.local/share/applications/pidgin.desktop

23. 移除 skype
/# apt-get remove –purge skype skype-bin

24. 移除 Brasero
/# apt-get remove –purge brasero brasero-cdrkit libbrasero-media3-1 rhythmbox-plugin-cdrecorder

25. 移除 k3b
/# apt-get remove –purge k3b k3b-data libk3b6 libk3b6-extracodecs
/# rm -rf /etc/skel/.local/share/applications/kde4-k3b.desktop
/# rm -rf /etc/skel/.local/share/applications/alacarte-made-3.desktop

26. 移除 network-manage 及設定
/# apt-get remove –purge network-manager network-manager-gnome network-manager-pptp network-manager-pptp-gnome
/# mv /etc/resolv.conf /run/resolvconf
/# ln -s /run/resolvconf/resolv.conf /etc/resolv.conf

27. 安裝 chromium 瀏覽器及 Flash
/# apt-get install chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg
/# apt-add-repository ppa:skunk/pepper-flash
/# apt-get update
/# apt-get install pepflashplugin-installer
/# sed -i ‘$a. /usr/lib/pepflashplugin-installer/pepflashplayer.sh’ /etc/chromium-browser/default

28. 安裝 Adobe PDF Reader
/# add-apt-repository “deb http://archive.canonical.com/ precise partner”
/# apt-get update
/# apt-get install acroread

29. 安裝 shutter 擷圖軟體
/# apt-get install shutter

30. 安裝 vim 和  leafpad 編輯器
/# apt-get install vim leafpad

31. 安裝自動切換背景軟體 variety
/# apt-get install variety

32. 不提示更新
/# sed -i ‘/Package-Lists/s/1/0/’ /etc/apt/apt.conf.d/10periodic
/# sed -i ‘s/Prompt=lts/Prompt=never/’ /etc/update-manager/release-upgrades

33. 善後工作
/# apt-get autoremove
/# apt-get autoclean
/# apt-get clean all

34 . 取消掛載目錄
/# umount -l /proc /sys /dev/pts

35. 退出 chroot
/# exit

36. 進行打包
# rm -rf iso.myPrecise/casper/filesystem.squashfs
# mksquashfs os.myPrecise iso.myPrecise/casper/filesystem.squashfs

37. 切換目錄
# cd iso.myPrecise

38. 產生 iso 光碟
# mkisofs -r -V “myPrecise” -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul -boot-load-size 4 -boot-info-table -o ../myPrecise2015_0511.iso .

39. 進行驗證