mintUpdate icon says "up to date" - even if updates avail

Questions about applications and software
Forum rules
Before you post please read this

Re: mintUpdate icon says "up to date" - even if updates avai

Postby norm.h on Tue Aug 05, 2014 6:50 am

Now, I don't understand ANY of this, but here is my usr/lib/linuxmint/mintUpdate/checkAPT.py file that karl refers to:
I wonder if it gives anyone any clues?

Code: Select all
#!/usr/bin/env python

import os
import sys
import apt

#def checkDependencies(changes, cache):
#    foundSomething = False
#    for pkg in changes:
#        for dep in pkg.candidateDependencies:
#            for o in dep.or_dependencies:
#                try:
#                    if cache[o.name].isUpgradable:
#                        pkgFound = False
#                        for pkg2 in changes:
#                            if o.name == pkg2.name:
#                                pkgFound = True
#                        if pkgFound == False:
#                            newPkg = cache[o.name]
#                            changes.append(newPkg)
#                            foundSomething = True
#                except Exception, detail:
#                    pass # don't know why we get these..
#    if (foundSomething):
#        changes = checkDependencies(changes, cache)
#    return changes

try:
    cache = apt.Cache()
   
    if os.getuid() == 0 :
        use_synaptic = False
        if (len(sys.argv) > 1):
            if sys.argv[1] == "--use-synaptic":
                use_synaptic = True

        if use_synaptic:
            window_id = int(sys.argv[2])
            from subprocess import Popen, PIPE
            cmd = ["sudo", "/usr/sbin/synaptic", "--hide-main-window", "--update-at-startup", "--non-interactive", "--parent-window-id", "%d" % window_id]
            #cmd.append("--progress-str")
            #cmd.append("\"" + _("Please wait, this can take some time") + "\"")
            comnd = Popen(' '.join(cmd), shell=True)
            returnCode = comnd.wait()
            #sts = os.waitpid(comnd.pid, 0)           
        else:
            cache.update()

    sys.path.append('/usr/lib/linuxmint/common')
    from configobj import ConfigObj
    config = ConfigObj("/etc/linuxmint/mintUpdate.conf")
    try:
        if (config['update']['dist_upgrade'] == "True"):
            dist_upgrade = True
        else:
            dist_upgrade = False
    except:
        dist_upgrade = True
       
    # Reopen the cache to reflect any updates
    cache.open(None)
    cache.upgrade(dist_upgrade)
    changes = cache.get_changes()
   
    # Add dependencies
    #changes = checkDependencies(changes, cache)

    for pkg in changes:
        if (pkg.is_installed and pkg.marked_upgrade):
            package = pkg.name
            newVersion = pkg.candidate.version
            oldVersion = pkg.installed.version
            size = pkg.candidate.size
            sourcePackage = pkg.candidate.source_name
            description = pkg.candidate.description
            if (newVersion != oldVersion):
                update_type = "package"
                for origin in pkg.candidate.origins:
                    if origin.origin == "Ubuntu" and '-security' in origin.archive:
                        update_type = "security"
                        break
                    if origin.origin == "linuxmint":
                        if origin.component == "romeo":
                            update_type = "unstable"
                            break
                        elif origin.component == "backport":
                            update_type = "backport"
                            break
                        else:
                            update_type = "linuxmint"

                resultString = u"UPDATE###%s###%s###%s###%s###%s###%s###%s" % (package, newVersion, oldVersion, size, sourcePackage, update_type, description)
                print resultString.encode('ascii', 'xmlcharrefreplace');
   
except Exception, detail:
    print "ERROR###ERROR###ERROR###ERROR###ERROR###ERROR###ERROR"
    print detail
    sys.exit(1)
norm.h
Level 4
Level 4
 
Posts: 230
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Linux Mint is funded by ads and donations.
 

Re: mintUpdate icon says "up to date" - even if updates avai

Postby norm.h on Tue Aug 05, 2014 11:12 am

A vague thought....

The only thing I've altered is the refresh period.
I used to have it set to daily, and since changing it to minutes the issue seems to have been resolved.
As we switch our machines off each night, and the time we switch on each day isn't consistent, could this mean that Update Manager was "missing" refresh points?

Just noticed another update (mint-mirrors) is available, so it seems all is now well.

What switching on / off regime do others with this issue use?
norm.h
Level 4
Level 4
 
Posts: 230
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: mintUpdate icon says "up to date" - even if updates avai

Postby niowluka on Thu Aug 07, 2014 3:45 pm

norm.h wrote:As we switch our machines off each night, and the time we switch on each day isn't consistent, could this mean that Update Manager was "missing" refresh points?

It seems to be the case... I normally let my PC run 24/7, but at the time of writing my first post regarding this, I was freshly after install when I used to reboot or restart X often. Although frankly, I would expect mintUpdate to check for updates right after starting, and then wait, not the other way round

I have mine set to 12h, and I only check for security updates, so sometimes it can be several days between updates...
Mint 17 Openbox (MATE) 64bit | Linux 3.16.2 (Vanilla)

Gigabyte GA-880GA-UD3H | AMD Phenom II X4 965 3.4Ghz | G.Skill 8GB DDR3-1600 RipjawsX, F3-12800CL8D-8GBXM | MSI R7 260X 2048 MB GDDR5 OC
User avatar
niowluka
Level 4
Level 4
 
Posts: 318
Joined: Tue May 27, 2014 6:28 pm
Location: London, UK

Re: mintUpdate icon says "up to date" - even if updates avai

Postby norm.h on Fri Aug 08, 2014 11:13 am

niowluka wrote:[...] Although frankly, I would expect mintUpdate to check for updates right after starting, and then wait, not the other way round..

That was my expectation too, but I've noticed that if any updates are available they're not notified until at least after the first "sleep" period.

Perhaps I'll gradually increase the refresh period, just to see what happens, but having been notified of updates several days in a row, I'm satisfied my issue is resolved.

I'll not mark the thread "solved" as others may still have the problem.
norm.h
Level 4
Level 4
 
Posts: 230
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Re: mintUpdate icon says "up to date" - even if updates avai

Postby karlchen on Fri Aug 08, 2014 5:56 pm

norm.h wrote:
niowluka wrote:[...] Although frankly, I would expect mintUpdate to check for updates right after starting, and then wait, not the other way round..

That was my expectation too, but I've noticed that if any updates are available they're not notified until at least after the first "sleep" period.

Well, I guess the riddle has been solved, the riddle, not the problem.
On previous Mint versions, mintupdate checked the repositories once after it had been launched and then went to sleep for the configured interval. Then it checked the repositories again and went to sleep and so on.
Since Mint 17, mintupdate only checks the apt cache when it is launched, then goes to sleep for the configured interval. And only afterwards it really checks the repositories. This matches my recent observations, too.
As my interval has been set to 3 hours mintupdate frequently does not have a chance of waking up before the system gets shutdown again for the night. (Mint 17 is still just a trial system here used for short hours in the evening. My office machine runs on Mint 13 still, and so far there is no good reason to change this.)

--
P.S.:
On Mint 17, the sleep interval has been shortened to 1 hour in order to give mintupdate a chance to do its job. We'll see ...
User avatar
karlchen
Level 11
Level 11
 
Posts: 3774
Joined: Sat Dec 31, 2011 7:21 am

Re: mintUpdate icon says "up to date" - even if updates avai

Postby norm.h on Sat Aug 09, 2014 8:35 am

karlchen wrote:Since Mint 17, mintupdate only checks the apt cache when it is launched, then goes to sleep for the configured interval. And only afterwards it really checks the repositories. .

One has to wonder why this change.
norm.h
Level 4
Level 4
 
Posts: 230
Joined: Tue Mar 23, 2010 11:45 am
Location: Oxfordshire, UK

Previous

Return to Software & Applications

Who is online

Users browsing this forum: Josephort and 17 guests