解决办法一:
In the course of running portupgrade on a number of packages, I (Kevin) and Dan (about six months later, in August of 2005) came across this nasty little error:
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
The error was by no means limited to intltool , as quoted in the above example. Indeed, a number of packages failed to upgrade due to this problem.
The solution is to install XML::Parser, but the install process is a little counterintuitive if you're used to installing everything through Ports, so we'll walk you through the process. First, although it probably goes without saying, make sure you're connected to the internet. Then, run the following command (as root):
perl -MCPAN -e shell
This will drop us into a shell, but before we can continue, we will need to answer some questions. (Assuming this is our first time running the shell).
You should see something like this after running the above command:
/usr/local/lib/perl5/5.8.6/CPAN/Config.pm initialized.
CPAN is the world-wide archive of perl resources. It consists of about 100 sites that all replicate the same contents all around the globe. Many countries have at least one CPAN site already. The resources found on CPAN are easily accessible with the CPAN.pm module. If you want to use CPAN.pm, you have to configure it properly.
If you do not want to enter a dialog now, you can answer 'no' to this question and I'll try to autoconfigure. (Note: you can revisit this dialog anytime later by typing 'o conf init' at the cpan prompt.)
Are you ready for manual configuration? [yes]
Hit 'Enter' to accept the default choice ("yes"), and you will be asked a series of questions. Feel free to answer each question accordingly (assuming you understand the question being asked), but we found that the default selections worked nicely for us. Do note that if you access the internet through a proxy , you will need to enter it at the prompts asking for your "ftp_proxy", "http_proxy", and "no_proxy". If you are like us and do not use a proxy, go ahead and hit 'Enter' to leave each selection blank.
The only thing worth noting (if all you're doing is hitting 'Enter' at each prompt), is that when you get to these prompts, you have to actually input something for your answers:
First, pick a nearby continent and country (you can pick several of each, separated by spaces, or none if you just want to keep your existing selections). Then, you will be presented with a list of URLs of CPAN mirrors in the countries you selected, along with previously selected URLs. Select some of those URLs, or just keep the old list. Finally, you will be prompted for any extra URLs -- file:, ftp:, or http: -- that host a CPAN mirror.
(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America
Select your continent (or several nearby continents) [] 5
Sorry! since you don't have any existing picks, you must make a geographic selection.
(1) Canada
(2) Mexico
(3) Puerto Rico
(4) United States
Select your country (or several nearby countries) [] 4
Sorry! since you don't have any existing picks, you must make a geographic selection.
(1) ftp://archive.progeny.com/CPAN/
(2) ftp://carroll.cac.psu.edu/pub/CPAN/
(3) ftp://cpan-du.viaverio.com/pub/CPAN/
(4) ftp://cpan-sj.viaverio.com/pub/CPAN/
(5) ftp://cpan.calvin.edu/pub/CPAN
(6) ftp://cpan.cs.utah.edu/pub/CPAN/
(7) ftp://cpan.cse.msu.edu/
(8) ftp://cpan.erlbaum.net/
(9) ftp://cpan.llarian.net/pub/CPAN/
(10) ftp://cpan.mirrors.redwire.net/pub/CPAN/
(11) ftp://cpan.mirrors.tds.net/pub/CPAN
(12) ftp://cpan.netnitco.net/pub/mirrors/CPAN/
(13) ftp://cpan.pair.com/pub/CPAN/
(14) ftp://cpan.teleglobe.net/pub/CPAN
(15) ftp://cpan.thepirtgroup.com/
(16) ftp://csociety-ftp.ecn.purdue.edu/pub/CPAN
42 more items, hit SPACE RETURN to show them
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. '1 4 5' [] 1 4 5
Once you get this prompt, hit 'Enter' and you'll have finished the setup:
Enter another URL or RETURN to quit: []
And you will now be greeted by the following prompt:
cpan>
Enter the following command:
install XML::Parser
Once it finishes installing, we can drop back to our usual terminal prompt:
exit
That's it. We should now be able to complete our portupgrade (or at the very least get past the particular error dealt with on this page). Before running portupgrade , however, make sure you run the following command:
pkgdb -F
Which should give you the following message:
Duplicated origin: textproc/p5-XML-Parser - bsdpan-XML-Parser-2.34 p5-XML-Parser-2.34_1
Unregister any of them? [no]
Go ahead and enter "yes", and then "yes" again when confronted with the following question:
Unregister bsdpan-XML-Parser-2.34 keeping the installed files intact? [no]
Packages should now use the p5-XML-Parser instead of the bsdpan-XML-Parser. Now you can continue with your portupgrade . Hope this helped.
解决办法2:
可能没有安装 xml,查看一下