Score:4

How to move .julia folder to another partition in Ubuntu?

us flag

I use the Julia programming language on a Chromebook with only 32 GB internal storage.

The .julia directory in the home folder consumes several gigabytes of space. This directory contains all the julia packages (similar to python libraries), and it is essential for Julia to use those packages.

I have a microSD card with a lot of free space. How do I move the .julia directory to the microSD card?

I am using Kubuntu 23.04.

us flag
The same method can be applied to large hidden directories like `.config`, `.cache`, or `.mozilla`.
Score:4
us flag

First, create ext4 partition in the microSD card (if you already didn't), and configure the partition to be mounted automatically at startup. Ensure that you have write access to the ext4 partition (without requiring sudo).

For me, that partition is mounted at /mnt/SDCard/.

Now, create a directory julia_dir in that partition.

cd /mnt/SDCard
mkdir julia_dir

Now, there are two options. Adding an environment variable, or symlinking (you can use either depending on your choice).

Method 1

Move the contents of .julia to SDCard, and set the environment variable JULIA_DEPOT_PATH=/mnt/SDCard/julia_dir

mv ~/.julia /mnt/SDCard/julia_dir
echo 'export JULIA_DEPOT_PATH=/mnt/SDCard/julia_dir' >> ~/.bashrc
source .bashrc

Method 2

Move the contents of .julia to SDCard, and symlink.

mv ~/.julia /mnt/SDCard/julia_dir
ln -s /mnt/SDCard/julia_dir/ /home/your-username/.julia

Afterwards, Julia would use /mnt/SDCard/julia_dir/ in the microSD card to store and access its packages.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.