|
| 1 | +--- |
| 2 | +title: "Disable or move the package cache | Microsoft Docs" |
| 3 | +description: "Disable, enable, or move the package cache for Visual Studio deployments." |
| 4 | +ms.date: "04/14/2017" |
| 5 | +ms.reviewer: "" |
| 6 | +ms.suite: "" |
| 7 | +ms.technology: |
| 8 | + - "vs-ide-install" |
| 9 | +ms.tgt_pltfrm: "" |
| 10 | +ms.topic: "article" |
| 11 | +f1_keywords: |
| 12 | + - "cache" |
| 13 | + - "nocache" |
| 14 | +helpviewer_keywords: |
| 15 | + - "{{PLACEHOLDER}}" |
| 16 | + - "{{PLACEHOLDER}}" |
| 17 | +ms.assetid: 2429993A-3F0E-41C5-9562-FEA6AE994440 |
| 18 | +author: "heaths" |
| 19 | +ms.author: "heaths" |
| 20 | +manager: "ghogen" |
| 21 | +translation.priority.ht: |
| 22 | + - "de-de" |
| 23 | + - "es-es" |
| 24 | + - "fr-fr" |
| 25 | + - "it-it" |
| 26 | + - "ja-jp" |
| 27 | + - "ko-kr" |
| 28 | + - "ru-ru" |
| 29 | + - "zh-cn" |
| 30 | + - "zh-tw" |
| 31 | +translation.priority.mt: |
| 32 | + - "cs-cz" |
| 33 | + - "pl-pl" |
| 34 | + - "pt-br" |
| 35 | + - "tr-tr" |
| 36 | +--- |
| 37 | +# Disable or move the package cache |
| 38 | + |
| 39 | +The package cache provides a source of installed packages in case you need to repair Visual Studio or other related products in cases |
| 40 | +where you have no Internet connection. With some drives or system set ups, however, you may not want to keep all those packages around. |
| 41 | +The installer will download them when needed, so if you want to save or recover disk space you can disable or move the package cache. |
| 42 | + |
| 43 | +## Disable the package cache |
| 44 | + |
| 45 | +Before you install, modify, or repair Visual Studio or other products with the new installer, you can start the installer with the |
| 46 | +`--nocache` switch to the installer. |
| 47 | + |
| 48 | +```batch |
| 49 | +"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vs_installer.exe" --nocache |
| 50 | +``` |
| 51 | + |
| 52 | +Any operation you do on any product will remove any existing packages for that product and will avoid saving any packages after they |
| 53 | +are installed. If you modify or repair Visual Studio and packages are required, they will be downloaded automatically and removed after |
| 54 | +they are installed. |
| 55 | + |
| 56 | +If you want to re-enable the cache, pass `--cache` instead. Only packages that are required will be cached, so if you need to restore |
| 57 | +all packages you should repair Visual Studio before you disconnect from your network. |
| 58 | + |
| 59 | +```batch |
| 60 | +"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vs_installer.exe" repair --passive --norestart --cache |
| 61 | +``` |
| 62 | + |
| 63 | +You can also set the `KeepDownloadedPayloads` [registry policy](set-defaults-for-enterprise-deployments.md) to disable the cache |
| 64 | +before you install, modify, or repair Visual Studio. |
| 65 | + |
| 66 | +## Move the package cache |
| 67 | + |
| 68 | +A common system configuration is to have Windows installed on an SSD with a larger hard disk (or more) for development needs, such as source |
| 69 | +code, program binaries, and more. If you want to work offline you can instead move the package cache. |
| 70 | + |
| 71 | +Currently, you can only do this if you set the `CachePath` [registry policy](set-defaults-for-enterprise-deployments.md) before you |
| 72 | +install, modify, or repair Visual Studio. |
| 73 | + |
| 74 | +## See also |
| 75 | + |
| 76 | + * [Install Visual Studio](install-visual-studio.md) |
| 77 | + * [Set defaults for enterprise deployments](set-defaults-for-enterprise-deployments.md) |
| 78 | + * [Use command-line parameters to install Visual Studio](use-command-line-parameters-to-install-visual-studio.md) |
| 79 | + * [Report a problem with Visual Studio](../ide/how-to-report-a-problem-with-visual-studio-2017.md) |
0 commit comments