Building an offline version of Easy Ubuntu - EasyERUbuntu HOWTO

Motivation


easyerubuntu
Ubuntu has become a popular GNU/Linux distributions and has introduced many new users to the world of GNU/Linux and FOSS. Nevertheless, some felt that new users migrating would find it difficult not being able to perform certain functions such as play DVDs, listening to mp3 etc., even though the platform supports these functions. Getting these packages installed might not be trivial for some newbies even though much of the details has been well documented at http://ubuntuguide.org.

Easy Ubuntu was an attempt to provide a user-friendly front end that made it very easy to install several key packages that were missing in Ubuntu due to possible legal reasons. Unfortunately, the current stable version of Easy Ubuntu doesn’t support an offline mode. The development versions seemed to have a work-in-progress implementation for an offline mode, but that doesn’t seem to support the same user friendly GUI that is available during the network install.

EasyER Ubuntu (pronounced Easier Ubuntu) is an attempt to provide a companion CD for Ubuntu that uses a slightly modified version of Easy Ubuntu. Additionally, the CD is aptable, meaning you can add it as an apt resource using the apt-cdrom tool.

Here is how I made this CD:



Steps

  • Downloaded easyubuntu and ran the installer, selecting all packages.

  • Install any other packages. If you want you can use the option –download-only to prevent the package from being installed.


  • apt-get --download-only install foo

  • Installed apt-move utility and configured it so that it doesn’t actually delete the package cache (as a result of moving)


  • # apt-get install apt-move
    # vi /etc/apt-move.conf
    COPYONLY=yes

  • Created the local apt mirror directory


  • # rm -rf /mirrors/debian
    # mkdir -p /mirrors/debian

  • Ran apt-move to copy the debs from the apt archive


  • # apt-move -d dapper update

  • Because ubuntu repository structure, not all packages are inserted into the Packages.gz file by apt-move. We must remake Packages.gz with the help of apt-ftparchive.


  • # cd /mirrors/debian/dists/dapper
    # mkdir -p {non-free,contrib}/binary-i386

    For some reason the non-free and contrib directories were missing even though they were present at the /mirrors/debian/pool/ directory.

    # apt-ftparchive packages pool/main/ | gzip -9c > dists/dapper/main/binary-i386/Packages.gz
    # apt-ftparchive packages pool/multiverse/ | gzip -9c > dists/dapper/multiverse/binary-i386/Packages.gz
    # apt-ftparchive packages pool/contrib/ | gzip -9c > dists/dapper/contrib/binary-i386/Packages.gz
    # apt-ftparchive packages pool/non-free/ | gzip -9c > dists/dapper/non-free/binary-i386/Packages.gz

    Make sure that binary-i386/Release file exists and has the correct component entry.

    Archive: contrib
    Component: contrib
    Origin: APT-Move
    Label: APT-Move
    Architecture: i386

  • We need to remake the Release file so we first create a template apt configuration file called myapt.conf


  • APT::FTPArchive::Release {
    Origin "APT-Move";
    Label "APT-Move";
    Suite "dapper";
    Codename "dapper";
    Architectures "i386";
    Components "main multiverse contrib non-free";
    Description "Ubuntu Updates CD";
    };

    # rm dists/dapper/Release
    # apt-ftparchive -c ~/myapt.conf release dists/dapper/ > Release
    # mv Release dists/dapper/

  • Next we need to sign the Release file using out GPG key. But first we need to create our GPG key if it doesn’t already exist


  • # gpg --gen-key
    # gpg -bao dists/dapper/Release.gpg dists/dapper/Release

  • Next, we delete unwanted .apt-move directory


  • # rm -rf .apt-move

  • Next we need to identify the cd by making a .disk directory and making an info file in it.


  • # mkdir .disk
    # echo EasyERUbuntu `date +%Y-%m-%d` > .disk/info

  • Then we need to put our public keys in it.


  • # gpg --export -a "Your Name" > public.key


Easy Ubuntu Hack



  • Stop Easy Ubuntu from updating the conf/sources.list file by commenting out detect.replace(confdir) from easyubuntu.in


  • ###detect.replace(confdir)

  • Put a static sources.list line that only uses the CD ROM


  • deb cdrom:[EasyERUbuntu]/ dapper contrib main multiverse non-free


    where “EasyERUbuntu” is the label of the CD, which we define during mkisofs.

  • We can further modify the EasyUbuntu script to prevent it from running apt-get update on the CD everytime you install a package, which would cause an annoying error message .


  • Edit EasyUbuntu/gtkprocess.py and look for self.manager.remove(”–update-at-startup”) and comment it out. Also comment out the line synaptic.update()

    ### self.manager.remove("--update-at-startup") # EasyER Ubuntu Hack

    ### synaptic.update() # EasyER Ubuntu Hack


Thats it!

Burning and Using



  • Copy the modified easyubuntu directory to /mirrors/debian.


  • # tar zcvf /mirrors/debian/easyerubuntu.tar.gz easyubuntu

  • To create the iso


  • # mkisofs -r -A "EasyERUbuntu" -o ubuntu-companion.iso /mirrors/debian

  • Before you could use the CD, you need to add our GPG key to apt GPG keys


  • # apt-key add /cdrom/public.key

  • Finally add the CD as a source.


  • # apt-cdrom add

  • You can now extract the easyerubuntu.tar.gz from the CD to your home directory


  • $ mount /media/cdrom
    $ tar zxvf /media/cdrom/ubuntu.tar.gz

  • Now you can execute EasyERUbuntu


  • $ cd easyubuntu
    $ ./launchEU.sh


Issues: While most packages install properly, not all of them do. Most packages in the system tab don't work. These may require a bit more hacking to get working offline.

See Also: AptMoveHowto

Comments

Anonymous said…
Hi there,

I was bored and googling around, and came to your site. I am one of the devs of the easyubuntu program.

EasyUbuntu now has an "Offline Mode" which supports exactly this. However, most of the process is different.

The way we approached this was to create a script which would download the debs needed, and then we use dpkg-scanpackages to create the repository.

I do like the idea of optionally creating an iso, so I might just go ahead and implement it in the gui.
geekaholic said…
Sounds cool. Much check out the latest version.

Yes having an iso is very convenient for the few of us who dont always have broadband access and I think its easier for the newbie user if you distribute a 2 CD pack containing Ubuntu and EasyUbuntu.

Keep up the good work with EasyUbuntu
Anonymous said…
Budks,
How about
created mirror-debian-sarge
How to if source from 14CDs
Anonymous said…
But what if I have "all," i386, and i686 packages? How do I sort those correctly?

Popular posts from this blog

Why KDE4 (might) suck!

Track Your New Year Resolutions With ii.do

I want my CDMA! How my rights were violated.