You are not logged in.
Hi,
I'm wondering how do you keep pacman synced regularly, i.e. pacman -Sy? As a cron job? Manually every day?
I'm asking because it seems all applets/scripts that rely on pacman -Qu to report the number of packages that can be upgraded require a sync with pacman -Sy before they will report the correct number of upgradeable packages. So, to have accurate pacman -Qu a pacman -Sy must be issued first, and if this is used for desktop applets and such, then I suppose pacman -Sy is scheduled to run automatically at some time interval. Is this correct? Is pacman -Sy just a cron job?
Thanks for clarifications,
-Igor
Offline
A better solution would to have a script that checks against the rss feed.
Running -Sy as a cron job can be a bit dangerous, specially if you one day forget to -Su and do a -S foobar (and that pulls in some new lib, which causes 1/2 your system to break)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
$ cat /etc/cron.hourly/refresh-pacman
#!/bin/bash
pacman -Sy
I have an hourly cron job that calls pacman -Sy. This way my conky (that relies on pacman -Qu) is updated regularly enough. Be sure not to forget to make the script executable (chmod +x)
edit
Mr Elendig, I don't understand what kind of scenario could break my system. Wouldn't the dependencies of my old packages make sure that the new version of the library can't be installed?
Last edited by robrene (2010-01-24 12:23:48)
Offline
No. "pacman -Sy" is bad... Read this thread:
http://bbs.archlinux.org/viewtopic.php?id=89328
Offline
Mr Elendig, I don't understand what kind of scenario could break my system. Wouldn't the dependencies of my old packages make sure that the new version of the library can't be installed?
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Offline
Simply use pacman -Syu when updating.
Offline
I always use pacman -Syu when updating, and I never update single packages. What would be a better method to figure out how many new packages there are for my conky script then if pacman -Sy is really this evil? I can't say it's ever gotten me into any trouble, but then again in those linked threads I only see a lot of talk but I don't really understand what the main problem is about just having a synced list of the available software versions.
Offline
i have a nightly cronjob on my server that does a pacman -Syuw --noconfirm.
use pkgd to relay packages through the lan to rest of the network.
pacman -Syu daily manually. except for my laptop under testing which right now is just -Syuw due to libpng/libjpg updates. making core/extra/comunity updates manually.
now a question: is there a way to make pacman -Syu not upgrade testing packages? this is until the rebuild is done
Offline
now a question: is there a way to make pacman -Syu not upgrade testing packages? this is until the rebuild is done
Sure... edit your pacman.conf
Offline
eldragon wrote:now a question: is there a way to make pacman -Syu not upgrade testing packages? this is until the rebuild is done
Sure... edit your pacman.conf
ghag, thats not quite what i was looking for
something of the sorts of pacman -Syu /extra
but i guess not.
Offline
@Mr.Elendig or Allan - is running pacman -Syy as a cron job also a bad idea?
Offline
UQ-igor wrote:Hi,
I'm wondering how do you keep pacman synced regularly, i.e. pacman -Sy? As a cron job? Manually every day?
Manually, every day.
Never had a major breakage that way.
The human being created civilization not because of willingness but of a need to be assimilated into higher orders of structure and meaning.
Offline
Allan wrote:eldragon wrote:now a question: is there a way to make pacman -Syu not upgrade testing packages? this is until the rebuild is done
Sure... edit your pacman.conf
ghag, thats not quite what i was looking for
something of the sorts of pacman -Syu /extra
but i guess not.
Putting testing after all other repos in pacman.conf should do the trick.
Offline
@Mr.Elendig or Allan - is running pacman -Syy as a cron job also a bad idea?
yes
Offline
One of the things that I miss from Ubuntu is how synaptic would automatically notify you when you have new packages to install. I thought it was really annoying when I actually used Ubuntu, but now I'm understanding why it's useful. I don't have the diligence to run "pacman -Suy" manually every day; I usually don't get around to running it but once every 2 weeks or so. What inevitably happens is that every 2 weeks I have a massive list of packages to update and if one of the packages happens to break my system, then I have a really difficult time of figuring out which package(s) to roll back.
Does anyone have a more automated way of doing a system update that will still ask you before installing each package? I guess you could make a cron script that executes "urxvtc -e sudo pacman -Suy" to open a terminal and execute "pacman -Suy," but I don't think this is a very good solution. If there are any errors during the update, the terminal will close immediately and you will not be able to see the errors. Does anyone know of a better way?
Offline
One of the things that I miss from Ubuntu is how synaptic would automatically notify you when you have new packages to install. I thought it was really annoying when I actually used Ubuntu, but now I'm understanding why it's useful.
I've been having a great time with this as a cron job and this in my conky.
The human being created civilization not because of willingness but of a need to be assimilated into higher orders of structure and meaning.
Offline
That's a pretty slick solution. Unfortunately I'm using xinerama (one monitor in landscape mode, one monitor in portrait mode) and can't use conky b/c xinerama doesn't support double buffering
Offline
my current solution is this. OK I call it manually but as as far as I can tell this is safest.
The call Super+U
#!/bin/bash
# used to check if user realy wants to do updates
zenity --question --title="Pacman Update" --text="Check and install updates?" --timeout="11"
case $? in
0)
terminator -e ~/bin/myupdate --geometry 930x420
exit
;;
1)
exit
;;
-1)
exit
;;
esac
The update script (~/bin/myupdate)
#!/bin/bash
# does an update
echo ":: updating system..."
sudo pacman -Syu
echo " "
echo ":: update complete..."
echo " "
sleep 2s
# function to check for and remove orphan packages
# this function looped by the while loop later
function orphanage {
echo ":: checking if orphan packages exist on the system..."
ORPHANS=`pacman -Qqdt`
if [ -z "$ORPHANS" ]
then
echo ":: system is clean, will exit..."
sleep 3s
exit
else
echo -e ":: orphans found on the system.\n$ORPHANS\n\n:: Removing..."
sudo pacman -R --nosave $ORPHANS
fi
}
# end of orphan function
#
#
# infinite loop to find and remove orphan packages
# script exits when none found
while [ 1 ]
do
orphanage
done
# end of loop
#
#
# choose echo error message or zenity error message
echo ":: ** update script did not exit normally!"
#zenity --warning --text="Update script did not exit normally"
sleep 8s
exit
Offline
Sorry for bumping this, however does this mean that pacman has no functionality to check for updates periodically without having to alter the local database (or the ability to sync the local database periodically using pacman -Sy and then not having to worry about pacman -S <package> breaking your system just so pacman -Qu actually gets recent updates)
Would be even better if pacman could properly check for updates without even requiring root privileges at all
Last edited by deteego (2010-09-02 09:53:59)
Offline
Sorry for bumping this, however does this mean that pacman has no functionality to check for updates periodically without having to alter the local database (or the ability to sync the local database periodically using pacman -Sy and then not having to worry about pacman -S <package> breaking your system just so pacman -Qu actually gets recent updates)
Would be even better if pacman could properly check for updates without even requiring root privileges at all
Pacman manages packages. Regular updates of the local database should be done manually or with a cron.
Even if you update your database regularly pacman -S still can break stuff, you would need to -Su first. In which case you would rather -Syu anyway.
And of course the updates need root priviledges, otherwise a rogue app (or person) could modify your pacman database.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Actually thats incorrect (thanks to keenerd on irc for his help), and I was never talking about syncing or even changing the local database. All I want to do is the ability to check for updates based on a mirror (without changing the local database at all), something which practically every other package manager supports with a trivial command and something which I found out is possible (read below) but ugly (requires root, and the script would be like 5-10 lines since you have to create directories and/or check if they exist in tmp etc etc)
It is actually possible to check for updates (based on your arch mirror) without altering your local system at all by doing
pacman -Sy --dbpath /tmp/somedir/
pacman -Qu --dbpath /tmp/somedir/
The problem is that pacman -Sy --dbpath requires root, however it means its possible without resorting to the pacman -Sy method which can lead to issues later on. pacman should really have a command like pacman -Qyu which would do the above in a single command (and without having to worry messing around with /tmp), the command simply fetching the database from the mirror specified in your mirrorlist, and checks your packages against that mirror to see if any need updating (without actually updating the local database) and DOES NOT REQUIRE ROOT (since it doesn't actually need root)
Then the user can go "ahhh I have some updates" and do a pacman -Syu
Last edited by deteego (2010-09-02 11:08:01)
Offline
~ % packer syndigator
1 chris@chriseee ~ % packer pacman update
0 aur/pacmon-svn 17-1
Tray applet that notifies the user of available pacman updates
1 aur/kpacupdate 0.2.1-1
Pacman update notification tool for the KDE system tray.
2 aur/noteo-pacmanstatus 0.0.3-1
Module for noteo which can check for/launch system updates via pacman
3 aur/pacupdate-svn 44-1
A simple update notifier for Arch Linux (pacman)
4 aur/zenman 1.8-2
PacMan frontend (tray update notifier) for GTK/GNOME/zenity/libnotify. Simplier, more straightforward and less annoying Alunn alternative. zenman --help for more...
5 aur/pacmail 0.1.5-1
An email notification daemon for Arch Linux (pacman) updates
6 aur/bpac 0.0.4-1
bpac is a simple script for pacman update notification. which does not need sudo.
7 aur/pupdatenotifier 0.2-1
An update notifier and update installer for Arch Linux (pacman).
8 aur/packagekit-pacman 0.6.7-2
A system designed to make installation and updates of packages easier. Pacman backend supplied by PirateJonno
฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz
Offline
Cdh do those programs update depending on your local database or your mirror (thats the golden question )
I have created a message in the pacman-dev mailing list for a patch (so you dont require root do do pacman -Sy --dbpath /tmp/somedir/)
Last edited by deteego (2010-09-02 12:54:45)
Offline
The problem is that pacman -Sy --dbpath requires root
There's a workaround, followed by a "but" (and then another hackish workaround).
$ fakeroot pacman -Sy --dbpath /tmp/somedir
:: Synchronizing package databases...
testing 15.9K 246.1K/s 00:00:00 [--------------------------------------] 100%
core 35.5K 237.2K/s 00:00:00 [--------------------------------------] 100%
extra 463.0K 841.3K/s 00:00:01 [--------------------------------------] 100%
community-testing 0.7K 20.3M/s 00:00:00 [--------------------------------------] 100%
community 380.8K 781.2K/s 00:00:00 [--------------------------------------] 100%
But.. If you're specifying /tmp/somedir as your --dbpath, you're never going to go find any updates because the local and sync DBs live in the same place. So... the solution to that is:
$ ln -s /var/lib/pacman/local /tmp/somedir
$ pacman -Qu --dbpath /tmp/somedir
make 3.81-5
vim 7.3-1
vim-runtime 7.3-1
xf86-input-evdev 2.4.0-2
xkeyboard-config 1.8-1
xorg-server 1.8.1.902-1
Tada!
Offline