You are not logged in.

#1 2013-11-02 20:55:44

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

[solved] used checkupdates

--edit--

using checkupdates instead of original thought


im not sure at all on how to correctly write a file so that every 15 minutes systemd will run "sudo pacman -Syy"

anyone mind pointing me in a direction?

i know the systemd wiki has explanations on writing services.  but this is the first one ill be writing so if there is any other material on how to i would appreciate a good place to begin

Last edited by VanillaFunk (2013-11-02 22:24:25)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#2 2013-11-02 21:04:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] used checkupdates

VanillaFunk wrote:

every 15 minutes systemd will run "sudo pacman -Syy"

You can run a modification of 'checkupdates' or something like that, but why sync every 15 minutes?
Edit: Especially since it's '-Syy', not just '-Sy'. Seems wasteful.


Instead of a systemd timer you can use good ol' cron.

Last edited by karol (2013-11-02 21:07:52)

Offline

#3 2013-11-02 21:06:49

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [solved] used checkupdates

This is a bad idea™.

As karol says, use checkupdates…


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2013-11-02 21:09:59

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: [solved] used checkupdates

ok ... so what is the best way to keep package repositories up to date automatically

-- edit --

just saw karols post will look into it ty

Last edited by VanillaFunk (2013-11-02 21:10:42)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#5 2013-11-02 21:12:58

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,089
Website

Re: [solved] used checkupdates

VanillaFunk wrote:

ok ... so what is the best way to keep package repositories up to date automatically

There isn't. Do not do this. If you want to use Arch, then you need to be responsible for your system. If you are not able or willing to spend the time maintaining the system, then you should not be using Arch.

All the best,

-HG

Offline

#6 2013-11-02 21:25:38

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: [solved] used checkupdates

the point of this endevor was i have pacwidget in my rc.lua (awesome wm)  and it runs pacman -Qu every half hour so since as far as i can see -Qu doesnt search from the repositories unless im wrong about that i wanted to at least keep those syncd im not looking for an easy way out of maintaining my machine i just would like the widget to work as i would want it to maybe im asking my question all wrong but either way thank you guys for the replies

-- i think mayhaps i am not asking correctly --

Last edited by VanillaFunk (2013-11-02 21:31:39)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#7 2013-11-02 21:31:02

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [solved] used checkupdates

/usr/bin/checkupdates --help

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2013-11-02 21:36:45

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] used checkupdates

I think 'checkupdates' may be just what you need.

VanillaFunk, next time please start with https://bbs.archlinux.org/viewtopic.php … 8#p1344858 instead of https://bbs.archlinux.org/viewtopic.php … 1#p1344841 or post both i.e. the actual problem and the solution you came up with.

Offline

#9 2013-11-02 21:42:45

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: [solved] used checkupdates

@ jasonwryan

thanks for all the info i see the issue with running -Sy now and setting up the checkupdates bit that you advised.  thank you all for the help ill go mark this as solved  since regardless the topic is just not something that should be done big_smile


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#10 2013-11-02 21:54:15

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [solved] used checkupdates

Cool. It is perfectly safe to run checkupdates from a cron job (I have mine run @hourly). I also run cower -u and aurphan -a regularly so I know what needs updating or adopting. smile


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2013-11-02 21:59:13

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,089
Website

Re: [solved] used checkupdates

jasonwryan wrote:

Cool. It is perfectly safe to run checkupdates from a cron job (I have mine run @hourly). I also run cower -u and aurphan -a regularly so I know what needs updating or adopting. smile

On this note, just a quick idea if you want to know how many packages on your system need to be updated (and you have cower and bc installed), then here's a quick function to use:

lsupd () {
   echo "$(checkupdates|wc -l)+$(cower -u|wc -l)"|bc -l
}

All the best,

-HG

Last edited by HalosGhost (2013-11-02 21:59:26)

Offline

#12 2013-11-02 22:00:39

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: [solved] used checkupdates

im assuming that since the pacwidget reads from the output of popen()
that i can replace 'pacman -Qu' with 'checkupdates' so if im correct i wont even need to set up a cron job
also im im correct even running checkupdates from cron
and then 'pacman -Qu' from the widget wouldnt change the results i was having in first place

but yea either way...
ty guys for the help

Last edited by VanillaFunk (2013-11-02 22:02:04)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#13 2013-11-02 22:02:57

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] used checkupdates

VanillaFunk wrote:

also im im correct even running checkupdates from cron
and then 'pacman -Qu' from the widget wouldnt change the results i was having in first place

Not sure what you mean.
'checkupdates' doesn't touch the regular pacman sync db, it uses a "fake" one, so 'pacman -Qu' can be outdated.

Offline

#14 2013-11-02 22:12:47

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: [solved] used checkupdates

karol wrote:
VanillaFunk wrote:

also im im correct even running checkupdates from cron
and then 'pacman -Qu' from the widget wouldnt change the results i was having in first place

Not sure what you mean.
'checkupdates' doesn't touch the regular pacman sync db, it uses a "fake" one, so 'pacman -Qu' can be outdated.

the widget generates a list of packages from the output of pacman -Qu

but since pacman -Qu doesnt print the output from the repositories then
i will use checkupdates in its place

without pasting the whole widgets code here ... the widget pastes the output as a tooltip so if i use the checkupdates it will still generate the list of packages as -Qu would except these will be from the repository instead of from my local machine

hope that made more sense smile


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#15 2013-11-02 22:35:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] used checkupdates

HalosGhost wrote:
jasonwryan wrote:

Cool. It is perfectly safe to run checkupdates from a cron job (I have mine run @hourly). I also run cower -u and aurphan -a regularly so I know what needs updating or adopting. smile

On this note, just a quick idea if you want to know how many packages on your system need to be updated (and you have cower and bc installed), then here's a quick function to use:

lsupd () {
   echo "$(checkupdates|wc -l)+$(cower -u|wc -l)"|bc -l
}

All the best,

-HG

$ echo "$(checkupdates|wc -l)+$(cower -u|wc -l)"|bc -l
warning: moc-svn [ignored] 2526-1 -> 2536-1
12

We need to send potential warnings from cower to /dev/null

$ (checkupdates; cower -u 2>/dev/null) | wc -l
12

I might actually use it :-)

Offline

#16 2013-11-02 22:39:42

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: [solved] used checkupdates

@karol

i had just started using moc...  loving it and been working on a good theme for it

beats banshee and mp3blaster was givin me issues


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#17 2013-11-02 23:35:24

HalosGhost
Forum Moderator
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,089
Website

Re: [solved] used checkupdates

karol wrote:
$ echo "$(checkupdates|wc -l)+$(cower -u|wc -l)"|bc -l
warning: moc-svn [ignored] 2526-1 -> 2536-1
12

We need to send potential warnings from cower to /dev/null

Ahh, I had never seen warnings from cower before, but that does make sense. Well done!

I might actually use it :-)

I'm glad I could be the spark of your inspiration tongue

All the best,

-HG

Offline

#18 2013-11-03 04:00:44

VanillaFunk
Member
From: MA. USA
Registered: 2013-06-10
Posts: 396
Website

Re: [solved] used checkupdates

--edited for a better solution --

so i got it working had to edit the widget a bit to get it to count right.

anyway ill paste the widget here in case anyone else wants something like it

-- Pacman Widget
pacwidget = wibox.widget.textbox()

pacwidget_t = awful.tooltip({ objects = { pacwidget},})

vicious.register(pacwidget, vicious.widgets.pkg,
                function(widget,args)
                    local io = { popen = io.popen }
                    local s = io.popen("pacman -Qu -b /path/to/checkupdates/database")
                    local str = ''
		    local i = 0

                    for line in s:lines() do
                        str = str .. line .. "\n"
                        i = i + 1
		    end
                    pacwidget_t:set_text(str)
                    s:close()
                    return "☭: " .. i .. "    "
                end, 1800, "Arch")

it does require vicious but instead of using the normal pacman -Qu it now uses checkupdates

-- edit --

it does check every hour  the 1800 is that setting it to half hour would make it 900

thank you all again for helping me to get this working big_smile

i did after all use a cron job as i found checkupdates inside the rc.lua causes the system to hang.  ive updated the widget to apply to the cron job

Last edited by VanillaFunk (2013-11-07 01:22:41)


archx86_64 : awesomewm
https://github.com/dreemsoul

Remeber to feed the squirrels

Offline

#19 2013-11-03 06:21:46

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: [solved] used checkupdates

I didn't know there was a 'checkupdates' command until just now. I made a bash script to get an update count

#!/bin/bash

pacman -Syup | grep http:// | wc -l > /tmp/updateCount

and added a cron entry to root for it

@reboot $HOME/Launchers/updateCount
0,30 * * * * $HOME/Launchers/updateCount

then I added the count to my conky time bash script (non-related lines omitted)

...
updatestmp=$tmpfolder/time-updates
...
updatecount=$(cat $updatestmp)
...
# check if there are updates
if [ -f /var/run/reboot-required ]; then
 # we need to reboot, report to conky
 echo "\${color6}Restart required."
elif [ "$updatecount" = 0 ] ; then
 # no updates, report to conky
 echo "\${color7}System up to date."
elif [ "$updatecount" = 1 ] ; then
 # updates, report to conky
 echo "\${color5}$updatecount \${color6}New Update Available\${color5}!"
else 
 # updates, report to conky
 echo "\${color5}$updatecount \${color6}New Updates Available\${color5}!"
fi
...

Last edited by HiImTye (2013-11-03 06:23:23)

Offline

#20 2013-11-03 14:17:30

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [solved] used checkupdates

Sidenote: Please don't mange the OP and title of the thread like this. The thread is *really* confusing now, and of much less help for other people with the same question in the future.

Last edited by Mr.Elendig (2013-11-03 14:18:27)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB