LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-06-2005, 04:30 PM   #1
ptawe
Member
 
Registered: Mar 2005
Posts: 46

Rep: Reputation: 15
automated update using apt get


Hello !

I would like to write a script that automate updates without the need to answer interactively.

But I can't find any information about:

1- automatically pinning packages flagged by listbug:
apt-get -y would install buggy packages, --trivial-only would reject them, but what would pin them ? )

2- assigning some packages to specific branches:
would apt-get -t upgrade only the packages that are behind testing ? would it force all the packages to testing?

I experimented recently by setting a higher priority for testing in the preference script to get a general idea.

But it would still download the highest version which was unstable eventhough the current version on my system was behind both testing and unstable ?!?

3- is there a way to flag securiy updates in a similar way as listbugs flags bugs? something that would work for both testing and unstable would be helpful..

thanks for any information you can provide about this.
 
Old 07-06-2005, 04:50 PM   #2
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
1. I'd say you somehow have to add those packages to /etc/apt/preferences. You have to insert the packages apt-listbugs gives in this file and in the proper syntax, like this:

"Package:*
Pin: release a=unstable
Pin-Priority:1001"

I don't know enough about bash and sid that I could do this but I'm sure it's possible I don't use apt-listbugs so I don't know how it works but you might have a problem removing a package from the pin later.

2) Don't you have to specify which branch after the -t e.g. apt-get -t unstable upgrade?

3) Read the apt-howto on the priority numbers for pinning. It'll explain what each number does in there.

3) unstable doesn't have security updates I think, just the normal updates. Etch has security updates which you can enable by copying the stable line for security updates and changing stable to testing.
 
Old 07-06-2005, 07:39 PM   #3
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,886
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
You might want to take a look at:
cron-apt (0.3.0) automatic update of packages using apt-get
Contains a tool that is run by a cron job at regular intervals. By default it just updates the package list and download new packages without installing. You can instruct it to run anything that you can do with apt-get (or aptitude).

It can optionally sends mail to the system administrator on errors, log to syslog or a separate log file.

Observe that this tool may be a security risk, so you should not set it to do more than necessary. Automatic upgrade of all packages is NOT recommended unless you are in full control of the package repository.
http://packages.debian.org/unstable/admin/cron-apt

apt-watch (0.3.2-2) Monitor apt sources for upgrades
apt-watch is a GNOME applet which will inform you when upgrades are available for your computer. It is similar to Windows Update or the Red Hat Network applet.
http://packages.debian.org/unstable/admin/apt-watch
 
Old 07-08-2005, 03:35 PM   #4
ptawe
Member
 
Registered: Mar 2005
Posts: 46

Original Poster
Rep: Reputation: 15
thanks for the tips
I try to use them to setup my automated updates.

How would we pin packages automatically ? i would like my script to be non interactive.

Also, i have noticed that updating some packages can sometimes cause apt to attempt to remove a lot of packages. something must have gone wrong ! Any idea about detecting these things and avoid breaking the whole system because of bad dependencies?
 
Old 07-08-2005, 04:27 PM   #5
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
Well I'm not sure if this automated updating is a good idea anyway. The best way to verify is to read it yourself and how much time does it cost.

Well you have to extract the packagename from the apt-listbug thing if it contains a bug. Now I'm not sure how it lists those packages as I don't use it but there are command line tools like sed and awk (not sure if it's what you need) that can manipulate text etc. Then you write the preferences file with this. This could be made working pretty ok I'd say. Problem comes with automatically finding when to unpin things.

For the last thing I'd say that you have to define by yourself what's too much or if some package should stay. I've had it delete some packages I didn't need anymore as well and it often wasn't a problem. And if it was the real problem was that I tried to install a small part with a lot of dependencies that I wanted to keep. But if you only automatically upgrade everything should go fine and it should only delete things that you can't override anyway.
 
  


Reply



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
apt-get install not working / apt-get update is ok remy215 Debian 2 10-01-2005 07:02 PM
apt-get update errors since Debian released ( bad /etc/apt/sources.list ?) forgox Debian 10 06-13-2005 12:28 PM
apt-get update biojayc Ubuntu 1 04-28-2005 01:50 PM
Does 'apt-get update' update the database used by 'apt-cache'? davidas Debian 5 04-20-2004 01:27 AM
Cant get apt to update efi360 Linux - Newbie 7 04-05-2004 10:48 AM

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

All times are GMT -5. The time now is 11:08 AM.

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