LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 07-22-2010, 05:55 AM   #1
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 138

Rep: Reputation: 19
/etc/cron.daily/apt apparently not working


Ubuntu 8.04 LTS Server Hardy Heron
/etc/cron.daily/apt apparently does not work.
I do:
Code:
cd / && run-parts --report /etc/cron.daily
which I found in my /etc/crontab
and then:
Code:
apt-get update
apt-get upgrade
shows a large number of packages to be updated.
When I compared this with a Ubuntu 8.04 LTS Desktop (with GUI), I saw that the files in /etc/cron.daily are identical, the only difference is that anacron is installed on the Desktop, but this should not change the way /etc/cron.daily/apt works. On the Desktop, the system is updated well.

If anyone has experienced this strange behavior, please let me know.
 
Old 07-22-2010, 06:31 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Is it configured to apply the packages it downloads?
 
Old 07-23-2010, 02:36 AM   #3
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 138

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by AlucardZero View Post
Is it configured to apply the packages it downloads?
Please tell me how to check this. Of course, I considered that the default installation of a Ubuntu server should be configured to update the system every day.
 
Old 07-23-2010, 06:23 AM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
It may be configured to check for and download them but it is not configured to apply them. That would be silly.

Do you have apticron or cron-apt installed? /etc/cron.daily/apt belongs to apt and is less flexible, but does have this:

Quote:
# "APT::Periodic::Unattended-Upgrade"
# - Run the "unattended-upgrade" security upgrade script
# every n-days (0=disabled)
# Requires the package "unattended-upgrades" and will write
# a log in /var/log/unattended-upgrades
 
Old 07-24-2010, 02:18 AM   #5
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 138

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by AlucardZero View Post
It may be configured to check for and download them but it is not configured to apply them. That would be silly.

Do you have apticron or cron-apt installed? /etc/cron.daily/apt belongs to apt and is less flexible, but does have this:
Thank you for your answer.

I don't have apticron or cron-apt installed, only cron.

Should I uncomment that in my /etc/cron.daily/apt? This file also has UnattendedUpgradeInterval=0, should I make it =1? Still, /etc/cron.daily/apt is the same with the one on my desktop.
 
Old 07-24-2010, 07:06 AM   #6
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Ok, now compare /etc/apt/preferences and/or all the files in /etc/apt/preferences.d/* if they exist. You should find a difference there.

And no, don't uncomment it in /etc/cron.daily/apt; you're supposed to set apt config variables in /etc/apt/preferences.
 
Old 07-25-2010, 06:06 AM   #7
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 138

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by AlucardZero View Post
Ok, now compare /etc/apt/preferences and/or all the files in /etc/apt/preferences.d/* if they exist. You should find a difference there.
This is the little hell which emerged.
apt is from Desktop (automatic update works) and /etc/apt is from server (automatic update does not work).
Seems to me that, apart from apt/apt.conf.d, there are no other important differences, only some comments and some depositories.

Quote:
sudo diff -r /etc/apt apt
[sudo] password for user:
Only in apt/apt.conf.d: 10periodic
Only in apt/apt.conf.d: 15update-stamp
Only in apt/apt.conf.d: 20archive
Only in apt/apt.conf.d: 50unattended-upgrades
Only in apt/apt.conf.d: 99update-notifier
diff -r /etc/apt/sources.list apt/sources.list
1,4c1
< #
< # deb cdrom:[Ubuntu-Server 8.04.3 _Hardy Heron_ - Release i386 (20090709)]/ hardy main restricted
<
< #deb cdrom:[Ubuntu-Server 8.04.3 _Hardy Heron_ - Release i386 (20090709)]/ hardy main restricted
---
> #deb cdrom:[Ubuntu 8.04.3 _Hardy Heron_ - Release i386 (20090713.1)]/ hardy main restricted
53,64c50,55
< # Line commented out by installer because it failed to verify:
< #deb http://security.ubuntu.com/ubuntu hardy-security main restricted
< # Line commented out by installer because it failed to verify:
< #deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted
< # Line commented out by installer because it failed to verify:
< #deb http://security.ubuntu.com/ubuntu hardy-security universe
< # Line commented out by installer because it failed to verify:
< #deb-src http://security.ubuntu.com/ubuntu hardy-security universe
< # Line commented out by installer because it failed to verify:
< #deb http://security.ubuntu.com/ubuntu hardy-security multiverse
< # Line commented out by installer because it failed to verify:
< #deb-src http://security.ubuntu.com/ubuntu hardy-security multiverse
---
> deb http://security.ubuntu.com/ubuntu hardy-security main restricted
> deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted
> deb http://security.ubuntu.com/ubuntu hardy-security universe
> deb-src http://security.ubuntu.com/ubuntu hardy-security universe
> deb http://security.ubuntu.com/ubuntu hardy-security multiverse
> deb-src http://security.ubuntu.com/ubuntu hardy-security multiverse
Only in /etc/apt: sources.list~
Only in apt/sources.list.d: hardy-partner.list
Binary files /etc/apt/trustdb.gpg and apt/trustdb.gpg differ
I notice that:
Quote:
cat apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
and, unlike the server, the Desktop has the unattended-upgrades package installed.
 
Old 07-25-2010, 08:22 AM   #8
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Well there you go.
 
Old 07-27-2010, 03:17 AM   #9
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 138

Original Poster
Rep: Reputation: 19
Quote:
Originally Posted by AlucardZero View Post
Well there you go.
Thank you for your help.

The following pages also indicate that there is no default automatic update in Ubuntu Servers.

https://help.ubuntu.com/community/AutoWeeklyUpdateHowTo
https://help.ubuntu.com/community/Au...ecurityUpdates

I am confused about the function of /etc/cron.daily/apt, which also takes a long time to complete when I run it.
 
Old 08-31-2010, 01:28 AM   #10
doru
Member
 
Registered: Sep 2008
Distribution: Ubuntu 8.04 LTS Server
Posts: 138

Original Poster
Rep: Reputation: 19
The solution to automatic upgrades in Ubuntu 8.04 lts server:
I installed the unattended-upgrades and anacron packages (anacron because my server is not always up).
Following /usr/share/doc/unattended-upgrades/README, I put in /etc/apt/apt.conf:
Code:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
I created apt.conf with permissions: -rw-r--r-- 1 root root

According to the default settings in:
Code:
/etc/apt/apt.conf.d/50unattended-upgrades
which is also mentioned in:
Code:
/usr/share/doc/unattended-upgrades/README
only the security updates are performed automatically. For the others, you should uncomment the ...-updates line.
unattended-upgrades keeps a log in:
Code:
/var/log/unattended-upgrades/
See also:
https://help.ubuntu.com/community/Au...ecurityUpdates

https://help.ubuntu.com/community/AutoWeeklyUpdateHowTo

Thank you again for your time.

Now this looks better:
https://help.ubuntu.com/10.04/server...c-updates.html

Last edited by doru; 07-05-2011 at 07:27 AM. Reason: update
 
  


Reply

Tags
apt, cron, daily



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron hourly, daily, cron.d jobs don't execute eggsmartha Linux - General 3 09-17-2007 06:37 PM
cron.daily, cron.weekly not working mwhite74 Linux - Server 2 06-07-2007 09:51 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration