Quoth mmccaws2 <
[email protected]>:
Quoth Ron Bergin <
[email protected]>:
Try doing:
$sudobash
[pass your login credentials]
#perl-MCPAN -e shell
Note the difference between the $ prompt and the # prompt.
It would be better to avoid performing the Makefile.PL and make steps as
root, if possible. Since CPAN (at least recent versions) has support for
usingsudofor make install, it would be better to take advantage of it.
So, I think I have made a few mistakes here and I need to correct
them. I had installed several modules by getting into perl -MCPAN -e
shell using sudo. The reason is I get this error message
$ perl -MCPAN -e shell
CPAN: File::HomeDir loaded ok (v0.66)
mkdir /home/mccannm/.cpan/CPAN: Permission denied at /opt/perl_32/lib/
5.8.8/CPAN/HandleConfig.pm line 539
when I tried logging in as my self.
What happened is this, right after the reinstallation of perl, we're
on 5.8.8 now, I need to install a module that required root access. I
had tried to install that module previously and it said trying to
install the module I needed root access. It was the POE module for
non-blocking ping. I used sudo perl -MCPAN -e shell to intall it.
Since then I can't install any module without using sudo perl -MCPAN -
e shell.
What has happened is that running CPAN under sudo has created
/home/mccannm/.cpan as root, so you can't run CPAN as yourself any more.
You need to su(do) to root, and either delete the entire directory or
chown -R it to yourself. Then you need to set CPAN up to use sudo to
install (as yourself):
$ perl -MCPAN -eshell
cpan> o conf make_install_make_command "sudo make"
cpan> o conf mbuild_install_build_command "sudo ./Build"
cpan> o conf commit
cpan> quit
$
You will of course need sudo rights to perform both those commands; but
it seems as though you have localhost=(root) ALL rights anyway.
Also, do I uninstall the ones that I have already installed as root or
do I change file permissions for directories, I really don't
understand this part of administration.
No, all the modules already installed should be fine (you might want to
check that everything under /opt/perl_32/lib is owned by root). It's
just your CPAN config that's been messed up.
Ben
well chown -R worked.
now the next part, and sorry for being so dense, But I don't sudo perl
-MCPAN -e shell but run those commands after entering perl -MCPAN -e
shell. Correct?
also the /opt/perl_32/lib/5.8.8/ has a lot of files with read only
permissions. Would the correct approach be chmod -R 644 /opt/perl_32/
lib/5.8.8/ or is that too broad of a command?
$ ls -l /opt/perl_32/lib/5.8.8/
gives
total 4784
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 ActivePerl
-r--r--r-- 1 bin bin 3112 Aug 3 05:50
ActivePerl.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 ActiveState
-r--r--r-- 1 bin bin 2594 Aug 3 05:50
AnyDBM_File.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Apache
drwxr-xr-x 2 root sys 96 Nov 6 21:58 App
dr-xr-xr-x 4 bin bin 96 Nov 2 12:54 Archive
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Attribute
-r--r--r-- 1 bin bin 11794 Aug 3 05:50
AutoLoader.pm
-r--r--r-- 1 bin bin 15699 Aug 3 05:50 AutoSplit.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 B
-r--r--r-- 1 bin bin 28524 Aug 3 05:50 Benchmark.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Bundle
dr-xr-xr-x 3 bin bin 8192 Nov 2 12:54 CGI
-r--r--r-- 1 bin bin 249942 Aug 3 05:50 CGI.pm
dr-xr-xr-x 4 bin bin 8192 Nov 3 07:18 CPAN
-r--r--r-- 1 root sys 441448 Sep 28 00:06 CPAN.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Carp
-r--r--r-- 1 bin bin 7608 Aug 3 05:50 Carp.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Class
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Convert
-r--r--r-- 1 bin bin 19229 Aug 3 05:50 DB.pm
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 DBM_Filter
-r--r--r-- 1 bin bin 14415 Aug 3 05:50
DBM_Filter.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Data
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Devel
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 Digest
-r--r--r-- 1 bin bin 10316 Aug 3 05:50 Digest.pm
-r--r--r-- 1 bin bin 1899 Aug 3 05:50 DirHandle.pm
-r--r--r-- 1 bin bin 16897 Aug 3 05:50 Dumpvalue.pm
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:54 Encode
-r--r--r-- 1 bin bin 4519 Aug 3 05:50 English.pm
-r--r--r-- 1 bin bin 5170 Aug 3 05:50 Env.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Exporter
-r--r--r-- 1 bin bin 14481 Aug 3 05:50 Exporter.pm
dr-xr-xr-x 6 bin bin 8192 Nov 2 12:54 ExtUtils
-r--r--r-- 1 bin bin 5208 Aug 3 05:50 Fatal.pm
dr-xr-xr-x 3 bin bin 8192 Nov 2 12:54 File
-r--r--r-- 1 bin bin 5405 Aug 3 05:50 FileCache.pm
-r--r--r-- 1 bin bin 6771 Aug 3 05:50
FileHandle.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Filter
-r--r--r-- 1 bin bin 5668 Aug 3 05:50 FindBin.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 Font
dr-xr-xr-x 2 bin bin 96 Nov 2 12:54 Getopt
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:54 HTML
dr-xr-xr-x 5 bin bin 8192 Nov 2 12:54 HTTP
dr-xr-xr-x 3 bin bin 96 Nov 2 12:54 I18N
dr-xr-xr-x 36 bin bin 8192 Nov 2 12:55
IA64.ARCHREV_0-thread-multi
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 IO
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 IPC
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 LWP
-r--r--r-- 1 bin bin 21427 Jul 19 23:16 LWP.pm
dr-xr-xr-x 3 bin bin 8192 Nov 2 12:55 Locale
-r--r--r-- 1 bin bin 1141 Nov 27 2003 MD5.pm
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 Math
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Memoize
-r--r--r-- 1 bin bin 35275 Aug 3 05:50 Memoize.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 Module
-r--r--r-- 1 bin bin 16122 Aug 3 05:50 NEXT.pm
dr-xr-xr-x 5 bin bin 8192 Nov 6 22:04 Net
dr-xr-xr-x 6 bin bin 8192 Nov 2 12:55 PPM
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 PerlIO
-r--r--r-- 1 bin bin 10928 Aug 3 05:50 PerlIO.pm
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 Pod
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 SOAP
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Search
-r--r--r-- 1 bin bin 1070 Aug 3 05:50
SelectSaver.pm
-r--r--r-- 1 bin bin 13203 Aug 3 05:50
SelfLoader.pm
-r--r--r-- 1 bin bin 8457 Aug 3 05:50 Shell.pm
-r--r--r-- 1 bin bin 28651 Aug 3 05:50 Switch.pm
-r--r--r-- 1 bin bin 4794 Aug 3 05:50 Symbol.pm
drwxr-xr-x 4 root sys 8192 Nov 6 21:58 TAP
dr-xr-xr-x 3 bin bin 8192 Nov 2 12:55 Term
dr-xr-xr-x 4 bin bin 8192 Nov 6 21:58 Test
-r--r--r-- 1 bin bin 28863 Aug 3 05:50 Test.pm
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Text
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Thread
-r--r--r-- 1 bin bin 10152 Aug 3 05:50 Thread.pm
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 Tie
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 Time
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 UDDI
-r--r--r-- 1 bin bin 4052 Aug 3 05:50 UNIVERSAL.pm
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 URI
-r--r--r-- 1 bin bin 30307 Nov 5 2004 URI.pm
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 Unicode
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 User
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 WWW
dr-xr-xr-x 8 bin bin 8192 Nov 2 12:55 XML
dr-xr-xr-x 3 bin bin 96 Nov 2 12:55 XMLRPC
-r--r--r-- 1 bin bin 838 Aug 3 05:50 abbrev.pl
-r--r--r-- 1 bin bin 1298 Aug 3 05:50 assert.pl
-r--r--r-- 1 bin bin 12844 Aug 3 05:50
attributes.pm
-r--r--r-- 1 bin bin 4238 Aug 3 05:50 autouse.pm
-r--r--r-- 1 bin bin 6524 Aug 3 05:50 base.pm
-r--r--r-- 1 bin bin 7368 Aug 3 05:50 bigfloat.pl
-r--r--r-- 1 bin bin 8959 Aug 3 05:50 bigint.pl
-r--r--r-- 1 bin bin 11937 Aug 3 05:50 bigint.pm
-r--r--r-- 1 bin bin 14966 Aug 3 05:50 bignum.pm
-r--r--r-- 1 bin bin 4476 Aug 3 05:50 bigrat.pl
-r--r--r-- 1 bin bin 10694 Aug 3 05:50 bigrat.pm
-r--r--r-- 1 bin bin 2106 Aug 3 05:50 blib.pm
-r--r--r-- 1 bin bin 2384 Aug 3 05:50 bytes.pm
-r--r--r-- 1 bin bin 758 Aug 3 05:50
bytes_heavy.pl
-r--r--r-- 1 bin bin 1122 Aug 3 05:50 cacheout.pl
-r--r--r-- 1 bin bin 15501 Aug 3 05:50 charnames.pm
-r--r--r-- 1 bin bin 3191 Aug 3 05:50 complete.pl
-r--r--r-- 1 bin bin 11709 Aug 3 05:50 constant.pm
-r--r--r-- 1 bin bin 1993 Aug 3 05:50 ctime.pl
-r--r--r-- 1 bin bin 17400 Aug 3 05:50
diagnostics.pm
-r--r--r-- 1 bin bin 2175 Aug 3 05:50 dotsh.pl
-r--r--r-- 1 bin bin 15275 Aug 3 05:50 dumpvar.pl
-r--r--r-- 1 bin bin 1736 Aug 3 05:50
exceptions.pl
-r--r--r-- 1 bin bin 1019 Aug 3 05:50 fastcwd.pl
-r--r--r-- 1 bin bin 9351 Aug 3 05:50 fields.pm
-r--r--r-- 1 bin bin 2156 Aug 3 05:50 filetest.pm
-r--r--r-- 1 bin bin 1185 Aug 3 05:50 find.pl
-r--r--r-- 1 bin bin 1130 Aug 3 05:50 finddepth.pl
-r--r--r-- 1 bin bin 642 Aug 3 05:50 flush.pl
-r--r--r-- 1 bin bin 1427 Aug 3 05:50 getcwd.pl
-r--r--r-- 1 bin bin 1322 Aug 3 05:50 getopt.pl
-r--r--r-- 1 bin bin 1406 Aug 3 05:50 getopts.pl
-r--r--r-- 1 bin bin 727 Aug 3 05:50 hostname.pl
-r--r--r-- 1 bin bin 1166 Aug 3 05:50 if.pm
-r--r--r-- 1 bin bin 283 Aug 3 05:50 importenv.pl
-r--r--r-- 1 bin bin 3266 Aug 3 05:50 integer.pm
-r--r--r-- 1 bin bin 373 Aug 3 05:50 less.pm
-r--r--r-- 1 bin bin 820 Aug 3 05:50 locale.pm
-r--r--r-- 1 bin bin 1255 Aug 3 05:50 look.pl
-r--r--r-- 1 bin bin 9136 Nov 30 2004 lwpcook.pod
-r--r--r-- 1 bin bin 25458 Nov 30 2004 lwptut.pod
-r--r--r-- 1 bin bin 2216 Aug 3 05:50 newgetopt.pl
-r--r--r-- 1 bin bin 7971 Aug 3 05:50 open.pm
-r--r--r-- 1 bin bin 185 Aug 3 05:50 open2.pl
-r--r--r-- 1 bin bin 185 Aug 3 05:50 open3.pl
-r--r--r-- 1 bin bin 46898 Aug 3 05:50 overload.pm
-r--r--r-- 1 bin bin 316737 Aug 3 05:50 perl5db.pl
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 pod
dr-xr-xr-x 2 bin bin 8192 Nov 2 12:55 ppm-conf
-r--r--r-- 1 bin bin 1478 Aug 3 05:50 pwd.pl
-r--r--r-- 1 bin bin 276 Aug 3 05:50
shellwords.pl
-r--r--r-- 1 bin bin 7611 Aug 3 05:50 sigtrap.pm
-r--r--r-- 1 bin bin 6139 Aug 3 05:50 sort.pm
-r--r--r-- 1 bin bin 590 Aug 3 05:50 stat.pl
-r--r--r-- 1 bin bin 3292 Aug 3 05:50 strict.pm
-r--r--r-- 1 bin bin 842 Aug 3 05:50 subs.pm
-r--r--r-- 1 bin bin 4806 Aug 3 05:50 syslog.pl
-r--r--r-- 1 bin bin 164 Aug 3 05:50 tainted.pl
-r--r--r-- 1 bin bin 4114 Aug 3 05:50 termcap.pl
-r--r--r-- 1 bin bin 690 Aug 3 05:50 timelocal.pl
dr-xr-xr-x 4 bin bin 8192 Nov 2 12:55 unicore
-r--r--r-- 1 bin bin 7144 Aug 3 05:50 utf8.pm
-r--r--r-- 1 bin bin 7956 Aug 3 05:50
utf8_heavy.pl
-r--r--r-- 1 bin bin 3731 Aug 3 05:50 validate.pl
-r--r--r-- 1 bin bin 2358 Aug 3 05:50 vars.pm
-r--r--r-- 1 bin bin 4328 Aug 3 05:50 vmsish.pm
dr-xr-xr-x 2 bin bin 96 Nov 2 12:55 warnings
-r--r--r-- 1 bin bin 15894 Aug 3 05:50 warnings.pm