I believe that you are depending here on an unset @apt_updated being nil, I'd prefer providing a default value setting somewhere logical.  Also, I'd prefer an 'if' to an 'unless' just for readability.