Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to ubuntu DIY a ubuntu distribution of your own

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "how to ubuntu DIY a ubuntu release of your own". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to ubuntu DIY a ubuntu release of your own.

$export WORK=~/diy_ubuntu

$mkdir-p $WORK

Then we hang the CD image file to / mnt

$sudo mount-t iso9660-o loop dapper-live-i386.iso / mnt

$cd $WORK

Copy files CD files

$mkdir ubuntu-livecd

$cp-a / mnt/. Ubuntu-livecd

$chmod-R Uttw ubuntu-livecd

$sudo umount / mnt

Since the CD contains a lot of free software under windows, let's delete unnecessary files. Of course you can keep it.

$rm-rf $WORK/ubuntu-livecd/programs

Hang up the compressed files on the CD so that you can see a complete linux operating system directory in the $WORK/old directory later.

$mkdir $WORK/old

$sudo mount-t squashfs-o loop,ro $WORK/ubuntu-livecd/casper/filesystem.squashfs $WORK/old

We set up a 2GB-sized file system, then format the file as a device file, and the system gives a warning, ignore it, and choose yes.

$sudo dd if=/dev/zero of=$WORK/ubuntu-fs.ext2 bs=1M count=2147

$sudo mke2fs $WORK/ubuntu-fs.ext2

Then we hang up the empty file system.

$mkdir $WORK/new

$sudo mount-o loop $WORK/ubuntu-fs.ext2 $WORK/new

Copy files from the linux operating system. Since the linux we got in advance is compressed, we decompressed it.

$sudo cp-a $WORK/old/. $WORK/new

Of course, $WORK/old is of no use now. Scrap it.

$sudo umount $WORK/old

First of all, let's get into the operating system we just got.

$sudo cp / etc/resolv.conf $WORK/new/etc/

$sudo mount-t proc-o bind / proc $WORK/new/proc

$sudo chroot $WORK/new / bin/bash

Now you are in the system, shouting linux for human beings, refining ubuntu, and doing whatever you want.

# vi / etc/apt/sources.list # choose the source that suits you

# apt-get update

# apt-get dist-upgrade

# apt-get install the software you want to install

# apt-get clean

.... # more configurations

* leave your operating system

# exit

$sudo umount $WORK/new/proc

$sudo rm $WORK/new/etc/resolv.conf

Now you're back to your original state.

Reorganize the manifest.

$sudo chroot $WORK/new dpkg-query-W-- showformat='$ {Package} ${Version}\ n'> $WORK/ubuntu-livecd/casper/filesystem.manifest

Then do a "disk cleanup".

$sudo dd if=/dev/zero of=$WORK/new/dummyfile

$sudo rm $WORK/new/dummyfile

Recompress the system

$sudo rm $WORK/ubuntu-livecd/casper/filesystem.squashfs

$cd $WORK/new

$sudo mksquashfs. $WORK/ubuntu-livecd/casper/filesystem.squashfs

All your changes have been saved. Now get rid of $WORK/new.

$cd $WORK

$sudo umount $WORK/new

Recalculate the md5 of the file

$cd $WORK/ubuntu-livecd

$sudo find. -type f-print0 | xargs-0 md5sum | sudo tee md5sum.txt

Set up a CD image, the command is very long, put up with it.

$cd $WORK

$sudo mkisofs-o ubuntu-new.iso-b isolinux/isolinux.bin-c isolinux/boot.cat-no-emul-boot-boot-load-size 4-boot-info-table-r-V "My Cool Ubuntu Live CD"-cache-inodes-J-l ubuntu-livecd

Then you can burn the CD with iso.

At this point, I believe you have a deeper understanding of "how to ubuntu DIY a ubuntu release of your own". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report