实验了网上介绍的remastersys,utk等,有些找不到安装包,有些不再支持,有些定制不够彻底,有些制作的iso文件不能用。最后找到以下方法可以用,介绍如下。主要还是ubuntu官网上的介绍。附上参考网页:
参考网页有:
https://help.ubuntu.com/community/LiveCDCustomization
https://www.douban.com/note/362271457/1,安装必要的工具
“
sudoapt install squashfs-tools genisoimage
”
2将基准安装iso文件复制移动到一个文件夹内:
“
mkdir~/livecdtmp
mvubuntu-14.04.4-desktop-amd64.iso ~/livecdtmp
cd~/livecdtmp
”
3挂载iso文件
“
mkdirmnt
sudomount -o loop ubuntu-14.04.4-desktop-amd64.iso mnt
”
4提取iso文件到指定文件extract-cd内
“
mkdirextract-cd
sudorsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
”
5解压iso系统文件并保存到edit文件夹内
“
sudounsquashfs mnt/casper/filesystem.squashfs
sudomv squashfs-root edit
”
6连接网络
“
sudocp /etc/resolv.conf edit/etc/
sudomount -o bind /run/ edit/run
sudocp /etc/hosts edit/etc/
”
7挂载某些文件设备
“
sudomount --bind /dev/ edit/dev
sudochroot edit
mount-t proc none /proc
mount-t sysfs none /sys
mount-t devpts none /dev/pts
”
8设置参数
“
exportHOME=/root
exportLC_ALL=C
”
9准备修改软件
“
dbus-uuidgen> /var/lib/dbus/machine-id
dpkg-divert--local --rename --add /sbin/initctl
ln-s /bin/true /sbin/initctl
”
10显示所有安装包
“
dpkg-query-W --showformat='${Installed-Size}\t${Package}\n' | sort -nr | less
”
11更新软件源
11.1首先备份/etc/apt/source.list
11.2替换source.list文件内容(最好替换为国内的源)
“
debhttp://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricteduniverse
debhttp://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverserestricted universe
debhttp://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverserestricted universe
debhttp://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverserestricted universe
debhttp://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverserestricted universe
deb-srchttp://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricteduniverse
deb-srchttp://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverserestricted universe
deb-srchttp://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverserestricted universe
12更新源并安装自己需要的软件包
12.1安装需要的软件包
“
sudo apt-get update
sudo apt-get install ****
”
12.2 删除不需要的软件包
"
aptitude purge ***
"
13
“
aptitudeclean
rm-rf /tmp/*
rm/etc/hosts
rm/var/lib/dbus/machine-id
rm/sbin/initctl
dpkg-divert--rename --remove /sbin/initctl
umount/proc || umount -lf /proc
umount/sys
umount/dev/pts
Exit
sudoumount edit/dev
”
14 daba
“
Sudochmod +w extract-cd/casper/filesystem.manifest
Sudosu
chrootedit dpkg-query -W --showformat='${Package} ${Version}\n' >extract-cd/casper/filesystem.manifest
Exit
sudocp extract-cd/casper/filesystem.manifestextract-cd/casper/filesystem.manifest-desktop
sudosed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
sudosed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop
”
15 compress filesystem
“
sudorm extract-cd/casper/filesystem.squashfs
sudomksquashfs edit extract-cd/casper/filesystem.squashfs
”
16
“
sudosu
printf$(du -sx --block-size=1 edit | cut -f1) >extract-cd/casper/filesystem.size
exit
”
17
“
cdextract-cd
sudorm md5sum.txt
find-type f -print0 | sudo xargs -0 md5sum | grep -v isolinux/boot.cat |sudo tee md5sum.txt
”
18
create iso image
“
sudomkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -bisolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot-boot-load-size 4 -boot-info-table -o../myubuntu-14.04.4-desktop-amd64.iso .
”
19烧写到u盘
利用startupdisk creator软件,将iso文件烧写到u盘中。