เมื่อ Cron รายวันทำงาน apt-show-version ข้อผิดพลาดต่อไปนี้จะปรากฏขึ้น
/etc/cron.daily/apt-show-versions:
Use of uninitialized value $value in substitution (s///) at /usr/bin/apt-show-versions line 586, <FILE> line 174.
Use of uninitialized value $value in substitution (s///) at /usr/bin/apt-show-versions line 587, <FILE> line 174.
Use of uninitialized value $value in substitution (s///) at /usr/bin/apt-show-versions line 586, <FILE> line 174.
Use of uninitialized value $value in substitution (s///) at /usr/bin/apt-show-versions line 587, <FILE> line 174.
นี่คือตัวอย่างข้อมูลในพื้นที่ของบรรทัด 586:
551 sub parse_file {
552 my ($file, $status) = @_;
553 my ($key, $value, $package, $packages);
554
555 my $release = &determine_pkgfile_release($file);
556 open FILE, $file or &die("Can't open file $file: $!\n");
557 if ($opts{'verbose'}) {print "Parsing $file...";};
558 while (<FILE>) {
559 if (/^$/){
560 unless (defined $package) {next};
561
562 if ($status) { # Are we parsing the status file?
563 # if we did not specify a package or pattern
564 # only include installed packages
565 unless ($mode == $MODE_ALL and
566 ($package->{$STATUS} =~ /not-installed|config-files/ or
567 # don't print holded packages if requested
568 ($opts{'nohold'} and $package->{$STATUS} =~ /hold/))) {
569 $packages->{$package->{$PACKAGE}}{$package->{$ARCH}} = $package;
570 }
571 }
572 else {
573 if (!defined $packages->{$package->{$PACKAGE}} or
574 !defined $packages->{$package->{$PACKAGE}}{$package->{$ARCH}}{$VERS} or
575 $vs->compare($packages->{$package->{$PACKAGE}}{$package->{$ARCH}}{$VERS},
576 $package->{$VERS}) < 0) {
577 $package->{$RELEASE} = $release;
578 $packages->{$package->{$PACKAGE}}{$package->{$ARCH}} = $package;
579 }
580 }
581 undef $package;
582 next;
583 }
584 unless ((/^Package/) || (/^Version/) || (/^Status/) || (/^Source/) || (/^Architecture/)) {next};
585 ($key, $value) = split /: /, $_;
586 $value =~ s/\n//;
587 $value =~ s/\s\(.*\)$//; # Remove any Version information in ()
588 $package->{$key} = $value;
589 }
590 if ($opts{'verbose'}) {print " completed.\n"};
591 close FILE;
592 return $packages, $release;
593 }
594
ฉันค้นหาและพบหัวข้อที่คล้ายกัน (แต่แตกต่างกัน) พร้อมโซลูชันที่ฉันไม่แน่ใจว่าจะใช้งานได้ ขอบคุณล่วงหน้าสำหรับความช่วยเหลือ
แก้ไขรหัสจาก/var/lib/dpkg/statusที่ร้องขอจาก @meuh
162 Description: Micro string library: shared library
163 ustr (Micro string library) is a string API for C. It has tiny overhead over
164 just plain strdup(), is much safer, is easier to use, is faster for many
165 operations, can be used with read-only or automatically allocated data. You
166 don't even need to link to the library to use it (so there are no
167 dependencies).
168 .
169 This package contains the shared library for ustr.
170 Homepage: http://www.and.org/ustr/
171 Original-Maintainer: Vaclav Ovsik <vaclav.ovsik@i.cz>
172
173 Package: libpam-winbind
174 Status: install ok installed
175 Priority: optional
176 Section: net
177 Installed-Size: 204
178 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
179 Architecture: amd64
180 Multi-Arch: same
less -Nเพื่อรับหมายเลขบรรทัด เนื่องจากเป็น Perl สคริปต์คุณสามารถทำงานภายใต้ Perl ดีบักกับperl -d $(type -p apt-show-versions)ตั้งจุดพักที่เส้น 555$fileและตรวจสอบ ฉันคิดว่าปัญหาของคุณเกิดจากข้อมูลไม่ดีที่บรรทัดที่ 174 ของไฟล์ FILE ใดก็ตามที่กำลังอ่านอยู่ในขณะนี้