Announcement

Collapse
No announcement yet.

How to keep my system up to date

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to keep my system up to date

    Hello.

    I upgraded to Gutsy a few days after Feisty was released. I would like to keep my system up to date and I am tired of every day manual upgrade. I also disabled adept-updater, cause it was useless.

    Any idea how to do it automatically?

    #2
    Re: How to keep my system up to date

    i don't recommended but...

    You could use cron (kcron)

    About kcron:
    KCron is an application for scheduling programs to run in the background.
    It is a graphical user interface to cron, the UNIX system scheduler.
    Press: Alt + F2 > kdesu kcron > Choose root and right click: program:
    /usr/bin/apt-get update && /usr/bin/apt-get dist-upgrade
    Choose daily + set time.

    (or aptitude)

    Or you could use anacron

    Make script file
    Code:
    #!/bin/sh
    
    /usr/bin/apt-get update && /usr/bin/apt-get dist-upgrade

    Put it in the /etc/cron.daily/. anacron should execute these scripts once a day.

    Set permissions:
    Code:
    udo chmod -v 755 /etc/cron.daily/script_name
    From UNIX permissions and chmod tutorial
    http://www.unixcities.com/howto/index3.html
    So, 755 is a terse way to say 'I don't mind if other people read or run this file, but only I should be able to modify it' and 777 means 'everyone has full access to this file'
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    Comment


      #3
      Re: How to keep my system up to date

      Thank you veru much, I used anacron and put it to /etc/cron.hourly

      Comment


        #4
        Re: How to keep my system up to date

        Just one more question, where can I found a log to control the upgrade activity? Cannot find it in /var/...

        Comment


          #5
          Re: How to keep my system up to date

          Originally posted by Wizzard
          a log to control the upgrade activity
          /var/log/dpkg.log

          Comment


            #6
            Re: How to keep my system up to date

            Thank you all very much. But it seems that it does not work as it should.

            I have this file in /etc/cron.hourly:

            #!/bin/sh

            apt-get update
            apt-get dist-upgrade -y
            apt-get -f install
            dpkg --configure -a
            apt-get clean
            apt-get autoremove -y

            But when I check /var/log/dpkg.log, there is nothing new in a lot of hours, even days. When I run that file manually, like this:

            sudo /etc/cron.hourly/dist-upgrade

            everything installs fine. where is the problem?

            Comment


              #7
              Re: How to keep my system up to date

              Just be aware that at this stage, updates will frequently, often, and with regularity cause something to break so at least with manual daily updates, you can skip them if you catch any bugs/breakages before you install anything.

              Comment


                #8
                Re: How to keep my system up to date

                Yes, I know that, of course, and I am prepared for that. I have been running the development version quite a long time and I am prepared to fix any problem that can occur.

                But I still do not know why the updates are not working fully automatically. Maybe one hour frequency is too low and sometimes the updates even cannot be finished when another update is released? Or should I modify some commands in that file or write full path or modify some parameters?

                Comment


                  #9
                  Re: How to keep my system up to date

                  From Anacron (wiki)
                  http://en.wikipedia.org/wiki/Anacron
                  Drawbacks compared to cron

                  Anacron can only run tasks once a day, (or less often such as weekly or monthly). In contrast, cron allows tasks to run as often as every minute...
                  So use cron. The easiest way: kcron.

                  If you wanto use cron/crontab. From Crontab:
                  http://doc.gwos.org/index.php/Crontab
                  A crontab is a simple text file that holds a list of commands that are to be run at specified times. These commands, and their related run times, are controlled by the cron daemon and are executed in the system's background. More information can be found by viewing the crontab's man page.
                  => man cron / man crontab


                  Links

                  The KCron Handbook
                  http://docs.kde.org/stable/en/kdeadmin/kcron/index.html

                  Crontab
                  http://doc.gwos.org/index.php/Crontab
                  Before you edit, BACKUP !

                  Why there are dead links ?
                  1. Thread: Please explain how to access old kubuntu forum posts
                  2. Thread: Lost Information

                  Comment


                    #10
                    Re: How to keep my system up to date

                    Ok, when I run kcron in root mode and want to add anything, it always crashes.

                    So I use cron. This is what I have in /etc/crontab:

                    Code:
                    # /etc/crontab: system-wide crontab
                    # Unlike any other crontab you don't have to run the `crontab'
                    # command to install the new version when you edit this file
                    # and files in /etc/cron.d. These files also have username fields,
                    # that none of the other crontabs do.
                    
                    SHELL=/bin/sh
                    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
                    
                    # m h dom mon dow user	command
                    17 *	* * *	root  cd / && run-parts --report /etc/cron.hourly
                    25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
                    47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
                    52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
                    #
                    and this is what I have in /etc/cron.hourly/dist-upgrade:

                    Code:
                    #!/bin/sh
                    
                    apt-get update
                    apt-get dist-upgrade -y
                    dpkg --configure -a
                    apt-get clean
                    apt-get autoremove -y
                    I think that it does something, cause dpkg.log is sometimes modified, but it never installs everything. When I manually run dist-upgrade, it always works fine. Is there anything, that I do wrong?

                    Comment


                      #11
                      Re: How to keep my system up to date

                      You could check /var/log/syslog (or syslog.0 ... )

                      example:
                      Code:
                      cat /var/log/syslog.0 | grep cron
                      snip
                      May 9 18:17:01 myhost /USR/SBIN/CRON[6178]: (root) CMD (run-parts --report /etc/cron.hourly)
                      May 9 19:17:01 myhost /USR/SBIN/CRON[6420]: (root) CMD (run-parts --report /etc/cron.hourly)
                      May 9 20:17:01 myhost /USR/SBIN/CRON[6659]: (root) CMD (run-parts --report /etc/cron.hourly)
                      snap
                      note
                      my cron.hourly is empty->only chekking.


                      Or (do you have mail ? In the konsole :~$ mail)

                      If not. Install mail (mailx)
                      from apt-cache show mailx
                      Description: A simple mail user agent
                      mailx is the traditional command-line-mode mail user agent.
                      Even if you don't use it it may be required by other programs.
                      From apt-cache show cron
                      Output from the commands is usually mailed to the system administrator
                      (or to the user in question); you should probably install a mail system
                      as well so that you can receive these messages.
                      So cron can send mail to you and tell what is wrong.
                      Before you edit, BACKUP !

                      Why there are dead links ?
                      1. Thread: Please explain how to access old kubuntu forum posts
                      2. Thread: Lost Information

                      Comment


                        #12
                        Re: How to keep my system up to date

                        Thank you very much, finally it was not necessary. I moved that file to cron.daily and it works fine, one dist-upgrade a day is enough.

                        Comment

                        Working...
                        X