How To Create an Update CD or DVD
By cogDis
Purpose:
The purpose of this document is to demonstrate the steps involved in creating a custom built CD that contains the necessary packages to perform a system wide update of a .92 or .93 PCLOS installation. The main intent is to provide those users who have limited or no Internet connectivity, a means to keep their systems up to date.
Requirements:
1. A listing of the installed packages from the computer to be upgraded. This is a text file that we will create in step one, copied to a floppy, CDROM, or other removable device, that can be transported to the host machine used to create the Update CD.
2. A host computer with an Internet connection (the faster, the better) capable of booting and running a PCLOS .92, or .93 Live CD.
3. The computer used to create the Update CD must have some type of writable storage, of sufficient size, to temporarily store the downloaded package updates. Currently, this is approximately 560MB for a complete update of a basic .92 install or 600MB for a standard .93 install. Your mileage may vary, dependent upon the requirements of the system you intend to update. This storage can be a writable partition on the host computer, or some type of external storage device, such as a USB hard drive, or flash drive.
4. If the host computer has a spare CDRW drive that isn't being occupied by the Live CD, the entire operation, including the burning of the actual Update CD, can be done from within the Live CD session. However, as the Live CD cannot be removed during the session, the lack of a spare burner will require that the created archive be moved to another PC for burning, or moved to a partition on the host computer that is accessible by another OS capable of burning the desired disc.
The steps:
I'll describe the steps involved, in order, with the commands used, supplemented with actual examples from my own system, where possible.
1. Create the package listing on the computer being updated. The first step is to create a list of packages present on the system you wish to update. This package list will be taken to the host computer, where it will be loaded into Synaptic. In a terminal, execute the following command:
rpm -qa --qf '%{NAME}\n'|sed -e /kernel*/d -e /gpg*/d -e 's/$/ install/'| sort >installed.txt
This will create a file in your home folder called installed.txt. If you need to perform these next steps on another computer, you will need to copy this file to some type of removable media, and take it with you to step 2.
2. Boot the host system with the PCLOS .92, or.93 Live CD.
3. Mount the writable storage device that will be used to temporarily store the downloaded packages. This can be done with Konqueror by selecting Go > Storage Media, and selecting the partition or device, or with the mount command. In my case, I have a spare partition, /dev/sda5, that I will mount manually. In a root terminal execute:
mount /dev/sda5 /mnt/sda5
This mounts the partition into the filesystem in the location /mnt/sda5, and makes it available for use. If you use the Konqueror method, pay attention to the location the device gets mounted, as you will need to refer to it later.
4. Next, we need to remove the default location that Synaptic uses to cache downloaded packages. We cannot use this location in the Live CD environment due to the large number of packages that must be downloaded. To do this, execute in a root terminal the command:
rm -rf /var/cache/apt/archives
5. Now create the storage folders on the storage device for Synaptic to use. For this, use the command:
mkdir -p /path-to your storage device /archives/partial
In this example, in a root terminal execute:
mkdir -p /mnt/sda5/archives/partial
6. Now create a link to the storage folders, in the place that Synaptic expects to find it. For this use the command:
ln -s /path_to_your_storage_device/archives /var/cache/apt/archives
The example looks like this: As root:
ln -s /mnt/sda5/archives /var/cache/apt/archives
6. Next, mount the media that contains your "installed.txt" file. Then start Synaptic, and if prompted to update your repositories, select cancel. From Synaptic's settings menu, select repositories. Make sure that ibiblio, or one of its mirrors is selected (only one), and that the sections box reads "os texstar updates (for .92) or "os texstar updates 93" (for any .93 version.) Note: If the system you wish to update has had any packages installed from the unstable section, you should add it after "os texstar updates" or "os texstar updates 93" in the sections box, so those packages will be updated also.
Click "okay" to leave the dialog. From the Settings menu, select Preferences, then on the Temporary Files Tab, check the box that corresponds to "leave all downloads in cache." Click "okay" to exit the dialog.
Click the Reload button to update the package listings. Select "Read Markings" from the File menu, and point the dialog to the installed.txt file you brought with you. This will load the package list. Click Apply. In the summary dialog, check the box that says "download files only." Click Apply (in the dialog), and the downloading of package files will commence. Dependent upon connection speed, this could take some time to complete. Once completed, any additional packages that you would like to be included in the Update CD can be marked and downloaded as well. Just pay attention to the capacity of your media.
7. Once the downloads have completed, create the directory structure of the update CD. Use the command:
mkdir -p /path_to_your_storage_device/pclinuxos/2006/RPMS.uucd
Example, as root:
mkdir -p /mnt/sda5/pclinuxos/2006/RPMS.uucd
BIG NOTE: The RPMS folder name must be in uppercase, and have an extension. Any extension will do, but without it, the genbasedir command you will run in step 9 will fail.
8. Next, copy the downloaded files from Synaptic's cache, to the newly created directory structure. Use this command:
cp -v /path_to_your_storage_device/archives/*.rpm /path_to_your_storage_device /pclinuxos /2006 /RPMS.uucd
In the example, as root:
cp -v /mnt/sda5/archives/*.rpm /mnt/sda5/pclinuxos/2006/RPMS.uucd
9. Navigate to the RPMS.uucd folder, using the command:
cd /path_to_your_storage_device/pclinuxos/2006/RPMS.uucd
In the example, as root:
cd /mnt/sda5/pclinuxos/2006/RPMS.uucd
Once there, build the package lists for Synaptic to use. As root, from within the RPMS folder, we enter the following command:
genbasedir --flat --bz2only --progress /mnt/sda5/pclinuxos/2006
10. That is it. If you have a spare burner that is not being used by the Live CD, you can fire-up K3B and burn the /pclinuxos folder and all it contains to disc. If not, you will need to reboot the machine with another installed OS that has access to the storage partition, and burn it there, or migrate the folder to another machine that has this capability. If you used a removable storage device, then you can unplug it and take it with you.
Once the Update CD has been created, you can use Synaptic to install its contents. Start Synaptic on the machine you wish to upgrade, and disable the on-line repositories. From the Edit Menu, select "Add CD-ROM." When prompted, insert the Update CD in the drive and click okay. A dialog will appear asking you to give the disc a name. Call it anything you want. Once it is loaded, click Mark all Upgrades and apply, and within a matter of minutes your machine will be fully updated. It is advised that you reboot after updating, as many critical system packages will be installed in this process, and they need the chance to be reloaded. If you wish to have the entire repository on hand, we can burn a "snapshot" to either a dual layer, or 2 single layer DVDs. We'll cover that next.
How To Create an PCLOS DVD Synaptic Repository (snapshot)
Purpose:
The purpose of this document is to describe the steps necessary to create a complete PCLOS Repository on DVD, for the purposes of upgrading and/or installing additional software on PCLOS users' machines that have limited, or no Internet connectivity.
Requirements:
1. A Linux machine with a fast Internet connection and the ability to download and store upwards of 5GB of data.
2. The ability to burn either a Dual layer (preferred), or Single Layer DVD.
The Steps:
1. Create a working directory. You will need to create a folder to store the downloaded files, in a place that you have write access to. For example purposes, we will assume that your username is billybob, and you want to create a folder called pclosmirror in your home directory. In a terminal, execute the following command:
mkdir /home/billybob/pclosmirror
2. Copy the apt repository from ibiblio to your working directory. For this we will use rsync. Rsync will create an exact mirror of the PCLOS apt repository. The first time you run the command, it will download approximately 5GB of data! Depending upon the speed of your Internet connection, this can take quite some time. I generally let it run overnight. The server load should be less at this time. Once you have run this command the first time, on subsequent attempts, it will only download those files that have changed since the last time it was run. This makes maintaining a current repository fairly quick, and reduces bandwidth usage. The following code excludes the experimental (exp) section as well as the sources, from transfer. If you wish to include those, remove the --exclude options from the command string. Be aware of the effect that adding these sections will have on your repository size! Execute the following command in a terminal:
rsync -av --progress --delete --exclude=RPMS.exp/ --exclude=SRPM*/ distro.ibiblio.org::texstar/pclinuxos/apt/ /home/billybob/pclosmirror
3. Burning a Dual Layer DVD: If you have the capability of burning a Dual Layer DVD (DL), then fire up K3B and start a new DATA DVD session. Right click at the bottom of the K3B window and select 8.0 GB from the Media type menu. Then, simply drag the /pclinuxos folder and all of its contents to the creation window. This folder will be in the root of the working directory you created in step 1. Burn at a moderate speed (4-6x), and select "verify written data." When finished, you will have a complete PCLOS repository mirror, on disc, that can be used with Synaptic.
Simply start Synaptic, disable your on-line repositories from the Settings menu, then select "Add CD-ROM" from the Edit menu. Put your disc in the drive, click Okay, and give the disc a name when prompted. It can be any name you wish. The disc will load, and you will be able to upgrade, or install new packages with no Internet connectivity required. Big Note: This disc will include the .92 or .93 repositories, and the unstable sections, unless they were explicitly excluded with the rsync command string. If you do not wish to use packages from these two sections, then you MUST remove the listings in Synaptic. To do this, select repositories from the settings menu, highlight the line pertaining to your DVD repository, and remove 93 and unstable from the sections box.
4. If you cannot burn a DL Disc: You will need to use 2 single layer discs and split up the repository files, as they are too big to fit on one SL Disc. I find this easiest to do from within K3B itself. To create the first disc, as in step 3 above, start a new DATA DVD Project with K3B. Drag and drop the /pclinuxos folder from your working directory into the creation window. You will notice the indicator bar turning red, indicating the data you have selected is too large to fit on the single sided media. That is okay, as we are going to remove some things. In the left hand pane of the creation window, drill down in the directory tree until the contents of the 2004 folder are visible. Remove all of the /RPMS folders EXCEPT /RPMS.os. Then, open the /base folder, and remove all files EXCEPT those pertaining to the os section. You will want to keep the following files only: release, release.os, pkglist.os.bz2, and srclist.os.bz2. Then, burn the project and label the disc DVD1 for future reference.
To create Disc 2, we repeat the previous process of dragging the /pclinuxos folder to the DVD creation window. Then remove the /RPMS.os folder from /2004 and the files: release.os, pkglist.os.bz2, and srclist.os.bz2 from the /base folder. Burn the disc and label it DVD2.
Start Synaptic, disable your on-line repositories and select "Add CD-ROM" from the edit menu. Insert DVD1 and name it DVD1 when prompted. Synaptic will ask if you wish to add another Disc. Select yes, then insert DVD2. Name it DVD2 when prompted. You are now ready to update or install new packages. Synaptic will copy your selected packages from disc, and prompt you when it needs files from the disc that is not in the drive. Again see Big Note above. The .93 and unstable sections will be on DVD2 in this case.
That is all there is to do. Whether you only want to keep your system updated, or have the complete PCLOS repository on hand, you now have everything you need. What a nice way to bring in the new year!