I have got Ubuntu and Kubuntu live CD ISO. I installed Ubuntu on My Machine. But I want to install kubuntu-desktop
package to try KDE. But this is a huge Internet download, which I do not afford. Can I use my existing Kubuntu-Live-CD to install kubuntu-desktop
package on my existing Ubuntu installation ?.
1 Answer
First make two directory to mount the iso and squashfs filesystem.
Part 1: Get all required deb files
Open the terminal and execute these :
mkdir /tmp/iso
mkdir /tmp/filesystem
Then mount the iso and the live filesystem inside the iso:
sudo mount -o loop <path-to-iso-file/kubuntu-12.04-desktop-i386.iso> /tmp/1
sudo mount -o loop /tmp/iso/casper/filesystem.squashfs /tmp/filesystem
Then make a directory to create all the dependencies of kubuntu-desktop package
mkdir ~/kubuntu-desktop-repacked
, I assume you have created this in your home directory.
Then issue this command in the terminal
sudo apt-get install kubuntu-desktop
and copy the packages name after the line The following NEW packages will be installed:
you can save the packages name in a new file.
Then generate all the required packages by this command, (make sure you are in a folder for repackaged files, in this case 'kubuntu-desktop-repacked' )
sudo dpkg-repack --root=/tmp/filesystem <all-the-names-of-packages-you-copied>
then press Enter, wait until it finishes.
Part 2: Create a local repository
Now you have all the deb files required for kubuntu-desktop
package. you need to install these packages now from your local computer, to do this, you need to setup a local repository.
Open a terminal and cd
to the folder where all the deb files reside. (here, kubuntu-desktop-repacked)
Now Issue this command in the terminal
apt-ftparchive packages . > Packages
This will create a file with the name Packages
which apt
will use to get information about your local repository.
Now open the /etc/apt/sources.list
file with administrative power, to inform apt
that you have a local repository with neccessary packages.
sudo gedit /etc/apt/sources.list
will open gedit with the files, it should have already many repository line already.
At the top of file, add the following line and save and close the file.
deb file:/home/<path-to-debs-folder> /
replace with the actual path in your newly repacked debs folder.
In this example this is /home/anwar/kubuntu-desktop-repacked
(My user name is anwar
, of course your's may be different).
Now issue this command in the terminal to install your desired package_(kubuntu-desktop)_
sudo apt-get install --allow-unauthenticated kubuntu-desktop
This will install all the packages.
Note 1: Trusted repository
This example uses an untrusted local repository, so we issue --allow-unauthenticated
switch to the apt-get
. You can create a trusted repository also for this same purpose. See the reference line below.
Reference: trusted repository.
Note 2: Still wants to download packages
If you still need to download some other packages, this can be the result of the updates of the online repository. If a package has an updated version on the online repository , the apt
system will try to install that package first. The solution is disable the main repository doing software-properties-gtk
command.
Open terminal, type sudo software-properties-gtk
and press Enter. Then remove the tick marks from main an universe repository. also disable the update repository in the updates tab
Then update the repository cache by doing this
sudo apt-get update
, you should now install package from your local repository.
Note 3: Showing broken dependency error
If you already installed some KDE software (usually starts with 'K' letter, such as kate
or kile
) and the installed softwares are updated version of the packages included in the Live CD, and You disables the main and universe repository from solution of Note 2, You will face a broken dependency error which says "Some packages depends on some other packages, but that packages cannot be installed".
To solve this you can try adding the -t <release>
switch to apt-get
command. such as
sudo apt-get install --allow-unauthenticated kubuntu-desktop -t precise
,
replace precise
with your release (oneiric, or natty, or lucid).
If this does not solves your problem, then enable the main and universe repository again. It will definitely download some packages (updated), but that download will not be huge.
Note 4: Installing dpkg-repack
If you do not have dpkg-repack
program, you can install it via terminal by simply issuing this
sudo apt-get install dpkg-repack
-
I tried this but the md5 of the rebuilt package didn't match with the original package offered by distribution. Is there anyway to rebuild the package with md5 matching.– user69286Nov 23, 2012 at 23:44
-
This isn't a problem because the packages are good enough. The md5sum didn't match and won't match because
dpkg-repack
put a custom line in the package descriptions. You can then create a local repository with these packages and install from them.– AnwarNov 24, 2012 at 13:50 -
yes. But i have a different situation. I'm trying to build an alternate cd from live cd through jigdo-lite. I need packages from live cd, so i used dpkg-repack to get the deb packages. But they don't match the original md5 (or hex) which is very essential for jigdo to recognise the files. That is why i want to have the same original package. Is it possible to remove what dpkg-repack adds to the package. And the file size built by dpkg-repack seems to be less than the original file. Totally confused..– user69286Nov 25, 2012 at 23:49
kubuntu-desktop
.... Wouldn't it be a better solution to just install Kubuntu?