OpenSUSE Linux Tips, tricks, how-tos, opinions, and news
My Resume - My LinkedIn Profile - twitter: @scottmmorrisI had a smooth, easy experience with a fresh install of openSUSE 11.2 on my desktop this weekend. Man, that was nice.
With the excellent openSUSE Build Service available, I find myself there often. Many times I am looking for more recent versions of packages than what are available from the repositories I have loaded into my machine. Once the packages are found, I usually just grab the repository that they are in and load that into YAST.
For example, let’s say we’re looking for pidgin. Using YaST or zypper, we do a search, and find that we have version 2.6.2 available to us. However, with the openSUSE Build Service, we see that 2.6.3 is available. We’ll just grab the repo for it, which is located directly above the 1-click install button. Right-click on it, select “Copy Link Location.” You have the repo in your clipboard.
Then, we can use zypper to load our repository into YaST, set it to autorefresh, and then refresh it. Then, when we search for pidgin again, 2.6.3 shows up rather than 2.6.2. It’s a quick, easy way to collect and save reliable repositories that have newer packages in them.
To add a repo, then set it to autorefresh, then refresh it takes three, semi-lengthy commands, for example:
[1049][root@laptop:~]$ zypper addrepo "http://download.opensuse.org/repositories/GNOME:/Apps/openSUSE_11.2" "Gnome Apps"
Then:
[1049][root@laptop:~]$ zypper modifyrepo -r "Gnome Apps"
Then:
[1049][root@laptop:~]$ zypper refresh "Gnome Apps"
Rather than type all that out every time, I threw a quick script together that I call ‘repoadd’ (don’t forget to run chmod +x on it to make it executable) to save me all the agony:
#!/bin/sh # $1 is the repo, i.e. http://download.opensuse.org/repositories/GNOME:/Apps/openSUSE_11.2 # $2 is the name you wish to give it, i.e. "Gnome Apps" zypper addrepo "$1" "$2" zypper modifyrepo -r "$2" zypper refresh "$2"
Now, instead of having to type that all out every time, you can just run:
[1049][root@laptop:~]$ repoadd "http://download.opensuse.org/repositories/GNOME:/Apps/openSUSE_11.2" "Gnome Apps"
Of course, 1-Click Install does essentially the same thing. I just thought I’d explore and share this different way of going through that process. You never know when those alternative ways of doing things can save your hide.
If you enjoyed this post, make sure you subscribe to my RSS feed!| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| « Feb | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | |||
51 queries. 0.684 seconds
December 7th, 2009 at 3:11 am
“zypper addrepo -f” sets autorefresh while adding repository. Also I’m not sure why you need to call refresh after adding an autorefreshed repo (it still will be refreshed before any zypper command).
December 7th, 2009 at 3:20 am
Just one minor note, you can also use
‘zypper ar -f http://download.opensuse.org/repositories/GNOME:/Apps/openSUSE_11.2/GNOME:Apps.repo‘
It will add repository with some default name and enable autorefresh by default (-f option) and this repo will be refreshed automatically once you will try to do anything with it. But it’s always nice to see people scripting to make their life easier. Keep up good work.
December 7th, 2009 at 10:34 am
That’s the kind of feedback that I *TOTALLY LOVE*! Ways to make stuff way simpler. If I lived around you guys, I’d buy you a drink for your suggestions. I’m humbly honored for your insights. Thank you for stopping by and sharing your thoughts.
December 7th, 2009 at 10:35 am
@Pavol: It’s really kind of a dorky personal preference. When I go to use it with the next command, I don’t like waiting, so I want it already refreshed when I search for packages. Yeah, I’m somewhat impatient. But I mean, it’s totally just my own personal quirk.