perl cpan install Tk - 根目录需要太多磁盘空间
在使用 Perl 5.8 的 Debian Lenny 环境中,我尝试在命令行中使用 CPAN 以 root 身份安装 Tk 模块,但此安装需要根目录上太多磁盘空间,尽管模块未安装在根分区上。所以看起来编译是使用根目录。
我可以避免调整磁盘分区大小来安装 Tk 模块吗?或者是否有一种简单的方法可以在 /usr 或其他目录上运行编译?
In a Debian Lenny environnement with Perl 5.8, I'm trying to install the Tk module as root using CPAN in command line but this install requires too much disk space on the root directory, despite the modules are not installed on the root partition. So it looks like the compile is using the root directory.
Can I avoid to resize my disk partition to install the Tk module or is there a simple way to run the compile on /usr or another directory ?
您使用什么工具来管理安装?默认情况下,大多数 CPAN 工具都会在您的主目录中构建模块。
如果您使用 cpan 工具,则可以将
build_dir
更改为具有更多可用磁盘空间的东西:如果您使用 cpanm,我认为您只需更改
~/.cpanm/work
是指向适当目录的符号链接。此外,通常最好以普通用户身份构建模块,并且仅使用 root 来安装它。您可以使用
cpan
执行此操作,方法是使用sudo
或将
make_install_make_command
和mbuild_install_build_command
配置选项设置为某些内容苏。cpanm
有--sudo
选项可以使用sudo
安装,但我不认为它可以使用su
反而。What tool are you using to manage the install? By default, most CPAN tools build the module in your home directory.
If you're using the cpan tool, you can change
build_dir
to something with more disk space available:If you're using cpanm, I think you'd just change
~/.cpanm/work
to be a symlink to an appropriate directory.Also, it's generally preferable to build the module as a normal user, and only use root to install it. You can do this with
cpan
by setting themake_install_make_command
andmbuild_install_build_command
config options to something usingsudo
orsu
.cpanm
has the--sudo
option to install usingsudo
, but I don't think it can usesu
instead.