Follow the steps below to clear up the disk space and remove unnecessary packages and versions.
Exclude specific versions and platforms
To stop mirroring specific Python versions of a package or operating system platforms of Python packages, you can use a configuration yaml file to target specific operating systems: win-32, win-64, linux-32, linux-64, OS X-32, osx-64 or specific Python versions: 2.6, 2.7, 3.3, 3.4, 3.5, 3.6 that you want to include in your Anaconda Repository mirror.
NOTE: This will not sync the existing versions already on your mirror and will not remove them.
To clean up a different channel such as conda-forge or R, see Mirroring Alternate Channels.
Removing the entire packages from your mirror
If there are packages you do not need, you can remove them from your mirror by adding them to the blacklist section.
Example:
channels:
- http://conda.anaconda.org/anaconda
blacklist:
- packagename1
- packagename 2
To start the sync and remove the packages, run the sync command with the --clean flag:
anaconda-server-sync-conda --mirror-config conda.yaml --clean
Removing specific versions and platforms of packages on your mirror
Certain packages have many builds in all versions and platforms which may take up a significant amount of disk space. To remove unwanted versions or platforms, you can use a combination of the platforms and python_versions entries.
NOTE: This will remove only a small number of packages and will not clean the entire mirror.
1. Blacklist the packages:
channels:
- http://conda.anaconda.org/anaconda
blacklist:
- packagename1
- packagename 2
2. Run the sync command with the --clean flag:
anaconda-server-sync-conda --mirror-config conda.yaml --clean
3. Add the appropriate filters now and remove the packages from the blacklist section.
The following example mirror only Python2.7 version for 64-bit Linux of the packages you would have previously removed:
channels:
- http://conda.anaconda.org/anaconda
platforms:
- linux-64
python_versions:
- 2.7
4. Run the sync command without --clean flag:
anaconda-server-sync-conda --mirror-config conda.yaml
Fresh mirror with desired package platforms and versions
Without Repository Downtime:
This is the best process to remove specific versions or platforms of many or all packages on your mirror. To prevent the down time of missing packages you will need enough disk space to temporarily duplicate the mirror size.
NOTE: This will take extra disk space but will be released after finishing.
1. The following example mirror only Python2.7 versions for 64-bit Linux of all packages:
channels:
- http://conda.anaconda.org/anaconda
platforms:
- linux-64
python_versions:
- 2.7
Start syncing the new curated mirror to an account named anaconda_new:
anaconda-server-sync-conda --mirror-config conda.yaml --account=anaconda_new
2. Go to your Anaconda Repository webpage and view this channel and make sure it synced.
3. Next swap the channels by moving the current anaconda channel to anaconda_old and then moving anaconda_new to anaconda:
anaconda-server-admin move-user anaconda anaconda_old
anaconda-server-admin move-user anaconda_new anaconda
You can check the Repository webpage to make sure everything is working as expected.
4. Next set the password for anaconda_old so you can delete the channel:
anaconda-server-admin reset-password anaconda_old
5. Replace anaconda_old and anaconda_new with your Anaconda Repository usernames.
Now log into the Repository web portal as anaconda_old. After logging in, click the anaconda_old username in the upper right, and then select Settings -> My Account -> Delete to delete your account and all data permanently.
With Repository Downtime:
If downtime of the mirror is not a concern, do the following steps to remove the entire mirrored channel and sync again using the configured yaml file.
1. Set the password for the anaconda channel:
anaconda-server-admin reset-password anaconda
2. Log into the Repository web portal as anaconda. After logging in, click the anaconda_old username in the upper right, and then select Settings -> My Account -> Delete to delete your account and all data permanently.
3. The following example mirror only Python2.7 versions for 64-bit Linux of all packages:
channels:
- http://conda.anaconda.org/anaconda
platforms:
- linux-64
python_versions:
- 2.7
Start the mirroring process using your configured yaml file:
anaconda-server-sync-conda --mirror-config conda.yaml