I have a Lubuntu persistent USB install. I started using it due to problems with my hard drive (Samsung 850 Evo) which used to have Ubuntu installed. My computer (MacBook Pro 9,2) had OSX but after a filesystem corruption I installed Ubuntu. Ubuntu became unbootable shortly after (literally a couple reboots). I formated the disk and decided to start using the live USB with persistence enabled.


I can't install more packages because I have almost no space left on my 4GB USB. I can perfectly mount the hard drive and store files there, read/write, etc. Is there a way to install the packages into the hard drive and turn /usr to a symlink to /mnt/mydrive ?

I don't care if it's a bad practice or something like that. I would like to know if it's feasible and if so, some instructions and/or recommendations on how to achieve it.


If you are ready to download and install package by package you can use dpkg option --instdir For more info what this do you can check with man dpkg

For apt I am not sure you have such option

  • So I should uninstall packages installed via apt, and reinstall them using dpkg with --instdir option? I'm also guessing that I need to add /mnt/mydrive to my $PATH. – Maganna Dev Nov 19 '18 at 15:46
  • @MagannaDev actually you need to add /mnt/mydrive/bin, /mnt/mydrive/sbin and so on. And to add in /etc/fstab this partition. And yes, you can deinstall and then install in new path. Also you should take care about libraries (LD_LIBRARY_PATH or whatever it is in Debian/Ubuntu) – Romeo Ninov Nov 19 '18 at 15:50
  • @MagannaDev, maybe you can simplify a lot by just buy 32GB flash drive :) – Romeo Ninov Nov 19 '18 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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