Installing with apt-get to a different directory/external drive

Asked by Jackson on 2014-08-05

this is my first time on a forum so if i say posted in the wrong category please let me know or something else
I am running out of space on my ubuntu install of 14.04 with kernel 3.14.4
Ubuntu is installed on my Acer c720 chromebook

I need to change the download and install directory of apt-get or ubuntu software center to an external media
now i'm sure thats possible but is running the apps from said media possible?

i have about 30mbs left and i want to install spotify and steam
again sorry for typos or errors or missing info
im trying my best
Best regards
Jackson i.

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Last query:
Last reply:
Jackson (nevermindyou12) said : #1


Ubfan (ubfan1) said : #2

You really should consider freeing up some more space, but to answer your question, you can clean out /var/cache/apt/archives of all old deb files, then rename the archives directory to archives-save, an make a sym link to either external media or into ram with the ln command. For instance, you have mounted an empty USB in /media/user/xxx, so in /var/cache/apt,
sudo ln -s /media/username/xxx archives
Where username is your username (whereever the mount is).
Make a "partial" directory there just like the original archives directory had, and the downloads from apt-get install should be written to the mounted media. If you have a ramdisk set up, you could even write to ram (which will not keep the old deb files around after you reboot).
  Your other question "run from the media"... does not really apply, the install will be to the usual places in your filesystem. Of course, you could start moving pieces of your regular filesystem onto other media, and mount them in the original directory, but you probaby should just consider installing the whole system to a USB in that case.(assuming you can boot from it).

The folders must stay where they are. You can mount other filesystems to the folders that exist but the standard folders allow ease of development. Unlike Wimdows where you can choose a different folder where the data sits. If you have low space we can easily fix that. What is the output of:

sudo apt-get clean; lsb_release -a; una,e -a; dpkg -l | grep linux-image


Jackson (nevermindyou12) said : #4

this is the output of the commands

user@chrubuntu:~$ sudo apt-get clean
[sudo] password for user:
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
user@chrubuntu:~$ lsb_release -a; una,e -a; dpkg -l | grep linux-image
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
bash: una,e: command not found
ii linux-image-3.13.0-32-generic 3.13.0-32.57 i386 Linux kernel image for version 3.13.0 on 32 bit x86 SMP
ii linux-image-3.14.4-031404-generic 3.14.4-031404.201405130853 i386 Linux kernel image for version 3.14.4 on 32 bit x86 SMP
ii linux-image-extra-3.13.0-32-generic 3.13.0-32.57 i386 Linux kernel extra modules for version 3.13.0 on 32 bit x86 SMP
ii linux-image-generic i386 Generic Linux kernel image

Jackson (nevermindyou12) said : #5

sudo apt-get clean gave me a gb thanks but i still would love to be able to install say virtualbox with
sudo apt-get install /media/user/xxx virual box
AS EXAMPLE i know that will nto work

Its not how the Linux file system works. You can mount file systems to folders in the existing filesystem and they will install to the same location but will be on the new filesystem.

Jackson (nevermindyou12) said : #7

ok well thank you... apreaciate the help
atleast i got a gb free
any more suggestions to free more space on the file system?

Remove applications you don't need. Bleachbit can be used (carefully)

Can you help with this problem?

Provide an answer of your own, or ask Jackson for more information if necessary.

To post a message you must log in.