Your message dated Sun, 29 Dec 2013 16:18:44 +0000 with message-id <E1VxJ4e-0003AY-5C@franck.debian.org> and subject line Bug#732746: fixed in apt 0.9.14.2 has caused the Debian Bug report #732746, regarding apt: Empty /etc/apt/preferences file is not allowed to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org immediately.) -- 732746: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732746 Debian Bug Tracking System Contact owner@bugs.debian.org with problems
--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: apt: Empty /etc/apt/preferences file is not allowed
- From: Will Marler <will.marler@gmail.com>
- Date: Fri, 20 Dec 2013 23:51:35 +0000
- Message-id: <[🔎] 20131220235135.4540.64678.reportbug@dev-app2.qualvu.dev>
Package: apt Version: 0.9.7.9+deb7u1 Severity: normal
Dear Maintainer, * Please consider answering these questions, where appropriate *
* What led up to the situation?I was configuring Puppet to manage a number of nodes. Puppetlabs has an ‘apt’ module, and they use code fragments in /etc/apt/preferences.d to control pins. However, my organization was using entries in /etc/apt/preferences, so I had to migrate. I decided to put a comment in /etc/apt/preferences saying “# This file is managed by Puppet” (similar to what the puppetlabs/apt module does for /etc/apt/sources.list), and discovered this caused ‘apt-get upgrade’ to fail.
* What exactly did you do (or not do) that was effective (or ineffective)?This topic has been covered by a previous bug, but the resolution is poor/unclear. That bug is 641245, archived, and it seems the resolution is “comments should be entered in /etc/apt/preferences in the form 'Explanation: <comment>'” and the bug was archived. This does not work, however, and does not seem to be a good solution. The “#” as a comment is so ubiquitous across Linux programs, and files containing only comments are acceptable almost everywhere. apt-get should be updated to current expectations.
The bug can be reproduced quite simply by putting a single comment in /etc/apt/preferences. For example: # This file is maintained by Puppet. Contents will be overwritten.
When running apt-get, the output will be: “E: Unable to parse package file /etc/apt/preferences (1)”
In the discussion of bug 641245, it is mentioned that apt_preferences (5) says comments should be indicated with “Explanation:” <comment>. If the only line in /etc/apt/preferences is like so:
Explanation: This file is maintained by Puppet. Contents will be overwritten.
the output is as follows:
“E: Invalid record in the preferences file /etc/apt/preferences, no Package header”
A workaround is actually quite simple. As long as “Package: <some text>” is included, ‘apt-get upgrade’ works without complaint. Quite literally, the following is acceptable:
# This file is maintained by Puppet. Contents will be overwritten. Package: arbitrary_non_existent_package_used_to_demonstrate_the_point
It's clear that apt-get isn't checking the validity of the text following the “Package:” line, so why is it a requirement that the “Package:” line be present at all?
— Package-specific info:
— apt-config dump —
APT ""; APT::Architecture “amd64”; APT::Build-Essential ""; APT::Build-Essential:: “build-essential”; APT::Install-Recommends “1”; APT::Install-Suggests “0”; APT::Authentication ""; APT::Authentication::TrustCDROM “true”; APT::NeverAutoRemove ""; APT::NeverAutoRemove:: “^firmware-linux.*”; APT::NeverAutoRemove:: “^linux-firmware$”; APT::NeverAutoRemove:: “^linux-image.*”; APT::NeverAutoRemove:: “^kfreebsd-image.*”; APT::NeverAutoRemove:: “^linux-restricted-modules.*”; APT::NeverAutoRemove:: “^linux-ubuntu-modules-.*”; APT::NeverAutoRemove:: “^gnumach$”; APT::NeverAutoRemove:: “^gnumach-image.*”; APT::Never-MarkAuto-Sections ""; APT::Never-MarkAuto-Sections:: “metapackages”; APT::Never-MarkAuto-Sections:: “restricted/metapackages”; APT::Never-MarkAuto-Sect ions:: “universe/metapackages”; APT::Never-MarkAuto-Sections:: “multiverse/metapackages”; APT::Never-MarkAuto-Sections:: “oldlibs”; APT::Never-MarkAuto-Sections:: “restricted/oldlibs”; APT::Never-MarkAuto-Sections:: “universe/oldlibs”; APT::Never-MarkAuto-Sections:: “multiverse/oldlibs”; APT::Architectures ""; APT::Architectures:: “amd64”; APT::Compressor ""; APT::Compressor::. ""; APT::Compressor::.::Name “.”; APT::Compressor::.::Extension ""; APT::Compressor::.::Binary ""; APT::Compressor::.::Cost “1”; APT::Compressor::gzip ""; APT::Compressor::gzip::Name “gzip”; APT::Compressor::gzip::Extension “.gz”; APT::Compressor::gzip::Binary “gzip”; APT::Compressor::gzip::Cost “2”; APT::Compressor::gzip::CompressArg ""; APT::Compressor::gzip::CompressArg:: “-9n&r dquo;; APT::Compressor::gzip::UncompressArg ""; APT::Compressor::gzip::UncompressArg:: “-d”; APT::Compressor::bzip2 ""; APT::Compressor::bzip2::Name “bzip2”; APT::Compressor::bzip2::Extension “.bz2”; APT::Compressor::bzip2::Binary “bzip2”; APT::Compressor::bzip2::Cost “3”; APT::Compressor::bzip2::CompressArg ""; APT::Compressor::bzip2::CompressArg:: “-9”; APT::Compressor::bzip2::UncompressArg ""; APT::Compressor::bzip2::UncompressArg:: “-d”; APT::Compressor::xz ""; APT::Compressor::xz::Name “xz”; APT::Compressor::xz::Extension “.xz”; APT::Compressor::xz::Binary “xz”; APT::Compressor::xz::Cost “4”; APT::Compressor::xz::CompressArg ""; APT::Compressor::xz::CompressArg:: “-6”; APT::Compressor::xz::UncompressArg ""; APT::Compressor::xz::UncompressArg:: “-d”; APT::C ompressor::lzma ""; APT::Compressor::lzma::Name “lzma”; APT::Compressor::lzma::Extension “.lzma”; APT::Compressor::lzma::Binary “xz”; APT::Compressor::lzma::Cost “5”; APT::Compressor::lzma::CompressArg ""; APT::Compressor::lzma::CompressArg:: “--format=lzma”; APT::Compressor::lzma::CompressArg:: “-9”; APT::Compressor::lzma::UncompressArg ""; APT::Compressor::lzma::UncompressArg:: “--format=lzma”; APT::Compressor::lzma::UncompressArg:: “-d”; APT::Compressor::::Name ""; APT::Compressor::::Extension “.”; APT::Compressor::::Binary ""; APT::Compressor::::Cost “100”; APT::Compressor::::CompressArg ""; APT::Compressor::::CompressArg:: “-9”; APT::Compressor::::UncompressArg ""; APT::Compressor::::UncompressArg:: “-d”; Dir “/”; Dir::State “var/lib/apt/”; Dir ::State::lists “lists/”; Dir::State::cdroms “cdroms.list”; Dir::State::mirrors “mirrors/”; Dir::State::extended_states “extended_states”; Dir::State::status “/var/lib/dpkg/status”; Dir::Cache “var/cache/apt/”; Dir::Cache::archives “archives/”; Dir::Cache::srcpkgcache “srcpkgcache.bin”; Dir::Cache::pkgcache “pkgcache.bin”; Dir::Etc “etc/apt/”; Dir::Etc::sourcelist “sources.list”; Dir::Etc::sourceparts “sources.list.d”; Dir::Etc::vendorlist “vendors.list”; Dir::Etc::vendorparts “vendors.list.d”; Dir::Etc::main “apt.conf”; Dir::Etc::netrc “auth.conf”; Dir::Etc::parts “apt.conf.d”; Dir::Etc::preferences “preferences”; Dir::Etc::preferencesparts “preferences.d”; Dir::Etc::trusted “trusted.gpg”; Dir::Etc::trustedparts “trusted.gpg.d”; Dir::B in ""; Dir::Bin::methods “/usr/lib/apt/methods”; Dir::Bin::solvers ""; Dir::Bin::solvers:: “/usr/lib/apt/solvers”; Dir::Bin::dpkg “/usr/bin/dpkg”; Dir::Bin::bzip2 “/bin/bzip2”; Dir::Bin::xz “/usr/bin/xz”; Dir::Media ""; Dir::Media::MountPath “/media/cdrom”; Dir::Log “var/log/apt”; Dir::Log::Terminal “term.log”; Dir::Log::History “history.log”; Dir::Ignore-Files-Silently ""; Dir::Ignore-Files-Silently:: “~$”; Dir::Ignore-Files-Silently:: “\.disabled$”; Dir::Ignore-Files-Silently:: “\.bak$”; Dir::Ignore-Files-Silently:: “\.dpkg-[a-z]+$”; Dir::Ignore-Files-Silently:: “\.save$”; Dir::Ignore-Files-Silently:: “\.orig$”; Acquire ""; Acquire::cdrom ""; Acquire::cdrom::mount “/media/cdrom”; Acquire::Languages ""; Acquire::Languages:: “none”; DPkg ""; DPkg::Pre-Install-Pkgs ""; DPkg::Pre-Install-Pkgs:: “/usr/bin/apt-listchanges --apt || test $? -ne 10”; DPkg::Pre-Install-Pkgs:: “/usr/sbin/dpkg-preconfigure --apt || true”; DPkg::Tools ""; DPkg::Tools::Options ""; DPkg::Tools::Options::/usr/bin/apt-listchanges ""; DPkg::Tools::Options::/usr/bin/apt-listchanges::Version “2”; CommandLine ""; CommandLine::AsString “apt-config dump”;
— /etc/apt/preferences —
#This file is maintained by puppet. Local changes will be overwritten. Changes #must be made via the git repo only.
#Pin for the 3.2.7-3 version of gluster #At one point “unstable” went to 3.2.7-5. According to the #package maintainers there is no problem reverting to 3.2.7-3 #from 3.2.7-5, and there are no plans to put 3.2.7-5 in wheezy. Package: glusterfs-client glusterfs-server glusterfs-common Pin: release n=wheezy Pin-Priority: 2001
Package: * Pin: release n=wheezy Pin-Priority: 1001
Package: * Pin: release a=testing Pin-Priority: 60
Package: * Pin: release a=unstable Pin-Priority: 50
— /etc/apt/sources.list —
#This file is maintained by puppet. Local changes will be overwritten. Changes #must be made via the git repo only.
deb http://mirror.qualvu.dev/debian/ wheezy main non-free contrib deb-src http://ftp.us.debian.org/debian/ wheezy main non-free contrib
deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src http://security.debian.org/ wheezy/updates main contrib non-free
# wheezy-updates, previously known as ‘volatile’ deb http://ftp.us.debian.org/debian/ wheezy-updates main contrib non-free deb-src http://ftp.us.debian.org/debian/ wheezy-updates main contrib non-free
# Wheezy for glusterfs 3.2+; Jessie is now at 3.4 deb http://ftp.us.debian.org/debian/ wheezy main non-free deb-src http://ftp.us.debian.org/debian/ wheezy main non-free
— System Information: Debian Release: 7.3
APT prefers stable APT policy: (1001, 'stable'), (500, 'stable-updates')Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
Versions of packages apt depends on: ii debian-archive-keyring 2012.4 ii gnupg 1.4.12-7+deb7u3 ii libapt-pkg4.12 0.9.7.9+deb7u1 ii libc6 2.13-38 ii libgcc1 1:4.7.2-5 ii libstdc++6 4.7.2-5
apt recommends no packages.
Versions of packages apt suggests: pn apt-doc <none> ii aptitude 0.6.8.2-1 ii dpkg-dev 1.16.12 ii python-apt 0.8.8.2 ii xz-utils 5.1.1alpha+20120614-2
— no debconf information
If you'd like to unsubscribe and stop receiving these emails click here.
--- End Message ---
--- Begin Message ---
- To: 732746-close@bugs.debian.org
- Subject: Bug#732746: fixed in apt 0.9.14.2
- From: Michael Vogt <mvo@debian.org>
- Date: Sun, 29 Dec 2013 16:18:44 +0000
- Message-id: <E1VxJ4e-0003AY-5C@franck.debian.org>
Source: apt Source-Version: 0.9.14.2 We believe that the bug you reported is fixed in the latest version of apt, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to 732746@bugs.debian.org, and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Michael Vogt <mvo@debian.org> (supplier of updated apt package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing ftpmaster@ftp-master.debian.org) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Format: 1.8 Date: Sun, 29 Dec 2013 16:41:16 +0100 Source: apt Binary: apt libapt-pkg4.12 libapt-inst1.5 apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https Architecture: source all amd64 Version: 0.9.14.2 Distribution: unstable Urgency: low Maintainer: APT Development Team <deity@lists.debian.org> Changed-By: Michael Vogt <mvo@debian.org> Description: apt - commandline package manager apt-doc - documentation for APT apt-transport-https - https download transport for APT apt-utils - package management related utility programs libapt-inst1.5 - deb package format runtime library libapt-pkg-dev - development files for APT's libapt-pkg and libapt-inst libapt-pkg-doc - documentation for APT development libapt-pkg4.12 - package management runtime library Closes: 728500 731738 732166 732746 732749 Changes: apt (0.9.14.2) unstable; urgency=low . [ Joe Hansen ] * Danish translation update. Closes: #732166 . [ Peter Green ] * add apt-vendor for raspbian. Closes: #732749 . [ Thomas Bechtold ] * apt-pkg/contrib/gpgv.cc: use /tmp as fallback dir if the directory from $TMPDIR is not available (closes: #728500) . [ Michael Vogt ] * vendor/getinfo: - fix ubuntu-codename * vendor/steamos/*: - add steamos support * bugfix/bts731738-fancy-progess: - fix terminal size issues with e.g. "less" when "APT::Progress-Fancy=1" is used (closes: #731738) * feature/policy-parser-bts732746: - allow more flexibility in /etc/apt/preferences, e.g. comment only sections (closes: #732746) * move TMPDIR handling into GetTempDir() and use that instead of getenv("TMPDIR") * update apt-key net-update and add integration test with the buildin apt webserver * run autopkgtest against the installed apt Checksums-Sha1: 02f20154bffb4fed07ae849e4245f08167a8a0f9 1640 apt_0.9.14.2.dsc 43e696807946c2e6952511851d72d8500f24bf83 3465119 apt_0.9.14.2.tar.gz d48105fc5534a6d78ec061996d5846ce6c15d257 267890 apt-doc_0.9.14.2_all.deb 42bae0301b930f5e6df51cdc5117dba8b6ae3fdb 582132 libapt-pkg-doc_0.9.14.2_all.deb 302bb92df2647f910cf32f666b73901b082f3a2c 730312 libapt-pkg4.12_0.9.14.2_amd64.deb 54e5f7c1d9cd1b224936426a55f089135295d49d 159216 libapt-inst1.5_0.9.14.2_amd64.deb 57b455d72fc6921b829734b32efec92ac643de8e 1052778 apt_0.9.14.2_amd64.deb 28185e66510fb491518baa3a48683e552ec95a2c 182390 libapt-pkg-dev_0.9.14.2_amd64.deb aefa7d0cc2a65bcb1a70adfb027e30868872505a 347368 apt-utils_0.9.14.2_amd64.deb 39da914e8beb71cab13e76c4e4b1e053367816ea 126128 apt-transport-https_0.9.14.2_amd64.deb Checksums-Sha256: 20cc0db28df88c8e6485807be2c16d3b8fe445659dad3c2013fe1d028397e464 1640 apt_0.9.14.2.dsc 143f30664133c0554957822b0207128e3ff7be4318dbb1ef3c18f60c890d3c82 3465119 apt_0.9.14.2.tar.gz eb9970366641e1d125b39e05d3b031ef741d57848c340e6809ed2f943164408b 267890 apt-doc_0.9.14.2_all.deb 1ffb5d6b2441270c964db1383c490c4160d8efd13cf2040c5a394485a2ceb0d5 582132 libapt-pkg-doc_0.9.14.2_all.deb a694cd369ae72718ce260aebc4b1d9014c3c3e1215a00c301fdbc21690491550 730312 libapt-pkg4.12_0.9.14.2_amd64.deb c64ba28d5707e0c5ac48cb87282993189a8408fcbd4c10a08a13ef18a15b81f1 159216 libapt-inst1.5_0.9.14.2_amd64.deb 7411b80d9d7eab55d5377b874ea2f9f5afdcf3197615d66c5fda974b8d3c9651 1052778 apt_0.9.14.2_amd64.deb a1f8d9993c17997d2e5d253d90cdaabec774e32fbcc9fc699f6b9bdf58d73294 182390 libapt-pkg-dev_0.9.14.2_amd64.deb bbf0479330f17d66ef05400d785ee7b77b844cf1aa5021729ddaba9f1ee0e6dd 347368 apt-utils_0.9.14.2_amd64.deb 2f6307ab47cab2c2812f10bfc1821bfd3f79eade37f13b46ccef8cc5dc51fef7 126128 apt-transport-https_0.9.14.2_amd64.deb Files: 8ee1d65624d2c50a8c46a01c2917af63 1640 admin important apt_0.9.14.2.dsc 8131fb29abc6fcffd3fbd8de63f0cb7b 3465119 admin important apt_0.9.14.2.tar.gz 7e190ad7064eeb276c77818564078e44 267890 doc optional apt-doc_0.9.14.2_all.deb 5bcd32c261c9db946482b6e35b189cd4 582132 doc optional libapt-pkg-doc_0.9.14.2_all.deb 3453dc8c43ec15c0c7019037ce33c5e0 730312 libs important libapt-pkg4.12_0.9.14.2_amd64.deb fbcd23855ec0b1c5a06ee95446377b81 159216 libs important libapt-inst1.5_0.9.14.2_amd64.deb cf6033a8995eee9964a1268622695c22 1052778 admin important apt_0.9.14.2_amd64.deb 84d85fd5fd6e19c35be6f0d2430e16b6 182390 libdevel optional libapt-pkg-dev_0.9.14.2_amd64.deb fddbdd88952bc7e4fd63c6236e269fc0 347368 admin important apt-utils_0.9.14.2_amd64.deb 404530d4ff48163d5eda8ace333e1bde 126128 admin optional apt-transport-https_0.9.14.2_amd64.deb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) iEYEARECAAYFAlLASS8ACgkQliSD4VZixzRXqwCfVBWFq9DSytDVBOEDLDi1xFhe ZDAAn3m8yA4IBZhb8eThjSKkKSrMQR0q =hGVj -----END PGP SIGNATURE-----
--- End Message ---