diff --git a/xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm b/xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm index cf2254abd..72e13c120 100644 --- a/xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm +++ b/xCAT-buildkit/lib/perl/xCAT/BuildKitUtils.pm @@ -353,10 +353,10 @@ sub find_latest_pkg_deb } foreach my $r (@deblist) { - my $basename = `dpkg -I $r* |grep Package|awk '{print \$2}'`; + my $basename = `dpkg -I $r* |grep Package|awk '{print \$2}'|head -1`; chomp $basename; - my $version = `dpkg -I $r* |grep Version|awk '{print \$2}'`; + my $version = `dpkg -I $r* |grep Version|awk '{print \$2}'|head -1`; chomp $version; $founddeb{$basename}{$r}{version}=$version;