Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a GuruPlug computer with an external HDD mounted. I would like to set up Gnome and try to access it via remote desktop. My first roadblock is installing Gnome. I tried running sudo apt-get install gnome and I got this message:

Need to get 681MB of archives.
After this operation, 1758MB of additional disk space will be used.
E: You don't have enough free space in /var/cache/apt/archives/.

Is it even possible to install Gnome on my external hard drive. If so, how?

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                 251M     0  251M   0% /lib/init/rw
udev                   10M  696K  9.4M   7% /dev
tmpfs                 251M  4.0K  251M   1% /dev/shm
rootfs                463M  237M  226M  52% /
tmpfs                 251M   48M  204M  20% /var/cache/apt
//10.0.1.1/Elements   2.8T  1.2T  1.6T  42% /mnt/ExternalHDD
share|improve this question
    
What distribution are you using? Debian itself and most derivatives aren't designed to install programs in different locations. Your best bet would be to use a union mount, so that both the internal disk and the external disk appear in the same location, with writes going to the external disk. There are probably tutorials on the web for this. (Anyone feel free to post an actual how-to answer that uses union mounts; if no one does I might come back to do it in a few days.) –  Gilles Aug 16 '12 at 1:36

2 Answers 2

You have a debian-base GNU/Linux such as Ubuntu, Xubuntu , or itself Debian. When you install, upgrade application under these systems, apt-get command download your packages in /var/cache/apt/archives/ path, Now you need : attach a new hdd and mount to the given path, then run your command.

share|improve this answer
    
That's no use: the installed program won't fit on the root filesystem either. –  Gilles Aug 16 '12 at 1:33

The nice and perfect way would be to have a modified apt.conf file so that sudo apt-get -c myapt.conf install gnome does what you want. It can be done but the apt documentation is not straight forward for a quick lookup. Unionmounts on root filesystems are rather tedious as well and I will gladly let Gilles write the howto on that one. :-)

As your computer as "Plug" in its name I think installing Gnome into your real OS is not a good idea b/c if it turns out you don't want that Gnome installation on your computer I wouldn't even trust Debian to be able to revert your OS to the state it has right now.

Installing Gnome into a chroot environment

To try it out I would set up a change root environment on your external HDD to try out Gnome. To do that you need to install debootstrap on your real OS but that's not a big program: apt-get install debootstrap. Then you setup a directory where you want your Gnome installation, install a basic debian, make that debian a clone of your current OS and then install Gnome on top:

mkdir -p /mnt/ExternalHDD/whereever/you/want/Gnome #create target directoy
debootstrap squeeze /mnt/ExternalHDD/whereever/you/want/Gnome #install basic debian, choose your own distro/suite
mount -t proc fooproc /mnt/ExternalHDD/whereever/you/want/Gnome/proc #set up chroot environment
mount -t sysfs foosysfs /mnt/ExternalHDD/whereever/you/want/Gnome/sys #set up chroot environment
mount -o bind /dev /mnt/ExternalHDD/whereever/you/want/Gnome/dev #set up chroot environment
mount -t devpts foodevpts /mnt/ExternalHDD/whereever/you/want/Gnome/dev/pts #set up chroot environment
cp /etc/resolv.conf /mnt/ExternalHDD/whereever/you/want/Gnome/etc #nice to have
cp /etc/hosts /mnt/ExternalHDD/whereever/you/want/Gnome/etc #nice to have
cp /etc/hostname /mnt/ExternalHDD/whereever/you/want/Gnome/etc #nice to have

Now we have a basic debian installation in your target directory which is ready to be used. It is important that you used debootstrap to install the very same Linux distro (including Version!) as your real OS is. Please refer to the manpage of debootstrap on the available options. Basically debootstrap can install any Linux, as long as it uses a proper debian-style repository. This should be the case for any distro that uses deb-Packages.

Now we want to make it similar to you real OS and then install Gnome. The following lines may be a little unintuitive (and my include syntax errors, YMMV) ...

dpkg --get-selections | grep -v deinstall | awk '{print $1;}' |\
     xargs chroot /mnt/ExternalHDD/whereever/you/want/Gnome \
           /bin/bash -l -c aptitude -y install
cp -a /etc/* /mnt/ExternalHDD/whereever/you/want/Gnome/etc
chroot /mnt/ExternalHDD/whereever/you/want/Gnome \
       /bin/bash -l -c aptitude install gnome

Now there should be a nice Gnome installation on your external harddrive. Please note that you will have to do the mount-magic and copy /etc/resolv.conf ON EVERY BOOT. Otherwise programs run in the chroot environment will not always work properly.

Making Gnome accessible

Now for the using part! AFAIK there aren't any free "remote desktop" Xservers but XDMCP works just fine and for a more complex setup you can use x2go. Having installed Gnome to our chroot environment we now just need to configure and start the Gnome display manager. The basic steps are 1. locating gdm.conf in the chroot directory (likely /mnt/externalHDD/.../etc/gdm/gdm.conf), 2. enabling XDMCP, 3. starting gdm.

I trust you can do step 1 by yourself. For step 2 you need add

[xdmcp]
Enable=true

to the gdm.conf. For more options please refer to the documentation. For step 3 it is important that the chroot environment is set up properly (all the mounts above). Then a simple chroot /path/to/Gnome /bin/bash -l -c /etc/init.d/gdm start should do the trick. However, recent Linux distributions may use something different than scripts in etc/init.d to control services. This is specific to your distribution. After that you can connect to the gdm on your computer with any Xserver.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.