Results 1 to 3 of 3

Thread: apt-get & ldconfig problem

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Location
    Virginia
    Beans
    112
    Distro
    Ubuntu 10.04 Lucid Lynx

    apt-get & ldconfig problem

    Running ubuntu 16.04 and having to deal with FAP (Fair Access Policy). I am not a guru, just a dedicated user.

    In order to check for and download/install updates during FAP Free time, I have:
    sudo crontab -e, and added the following entry -

    # check/download/install at 2:00 AM
    0 2 * * * (/usr/bin/apt-get update && /usr/bin/apt-get -y upgrade) > /home/edward/apt.log

    This results in the following at the end of my log file:
    dpkg: warning: 'ldconfig' not found in PATH or not executable
    dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
    dpkg: error: 2 expected programs not found in PATH or not executable
    Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin

    If I run the same commands using 'sudo' in a terminal, I do not get the warnings.

    I have been searching for a solution, and as best I can determine, my root $PATH is correct, and ldconfig is at /sbin/ldconfig and executable. Am I doing something obviously wrong? Can anyone give me some help?
    Registered Ubuntu User # 25175

  2. #2
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    3,725
    Distro
    Xubuntu 17.10 Artful Aardvark

    Re: apt-get & ldconfig problem

    When you run something from crontab, your environment is extremely limited. Your PATH is not defined. You can run a command as
    Code:
    PATH=/your/path:/your/other/path command
    or you can put everything, including the PATH, into a shell script and use crontab to run that shell script.

  3. #3
    Join Date
    Jul 2013
    Location
    Wisconsin
    Beans
    4,502

    Re: apt-get & ldconfig problem

    Here's another way that uses your system's already inbuilt features.

    1) Remove all your prior attempts

    2) Disable the /etc/cron.daily/apt-compat job to prevent apt checking for updates at the wrong time.

    3) Add a root cron job at 0200 that simply runs 'exec /usr/lib/apt/apt.systemd.daily' . This, in turn, runs the unattended-upgrades application, which logs to /var/log

    4) Check /etc/apt/apt.conf.d/20auto-upgrades: The unattended-upgrades flag should be '1'.

    5) Edit /etc/apt/apt.conf.d/50unattended-upgrades (using sudo); Uncomment (enable) the Allowed-Origins for -updates and -backports. Add any PPAs or other non-Ubuntu repos that you want Unattended Upgrades to use.
    Last edited by ian-weisser; November 18th, 2016 at 11:18 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •