This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我能想到的最好方法是使用符号链接
,请注意,并非所有程序都安装到同一目录,并且 /opt 可能不是最好的移动方式。 (请参阅末尾,了解仅移动一个文件夹/程序的示例)
这是我使用 EasyPeasy (Ubuntu 10.04) 所做的
。请仔细遵循此代码,如果使用不正确,某些命令可能会删除重要文件。
首先,您需要确保 /opt (或您的发行版默认 apt-get 安装目录)为空。如果您的 opt 文件夹中有数据(您很可能这样做),您可以先将其移动到其他位置以进行安全保存:
备份后,您可以删除原始目录:
然后您可以在驱动器中创建新的 Program Files 文件夹大量空间并创建符号链接:
最后将所有旧程序文件移动到新文件夹并清理临时数据:
如果您只想移动一个占用大量空间的程序,您可以使用相同的方法过程。
例如:
要移动 Java(JVM 约 300MB),请执行以下操作。
使用磁盘使用分析器检查 java 目录。
我的是 /usr/lib/jvm
此时最好重新启动,这应该会清除缓存。
Best way I can think of is to use a symbolic link
note that not all programmes are installed to the same directory and /opt may not be the best thing to move. (see end for example of moving only one folder/program)
This is what I did with EasyPeasy (Ubuntu 10.04)
Follow this code carefully some of the commands can delete important files if used incorrectly.
First you need to make sure /opt (or your distros default apt-get install directory) is empty. If you have data in the opt folder, which you most likely do, you can move it to somewhere else first for safe keeping:
Once backed up you can remove the original directory:
You can then create your new Program Files folder in a drive with lots of space and create a symbolic link:
Finally move all your old program files to your new folder and clean up the temporary data:
If you only wanted to move a single program which is taking up a hunk of your space you could use the same process.
eg:
to move Java (JVM approx 300MB) do the following.
check directory of java using disk usage analyser.
mine is /usr/lib/jvm
Its best at this point to do a restart which should clear the cache.
你不能:安装路径是硬编码在包中的(例如: http://packages.ubuntu.com/oneiric/i386/mono-runtime/filelist)。该路径通常是 /usr 而不是 /opt,但这取决于软件包。如果要覆盖默认目录,则必须手动提取包的内容。但是,它无法工作:配置文件,有时甚至是二进制文件,将继续使用旧路径。因此,您必须更新它们才能使软件包正常工作。
You can't: the installation path is hard-coded in packages (see for example: http://packages.ubuntu.com/oneiric/i386/mono-runtime/filelist). This path is usually /usr instead of /opt, but it depends of the packages. If you want to override the default directory, you must extract manually the content of the packages. But, it can not work: config files, even binary files sometimes, will continue to use the old path. So you must update them in order for the packages to work correctly.