E: Directory '/var/log/apt/' missing

Bug #220239 reported by Iain Buclaw
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apt (Debian)
Fix Released
Unknown
apt (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: apt

The error message that popups up after doing anything with aptitude/apt-get (download, install, remove, etc, etc)

Creating the folder gets rid of this error message. And a lovely, tiny log file is stored in the folder. With all of my days history inside.
But everything in the /var folder gets removed before Linux powers off.
So the nature of this bug is the fact that it isn't being created when I boot the PC. (Or the way that the program stores the log file, it depends on the fact that the folders exist beforehand. An analogy would be the difference between "mkdir" and "mkdir -p")

Details of my system:
lsb release:
   Description: Ubuntu 8.04
   Release: 8.04

apt:
  Installed: 0.7.9ubuntu16
  Candidate: 0.7.9ubuntu16
  Version table:
 *** 0.7.9ubuntu16 0
        500 http://gb.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

And I ran it in gdb (Program exited with code 0144):
{
    Processing triggers for libc6 ...
    ldconfig deferred processing now taking place
    E: Directory '/var/log/apt/' missing

    Program exited with code 0144.
}

Anything else that I can help with explaining this. Just ask.

Regards
Iain

Related branches

Revision history for this message
Iain Buclaw (iainb) wrote :

Putting this in "/etc/gdm/Init/Default" seems to have the right effect for me:
CODE:
    ### Fix that bloody apt error! ###
    mkdir -p /var/log/apt/
exit 0

Does anyone know what's wrong?

Regards
Iain

Revision history for this message
boga (boga-inbox) wrote :

I don't know why /var/log/apt gets missing in your particular case. The most common reason is using tmpfs for /var/log which is a usual practice for SSD-based systems. Since SSD-based systems get more and more common (especially thanks to Asus Eee PC :-)) I think it would be nice to have correct operation with /var/log/apt missing (just create it if it doesn't exist).

Revision history for this message
BassKozz (basskozz+ubuntu) wrote :

I can confirm this bug on my eeepc 901 using Ubuntu-eee 8.04.1 (http://www.ubuntu-eee.com/) with Adam's Kernel (http://www.array.org/ubuntu/index.html)

Is this going to be corrected in Intrepid?

Revision history for this message
Bastien Continsouzas (bcontins) wrote :

I don't think this is an Ubuntu issue. /var/log/apt is missing when you follow the Ubuntu/Help instructions for reducing disk writes on the EeePC.

https://help.ubuntu.com/community/EeePC/Using#Reducing%20Drive%20Writes

Since your /etc/fstab file was probably altered by the people that released Ubuntu-eee 8.04.1, you can ask the same questions to them.

https://answers.launchpad.net/ubuntu-eee

Revision history for this message
Murz (murznn) wrote :

Confirm this bug when using /var/log as tmpfs on asus eee pc:
tmpfs /var/log tmpfs defaults 0 0

adding the line at end of /etc/fstab
tmpfs /var/log/apt tmpfs defaults 0 0
helps me.

Daniel T Chen (crimsun)
Changed in apt:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Iain Buclaw (iainb) wrote :

Well... I decided to have a look at the source, I won't pretend that I'm a C++ guru, but I know what I'm looking at when I see it.

I have supplied a cheap patch, I tested it in a debootstrap and the results of it don't seem to have any side effects (not that it would anyway)...

What it does instead of the original apt-get, is print a "warning" message instead of an error, re-creates the log directory and carries on with the rest of the application.

This is what you'll see:

W: Directory '/var/log/apt' missing (re-creating)

To install, just cp the bin/lib* files that were made in the compile to /usr/lib/ directory (no need to patch the actual apt-get binary, it's the libraries that seem to contain this information).
But I doubt it'll get submitted, as I don't feel that my coding style matches the rest of the source XD

Regards
Iain

Revision history for this message
Dougle (daniel-craig) wrote :

This is the same problem preventing Apache2 from starting (no directory /var/log/apache2), and removing some important logs like boot-chart images etc.

i am running vanilla 8.10 on the aspire one (not SSD)

Revision history for this message
Benjamin Boudreau (dreurmail) wrote :

Still hapenning with 10.04.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.6 KiB)

This bug was fixed in the package apt - 0.8.3ubuntu1

---------------
apt (0.8.3ubuntu1) maverick; urgency=low

  * merged fixes from debian-sid
  * debian/rules:
    - put ubuntu-archive.gpg back into the package (LP: #620576)
  * apt-pkg/init.cc:
    - ignore ".distUpgrade" and ".save" files in sources.list.d
      (LP: #631770)

apt (0.8.3) unstable; urgency=low

  [ Manpages translations ]
  * Japanese (KURASAWA Nozomu). Closes: #595862

  [ Michael Vogt ]
  * apt-pkg/indexcopy.cc:
    - only use trusted.gpg.d directory if it exists
    - do not replace /dev/null when running in APT::CDROM::NoAct
      mode (LP: #612666), thanks to Colin Watson

  [ David Kalnischkies ]
  * ftparchive/apt-ftparchive.cc:
    - ensure that BinDirectory as well as Tree settings get
      the correct default FileMode setting (Closes: #595922)

apt (0.8.2) unstable; urgency=low

  [ Manpages translations ]
  * Spanish (Omar Campagne). Closes: #595557

  [ David Kalnischkies ]
  * apt-pkg/versionmatch.cc:
    - do not accept 'Pin: origin "' (missing closing ") as a valid
      way to pin a local archive: either "" or none…
  * apt-pkg/deb/dpkgpm.cc:
    - create Dir::Log if needed to support /var/log as tmpfs or similar,
      inspired by Thomas Bechtold, thanks! (Closes: #523919, LP: #220239)
  * apt-pkg/indexcopy.cc:
    - support really still the APT::GPGV::TrustedKeyring setting,
      as it breaks d-i badly otherwise (Closes: #595428)
  * cmdline/apt-key:
    - support also Dir::Etc::Trusted so that apt-key works in the same
      way as the library part which works with the trusted files
  * methods/{gzip,bzip2}.cc:
    - empty files can never be valid archives (Closes: #595691)

apt (0.8.1) unstable; urgency=low

  [ Programs translations ]
  * Thai (Theppitak Karoonboonyanan). Closes: #592695
  * Russian (Yuri Kozlov). Closes: #594232
  * Slovak (Ivan Masár). Closes: #594255
  * Swedish (Daniel Nylander). Closes: #594241
  * Japanese (Kenshi Muto, Osamu Aoki). Closes: #594265
  * Italian (Milo Casagrande). Closes: #594238
  * Asturian (maacub). Closes: #594303
  * Simplified Chinese (Aron Xu). Closes: #594458
  * Bulgarian (Damyan Ivanov). Closes: #594627
  * Portuguese (Miguel Figueiredo). Closes: #594668
  * Korean (Changwoo Ryu). Closes: #594809
  * Norwegian Bokmål (Hans Nordhaug). Closes: #595182
  * Danish (Joe Hansen). Closes: #595176
  * Catalan (Agustí Grau). Closes: #595234

  [ Christian Perrier ]
  * Fix spelling error in cmdline/apt-get.cc. Thanks to Osamu Aoki
    Closes: #594211

  [ Manpages translations ]
  * Portuguese (Américo Monteiro)

  [ David Kalnischkies ]
  * cmdline/apt-cache.cc:
    - show in madison command again also source packages (LP: #614589)
    - remove useless GetInitialize method
  * cmdline/apt-get.cc:
    - remove direct calls of ReadMainList and use the wrapper instead
      to protect us from useless re-reads and two-times notice display
    - remove death code by removing unused GetInitialize
  * apt-pkg/depcache.cc:
    - now that apt-get purge works on 'rc' packages let the MarkDelete
      pass this purge forward to the non-pseudo package for pseudos
  * apt-pkg/contrib/fileutl.cc:
    - apply SilentlyIgnore...

Read more...

Changed in apt (Ubuntu):
status: Confirmed → Fix Released
Changed in apt (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.