PDA

View Full Version : FC4 yum fixer upper


tejas
17th June 2005, 04:35 PM
I've developed a simple script which will help you enable the atrpms freshrpms and dag repos for FC4

thanks to bytesniper's how to as well as imdeemvp for the GPG locations.

This will auto import the GPG locations for you, and set up the yum.repo.d/ files

I would have added livna, but apparently it is imcompatible
EDIT: added livna. If you install regular way, after installing livna, it will not install others

Post any other repos I should add over here, and I'lll modify the script accordingly

Yes I know I am making you too lazy.

To run:
1) dnload the script
2) make it executable by running:
chmod +x yumfix.txt
3) ./yumfix.txt
4) drop me a line.

Note: please be in the same folder as yumfix.txt when running if you want to do ./yumfix

Note: Please use the original yum.conf that came with FC4. /etc/yum.conf should read:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

################################################## ##################################

EDIT: I now added quiet support. ie you can pass parameters. See 2nd page of thread for details.
EDIT: Don't let the 0 views fool you. I keep reloading updates, so the counter resets

-Tejas Dinkar

bytesniper
17th June 2005, 04:43 PM
very nice! i just setup an new FC4 box and will test this out as soon as i get home from work :D

jtang613
17th June 2005, 04:45 PM

Nice work. I imagine this will probably help quite a few.

Jason

tejas
17th June 2005, 04:46 PM
Oops, wait. A fatal error I have made

Get the new version here

I had catted out $relesever instead of \$releasever
(stupid scripting error)

bytesniper
17th June 2005, 04:53 PM
hehe.. first yumfix_sp1.txt :D

bitrain
17th June 2005, 04:55 PM
Maybe you can add livna and set enabled to 0, so people only have to say --enablerepo=livna and a easy way to disable all others? Maybe a small program around yum? Let me know if you need any help.

dnar
17th June 2005, 04:57 PM
Oops, wait. A fatal error I have made

Get the new version here

I had catted out $relesever instead of \$releasever
(stupid scripting error)
I was about to say! created repos with ///

bytesniper
17th June 2005, 04:59 PM
Maybe you can add livna and set enabled to 0...<snip> good idea... but put in the script somewhere that mixing the dag/fresh/atrpm type packages with the livna/fedora.us packages can possibly cause problems. hmmm.. is this script GPL'd? got a couple of ideas.... :)

tejas
17th June 2005, 05:00 PM
Um, OK, but then I'd have to remove all the other repos everytime I start the program.
Else if you run twice, first install livna, then the other 3, you may get problems.
Oh, what the hell, I'll add it, wait a few moments

Pretty simple

read -p "Install Livna? [y|n] " LIVNA
if [ "$LIVNA" = "y" ]; then
livna
exit 0
fi

bitrain
17th June 2005, 05:07 PM
You don't have to remove then, you let the user say if they want to use livna, or else it defaults to the other 3. Then you call yum install or update package_name from your script.

remember, dag, freshrpms and atrpms are enabled=1 and livna is enabled=0

so in pseudo code (or something that looks like it):

$ run_yum --enablelivna package_name

if firstRun then
do_your_script
end if

if --enablelivna then
$params = --disablerepo=dag --diablerepo=freshrpms --disablerepo=the_other_one --enablerepo=livna
else
// comment: for good programming style, do the opposite of the above line, switch dis with enable
end if

yum $params package_name

jgbiggs
17th June 2005, 05:10 PM
Nice work, but I have a question?

Which repos play nicely with core/updates/extras that are default on a fresh FC4?

Is there a wiki/faq somewhere? I ask since FC4 is seriously lacking in the ability to play media files due to licensing matters.

Thanks.

chrille
17th June 2005, 05:12 PM
Hey, great idea! But for some reason it doesn't work for me. I tried
"sudo ./yumfix.txt", but when I typed in my root passw it said that it was not correct. So I tried again and again..., I know it's the right passw.
So, I tested to "su", but then the script said "Please run this as root or using sudo". So, how should I do?
Chrille

tejas
17th June 2005, 05:18 PM
OK, new version up top

Includes livna this time

You can't use sudo out of the box, because sudo involves editing /etc/sudoer

And I though for regular users of this, you can edit it so that you can just say
yumenable dag freshrpms atrpms
and put it in the ~/bin, so that it will auto enable

LICENSE: do whatever the heck you want with it. Just leave my name in there somewhere. Actually, make it say (c) 2005 Tejas Dinkar for ego boosting. (no, I don't care if it is in the bottom)

bitrain
17th June 2005, 05:18 PM
When you have su'd the user stays the same :confused: (so not root)
You can check this by putting an ech $USER; before the if check

edit: I think su - should solve it

tejas
17th June 2005, 05:22 PM
When you have su'd the user stays the same :confused: (so not root)
You can check this by putting an ech $USER; before the if check

edit: I think su - should solve it

OK, use su -.

Just remember to go to the correct folder.

I don't want this to become another mess like nVidia drivers, where half the people don't know how to navigate in a terminal.

Thats why I thought su would be good, it doesn't change the current folder,

bitrain
17th June 2005, 05:28 PM
I'm converting my pseudo code into real shell code, I hope you don't mind tejas.

Is it possible to let it tun from konqueror, so without going to the commandline? Maybe I can convert it into a c program if it doesn't work?

tejas
17th June 2005, 05:47 PM
Hmm, OK, whatever.

Anyway, important: new version out with new feature.

if you pass no params, it continues as normal

however, you can also call
yumfix at fresh dag

and it will install all 3 repos

options:
at | atrpms
fresh | freshrpms
dag
livna

If you want to use this a lot, copy it into /usr/local/bin as yumfix
# cp yumfix.txt /usr/local/bin/yumfix

EDIT: careful, you should not try to install livna and another repo this way. I don't know exactly what happens, but you aren't supposed to

tejas
17th June 2005, 06:59 PM
This is very strange.

I realised, that by running this script, I'm getting duplicate gpg keys each time

How to I do an rpm --import, after checking if an old GPG is present?

See title post for suggestions

bitrain
17th June 2005, 07:11 PM
If an old one is present, run this:

rpm -e gpg-pubkey-db42a60e

Where that last one is the old gpg key, see also the man pages.

Then you can import the new one.

Edit: Or do you mean how to check which one is there?

tejas
17th June 2005, 07:16 PM
See, it just adds gpg keys, without checking if they are already there.

This results in duplicates

I could do an rpm -qa, but that takes a lot of time

Is there any way to find out which keys are there, so I'll know whether the script should add it or not?

To make it worse, the keys all have funny names.

bitrain
17th June 2005, 07:24 PM
Maybe you should save the name of the key to a file you make in /root
So for instance:
dag=gpg_of_dag

and when it is empty there is no gpg and you need to import it and you save the name then. If you find a new one you can do rpm -e name_of_the_old and then rpm --import the new gpg key

Edit: for people who like to irritate programmers and delete our files, here is an extra check.
If there is no gpg in the file, check the new gpg with rpm -q new_of_new_gpg and only install if there is no output.

tejas
17th June 2005, 07:35 PM
Getting closer the GPGs are

Livna:
gpg-pubkey-a109b1ec-3f6e28d5

Dag:
gpg-pubkey-6b8d79e6-3f49313d

freshrpms:
gpg-pubkey-e42d547b-3960bdf1

atrpms:
gpg-pubkey-66534c2b-41d57eae

Does anyone know if these change over time?

I'll update it, please wait a moment

dnar
17th June 2005, 07:41 PM
I made a few tweaks for you.

- Added --help option
- Added verbose output
- Fixed issue with "su" user not detected as root
- Stops adding repos after livna when using param mode (although this needs more work, for example "yumfix.txt dag atrmps livna" incorrectly installs all 3 repos, "yumfix.txt livna dag atrmps" does not.)

I'll have a think about your key issue tomorrow. :)

bitrain
17th June 2005, 07:45 PM
Why do you not just set the livna to enabled=0, then there are no problems?

I'm trying my own port of your script in C so people don't have to use the commandline, just for my linux skills practise :). I try to make it so, that you can use it every time, so you don't have to call yum anymore manually and get the repos only once.

dnar
17th June 2005, 07:45 PM
Makes sense to me, that is how I have it tweaked personally anyway!

tejas
17th June 2005, 07:57 PM
Ok, I'll look at what you've done, and add it to my script.

I fixed the keys issue.

It is actually very satisfying, doing all of thsi work for yum.
If you want to read my first error with yum, click here
http://forums.fedoraforum.org/forum/showthread.php?t=51018

Actually gives me a sense of achievement

tejas
17th June 2005, 08:32 PM
Couple of updates.

Added dnar's help section (thanks)

I never realised that this root thing was going to be an issue.

Anyway, I modified it a bit to read:
if [ "$UID" -ge "500" ] then
error
fi

I also fixed all the key errors, and I really don't think this livna stuff is too much of a problem.

It says in the help that you should use with livna, and interactive mode catches it.

I don't know how setting enable=0 will make things any easier.

Don't forget, this is a script to help newbies use yum for the 1st time. That is why I have to take care for the keys, and stuff. It is the same to remove a .repo and set enable as 0.

bitrain
17th June 2005, 08:45 PM
I don't know how setting enable=0 will make things any easier.New users have all common repo's when they use your script, and setting enable=0 will make sure the troubles with dag/atrpms/freshrpms are not there. So when someone says, package .... is in livna, all they have to do is --enablerepo=livna and disabling the others, that did my pseudo code in one of my previous posts and I'm putting it in my C program. I'm using C so that the commandline doesn't have to be opened, and a program can be launched from konqueror or nautilus or any other filebrowser.

tejas
17th June 2005, 08:51 PM
OK, take the latest version

I even fixed that livna problem because it seems to be irritating everybody

I fixed the key errors

I fixed the problem with permissions.

I don't think there is anything I can do to this script, without porting it.

I've just sent an email to fedorafaq.org. Hopefully they'll add this script up there.

Any contributors I've left out? bytesniper imdeemvp bitrain dnar

bitrain
17th June 2005, 08:54 PM
Found a miror error in the comments, the link to fedoraforum: www.fedoraorum.org <-- missing f

tejas
17th June 2005, 09:05 PM
Someone do me a favor

Install the same repo 2 or 3 times.

Tell me if it only imports the key once, or many times.

It will say when importing a key.

I am just curious if GPG keys are comp specific

bitrain
17th June 2005, 09:12 PM
Before running your script:$ rpm -aq | grep gpg
gpg-pubkey-4f2a6fd2-3f9d9d3b
gpg-pubkey-e42d547b-3960bdf1
libgpg-error-1.0-2
gpg-pubkey-1ac70ce6-41bebeef
gpg-pubkey-66534c2b-41d57eae
gpg-pubkey-db42a60e-37ea5438
libgpg-error-devel-1.0-2
gpg-pubkey-a109b1ec-3f6e28d5
After running your script:$ rpm -aq | grep gpg
gpg-pubkey-4f2a6fd2-3f9d9d3b
gpg-pubkey-e42d547b-3960bdf1
libgpg-error-1.0-2
gpg-pubkey-6b8d79e6-3f49313d
gpg-pubkey-1ac70ce6-41bebeef
gpg-pubkey-66534c2b-41d57eae
gpg-pubkey-db42a60e-37ea5438
libgpg-error-devel-1.0-2
gpg-pubkey-a109b1ec-3f6e28d5
Ran your script and installed dag (see output above), fresh and atrpms (or tried to) Notice freshrpms!!!:$ sudo ./yumfix.txt
Password:
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] n
Install dag? [y|n] y
Importing Key for Dag
Dag Installed!
Install freshrpms? [y|n] y
Install atrpms? [y|n] y
ATRPMS Installed

tejas
17th June 2005, 09:20 PM
Works over here.

Maybe you added a space after y, before hitting enter, so it didn't install freshrpms

Anyway, what I really wanted to see was your initial and final GPG keys.

When I didn't realise what it was doing. It had make 10-15 copies of each key

Luckily I caught it.

bitrain
17th June 2005, 09:28 PM
Anyway, what I really wanted to see was your initial and final GPG keys.In my post above are the names of the gpg before running your script once and after the running. Nevermind that freshrpms, I must have done something wrong, it works ok now. Thanks! (I'm still working on my C port and a bit of my own input)

tejas
17th June 2005, 09:36 PM
In my post above are the names of the gpg before running your script once and after the running.Oh, I had realised that before. I was just giving an (apparently misworded) thanks for the testing.

Anyway, It is now 2am. Good Night.

Post if you've made any great improvements.

And wouldn't python have been a better idea for running from konqueror?

Anyway, I know very little about how great C is (I know it, but not too well).

But I assume this should be more complicated than adding
system("
to every line?

bitrain
17th June 2005, 09:56 PM
Anyway, It is now 2am. Good Night.Good night :)
I was just giving an (apparently misworded) thanks for the testing.Glad I could help, I misread your post (it's beginning to get late here too).
But I assume this should be more complicated than adding
system("
to every line?I try to make a wrapper (is that the right name?) for around yum, so people can say which package they want and it check then if the repos are there (some system("") calls and fprintf's) it calls yum.
And wouldn't python have been a better idea for running from konqueror?I don't know python, and I'm not in the mood now to learn it right now, so I use a language I do know :)

More programming tomorrow, I call it a day too, I'm already staring to long at my screen.

tejas
18th June 2005, 05:34 AM
Milestone:

By popular demand, I have set the enabled=0 option for the repos not being used, rather than removing the file

I hope I've done it correctly

And If there is anything else you want done

This file seems to have 15 different versions floating around, as I've updated each one

I didn't think it would be this popular, or I would have given it a version number

Terribly sorry

Gja Out

bitrain
18th June 2005, 07:48 PM
I didn't think it would be this popular, or I would have given it a version number

Terribly sorry

Gja OutMaybe you can do what ubuntu does, just give it a number :) . Ubuntu started with 4.10, then 5.04 came out, and the next is (if I remebered it correctly) 5.10

tejas
19th June 2005, 03:38 AM
I added version 2.5.6 yesterday, when I added the enabled=0 suggestion

I never realised what it did until testing yesterday

Why 2.5.6? Because 25/6 is my birthday!

92b16vx
19th June 2005, 12:04 PM
Ok, in the terminal, I did this...

To run:
1) dnload the script
2) make it executable by running:
chmod +x yumfix.txt
3) ./yumfix.txt
4) drop me a line.

And got this....

[john@localhost ~]$ su
Password:
[root@localhost john]# chmod +x yumfix.txt
[root@localhost john]# ./yumfix.txt
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] y
Importing Key for Livna
Livna Installed!
[root@localhost john]#

Am I good? :)

I finally got FC4 64bit running, installed no problem, haven't run into any issues sooo far, and my CD player even works now :)

tejas
19th June 2005, 12:09 PM
You are good for livna only

For some reason, if you want to use other repos, you have to uninstall livna.

Luckily for you, this means run the script again, and just click no on livna.

I don't know about specifics, but there are 97 packages extra on the combination of the other 3 (freshrpm atrpm and dag), then there is on livna

And livna only gives i386 packages, no 64bit

Therefore, I don't use livna, only the other three

dnar
19th June 2005, 12:36 PM
Tejas, thought.

Why not re-write the /etc/yum.conf from your script also? You would simple graft the default yum.conf into your script and re-write it to disk.

92b16vx
19th June 2005, 12:41 PM
[root@localhost john]# ./yumfix.txt
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] n
Install dag? [y|n] y
Importing Key for Dag
Dag Installed!
Install freshrpms? [y|n] y
Importing Key for FreshRPMS
FreshRPMS Installed!
Install atrpms? [y|n] y
Importing Key for AT RPMS
ATRPMS Installed!


Looks like I'm good to go :) thanks, So far FC4 64bit is being very well behaved, and the only issues I have found yet is Java.

tejas
19th June 2005, 12:43 PM
Yeah, I know what you are saying.

However, many people keep settings in their yum.conf, like if the repos will become obsolete, where to store the downloaded rpms.

Plus, all of the fedora updates and all are no longer found in the yum.conf, rather in the
/etc/yum.repos.d folder,
under the name [base|extras|updates].repo

I though, why deviate from the standard.

Plus, If I wrote to the yum.conf, I'd have to tell people to empty their yum.repos.d folder in case livna was hiding there.

dnar
19th June 2005, 12:46 PM
No no, I dont mean instead of writting your repos into /etc/yum.repo.d what I mean is as well as. I noticed in another post you recommended to someone that they run the standard distro yum.conf, my suggestion is to enforce that.

I guess if your scared of removing other config settings from yum.conf, you could simply remove any dag/livna/at/fresh repos from yum.conf but leave other settings alone. A bit more work for you though, I am sure your up for the challenge. :)

tejas
19th June 2005, 12:55 PM
Well, I could do the lines

head -n 11 /etc/yum.conf > tmp
mv tmp /etc/yum.conf

However, I feel this is kinda dangerous.
just a gut feeling

dnar
19th June 2005, 12:59 PM
Doesnt look too dangerous to me.

Dont forget however, this script is of most use to newbies. I doubt they will have hacked their yum.conf.

ziyeli
19th June 2005, 01:38 PM
errors appeared when i "yum update"
how can i do now?

[root@fedora MyDownloads]# yum update
Setting up Update Process
Setting up repositories
dag 100% |=========================| 1.1 kB 00:00
freshrpms 100% |=========================| 951 B 00:00
atrpms 100% |=========================| 951 B 00:00
updates-released 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
extras 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.

--> Running transaction check

---> Package portaudio.i386 0:18.1-5 set to be updated
--> Running transaction check
--> Processing Dependency: libdc1394_control.so.13 for package: ffmpeg
--> Processing Dependency: /etc/apt/sources.list for package: apt
--> Processing Dependency: /etc/apt/apt.conf for package: apt
--> Finished Dependency Resolution
Error: Missing Dependency: /etc/apt/apt.conf is needed by package apt
Error: Missing Dependency: /etc/apt/sources.list is needed by package apt
Error: Missing Dependency: libdc1394_control.so.13 is needed by package ffmpeg

tejas
19th June 2005, 01:48 PM
Perhaps try enabling livna and try again?

I'm not 100% sure what your problem is,
but the script only manages your repos.

Perhaps if you installed some of these from livna, and they are not there in the others, then the package should be reinstalled.

Are you using FC3 by any chance?

I can't find FC4 RPMs for libdc1394_control.so.13

You can always try getting the FC3 RPM and installing (pbone/net)

kussic
19th June 2005, 01:53 PM
errors appeared when i "yum update"
how can i do now?

[root@fedora MyDownloads]# yum update
Setting up Update Process
Setting up repositories
dag 100% |=========================| 1.1 kB 00:00
freshrpms 100% |=========================| 951 B 00:00
atrpms 100% |=========================| 951 B 00:00
updates-released 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
extras 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.

--> Running transaction check

---> Package portaudio.i386 0:18.1-5 set to be updated
--> Running transaction check
--> Processing Dependency: libdc1394_control.so.13 for package: ffmpeg
--> Processing Dependency: /etc/apt/sources.list for package: apt
--> Processing Dependency: /etc/apt/apt.conf for package: apt
--> Finished Dependency Resolution
Error: Missing Dependency: /etc/apt/apt.conf is needed by package apt
Error: Missing Dependency: /etc/apt/sources.list is needed by package apt
Error: Missing Dependency: libdc1394_control.so.13 is needed by package ffmpeg


I was having the same problem with dag, fresh and at... I just had to remove the atrpms repo and it worked just fine... I think at hasn't updated to FC4 or something... (that was two days ago at least, I haven't played with atrpms since then)

hitek
19th June 2005, 01:58 PM
i too have failed depengencies yum upgrade
but when i check the dependencies they are all present and installed
yum does not seem to find them

ziyeli
19th June 2005, 02:17 PM
Perhaps try enabling livna and try again?

I'm not 100% sure what your problem is,
but the script only manages your repos.

Perhaps if you installed some of these from livna, and they are not there in the others, then the package should be reinstalled.

Are you using FC3 by any chance?

I can't find FC4 RPMs for libdc1394_control.so.13

You can always try getting the FC3 RPM and installing (pbone/net)

i have got it by enabling livna
and i enabled freshrpm,and want to enable others
it will make problem? 3x

alphonsebrown
19th June 2005, 05:15 PM
I think yumex has done all this + more

92b16vx
20th June 2005, 11:40 AM
Weird, ok, now I DLed FC4 i386 adn now when I try to do this, it tells me that it can not access yumfix.txt because it isn't there, yet I have DLed it twice and am staring at it :(

dnar
20th June 2005, 11:46 AM
chmod +x yumfix.txt to make it executable.

Then run it as so: ./yumfix.txt

92b16vx
20th June 2005, 12:12 PM
Yea, I did it yesterday on FC4 64bit, but today on 386 it isn't working. I am getting "no such file or directory"

[root@localhost john]# chmod +x yumfix.txt
chmod: cannot access `yumfix.txt': No such file or directory
[root@localhost john]#

bitrain
20th June 2005, 12:21 PM
Yea, I did it yesterday on FC4 64bit, but today on 386 it isn't working. I am getting "no such file or directory"

[root@localhost john]# chmod +x yumfix.txt
chmod: cannot access `yumfix.txt': No such file or directory
[root@localhost john]#Do a ls in that directory to see if it's there.

92b16vx
20th June 2005, 12:28 PM
I typed ls in the termnial and it just told me what background I have.

bitrain
20th June 2005, 12:38 PM
I typed ls in the termnial and it just told me what background I have.It should give you all files in that directory, if the yumfix.txt file isn't shown with ls, then it is not there (under that name).
But since it does something weird, try the command: dir (it's a bit more primitive)

92b16vx
20th June 2005, 12:49 PM
Same thing, only instead of being in color it is in black and white.

[root@localhost john]# ls
Desktop
Punch Bowl Falls, Eagle Creek Wilderness Area, Columbia River Gorge,Oregon.jpg
[root@localhost john]# dir
Desktop
Punch\ Bowl\ Falls,\ Eagle\ Creek\ Wilderness\ Area,\ Columbia\ River\ Gorge,Oregon.jpg

bitrain
20th June 2005, 12:55 PM
That is the content of the "john" directory, there is no file called yumfix.txt, you must have saved it somewhere else. Did you actually saved it, or did you open it with firefox (or another browser) with a text editor?

92b16vx
20th June 2005, 01:00 PM
right clicked > saved as, it's on my desktop now, I am looking at it, and can open it and read it. It was in my home folder, but I moved it.

bitrain
20th June 2005, 01:04 PM
Ok, then thats your problem, the directory you are in, in the terminal is NOT the Desktop, but your home directory, do: cd Desktop, then do the chmod command and the ./yumfix.txt

92b16vx
20th June 2005, 01:08 PM
This is why I love this place :)

[root@localhost john]# cd Desktop
[root@localhost Desktop]# chmod +x yumfix.txt
[root@localhost Desktop]# ./yumfix.txt
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] y
Importing Key for Livna
Livna Installed!
[root@localhost Desktop]# ./yumfix.txt
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] n
Install dag? [y|n] y
Importing Key for Dag
Dag Installed!
Install freshrpms? [y|n] y
Importing Key for FreshRPMS
FreshRPMS Installed!
Install atrpms? [y|n] y
Importing Key for AT RPMS
ATRPMS Installed!


Trying the java now.

92b16vx
20th June 2005, 01:14 PM
Java done :)

Can I just install flash with yum install flashplugin?

bitrain
20th June 2005, 01:17 PM
Java done :)

Can I just install flash with yum install flashplugin?www.fedorafaq.org gives the solution for FC3, I don't know if it works with fc4 too, I just let firefox install it for me.

92b16vx
20th June 2005, 01:43 PM
Ahh ok, so when I get one of the "missing plugin" notifications at the top, just click install plugin? Ok then, I'll wait till I get one :)

tejas
20th June 2005, 02:04 PM
What!!!!!!!!!!!!!! Are you sure you are in the right directory?

It should be saved in My Downloads according to firefox.

Can you open it in some text editor??????

This is beyond me!

92b16vx
20th June 2005, 02:09 PM
When I Dled it, I saved it to Home, which is my default location for DLs through FF, so then I was trying to install, and was getting the "no such file or directory" error, then I moved it to desktop, once there followed the instructions and got it working. Beats me why it wasn't working from Home folder, it did yesterday on 64bit.

alphonsebrown
20th June 2005, 03:38 PM
ohhh come on... find your file man!!! "locate yumfix.txt"

92b16vx
20th June 2005, 05:40 PM
ohhh come on... find your file man!!! "locate yumfix.txt"
I didn't have to lacate it, I knew where it was, I was entering the wrong location in the command to move it.

rlevitin
20th June 2005, 11:31 PM
Whenever I run yum it gives a warning:

Repository dag already added, not adding again
Repository freshrpms already added, not adding again

but then continues and does its stuff... its just really annoying to see that every time... does anyone know how to fix it?

tejas
21st June 2005, 03:52 AM
Whenever I run yum it gives a warning:

Repository dag already added, not adding again
Repository freshrpms already added, not adding again

but then continues and does its stuff... its just really annoying to see that every time... does anyone know how to fix it?Look at your /etc/yum.conf. You probably have dag installed once there, and once in your /etc/yum.repos.d/dag.repo.

Thus, yum sees the dag repo twice.

rlevitin
21st June 2005, 04:11 AM
Look at your /etc/yum.conf. You probably have dag installed once there, and once in your /etc/yum.repos.d/dag.repo.

Thus, yum sees the dag repo twice.

gotcha, thanks, think it worked

rzoom
22nd June 2005, 01:06 AM
How about a quick port to python, then firing up glade and putting a pretty GTK gui on the front-end? That should make it super newb-friendly! No command line at all. =)

bitrain
22nd June 2005, 09:13 AM
How about a quick port to python, then firing up glade and putting a pretty GTK gui on the front-end? That should make it super newb-friendly! No command line at all. =)I don't know python, but I'm working on an installer written in C using gtk, but I'm adding extra functionality, users can install files (remote and local) and my program works out dependencies using yum.

tejas
22nd June 2005, 10:14 AM
Keep up the great work!!

Actually, I really didn't want to make it in a compiled format (even if I did know eough C), was because the size of the file would become huge, and it would not be easy to reverse engineer.

Anyway, the original script, which just enables/disables the 4 repos, should be uploaded at fedoraNEWS.org sometime soon. I'll post the exact location after I figure out how to properly upload it, and finish this article I'm working on

rzoom
22nd June 2005, 05:01 PM
Why would the size of the binary become huge? I can't imagine it being more than a few KB. It should be < 50 or so lines of C.

Also, much open source software is written in C, releasing the source along with the binary is standard practice. Those that are interested can get the source and review it. Those that just want the program (which would be most people I imagine) can just grab the binary (or rpm). By the way, it would probably be easiest to make it into an rpm so that it is super easy to install.


EDIT: Didn't consider the GTK front-end. Even with the GUI it shouldn't be more than a couple hundred KB.

tejas
22nd June 2005, 05:56 PM
Why would the size of the binary become huge? I can't imagine it being more than a few KB. It should be < 50 or so lines of C.

Also, much open source software is written in C, releasing the source along with the binary is standard practice. Those that are interested can get the source and review it. Those that just want the program (which would be most people I imagine) can just grab the binary (or rpm). By the way, it would probably be easiest to make it into an rpm so that it is super easy to install.The script itself is about 200 lines + comments. I think making it in cpp would be a lot more difficult. And of course the size of the compiled program would be a lot more than the original. Try compiling: int main() {return 0;}. The source is 25 bytes. The compiled version (Gcc 4.0) is about 5Kb. That is 200 times the size. Of course, big programs won't have such a big difference, but it will still be around 20-30 times. This is because compiling makes a program stand alone. Scripting makes use of a person's shell (Bash, in my case)

To me converting to c seems like a good idea, but I don't agree totally with people about it's merits:
It is huge, much bigger than a script
If you have a script like this, you can just open the script in some editor and add your own repo. Like fedora.us. There are thousands of repos out there. You just make a fn() called repo(), and add the repo to the fn() disable. Look at the script, you will realise how easy it is to modify. No need to recompile or anything.
Even if it is done, people will still have to use the command line. Once a program/script is downloaded, it has it's properties set (usually) as 644, which means no execute. You still have to do a chmod +x file, so that it can be run. I'm sure there must be a way to work around this, but I don't know how. My logic is that If you can get a guy to run chmod, then he can also type ./yumfix.txt without any difficulties.
As far as the purpose of this script - to help newbies set up their yum.conf's. Managing their repos was just a bonus. There has been 359 downloads of the lastest version of this script, and I don't know how many dnloads of the older ones. I have gotten very few complaints which relate to the bugs, and at least a couple of 'thank you' letters from people, so I know the script is doing it's job. Hense, I feel that this script has been a success.

If you feel the script can be improved even more, go ahead. I completely approve of what Bitrain is doing. I am just giving my own reasons for why I picked scripting. And why I still feel that it was the best choice. However, I cannot really say which is best, until I see the finished version of Bitrain's program. Then, perhaps, a fair comparison on the ease of use, can be done.

And the whole point of this program is so that people need not do so much work to set up a yum repo. I personally feel it would be kinda silly to get people to go through the trouble of getting an RPM file for this, and installing the GPG key so that the RPM works without a warning. So in effect, the work needed is more, at least in my opinion.

bitrain
22nd June 2005, 06:29 PM
I feel that this script has been a success.And it still is :D
However, I cannot really say which is best, until I see the finished version of Bitrain's program. Then, perhaps, a fair comparison on the ease of use, can be done.My program will take this is a small part, I'm now getting used to gtk and trying to get the data out of every control (had my last exam today, so now I have time...).

It seems to me, that using your script can't be hard, open a program using a click - click method, copy/paste a line and then type a dot and a slash followed by the programs name.

Try compiling: int main() {return 0;}. The source is 25 bytes. The compiled version (Gcc 4.0) is about 5Kb.That's one of the few disadvantages of having a program written in a programming language, instead of a scripting language.

mpolo
23rd June 2005, 02:41 PM
Hey, great idea! But for some reason it doesn't work for me. I tried
"sudo ./yumfix.txt", but when I typed in my root passw it said that it was not correct. So I tried again and again..., I know it's the right passw.


You need to set up /etc/sodoers, and then you use your OWN password, not the root password to execute the command.

ilja
23rd June 2005, 03:01 PM
I moved it to "News". Sorry I noticed the thread that late.

firesand
24th June 2005, 04:16 AM
[root@localhost firesand]# yum update
Setting up Update Process
Setting up repositories
livna 100% |=========================| 951 B 00:05
updates-released 100% |=========================| 951 B 00:03
http://ftp.iasi.roedu.net/mirrors/fedora.redhat.com/core/4/i386/os/repodata/repomd.xml: [Errno 4] IOError: HTTP Error 403: Date: Fri, 24 Jun 2005 03:13:07 GMT
Server: Apache
Content-Length: 262
Content-Type: text/html; charset=iso-8859-1
Trying other mirror.
base 100% |=========================| 1.1 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Error: failure: repodata/primary.xml.gz from livna: [Errno 256] No more mirrors to try.
[root@localhost firesand]#

alphonsebrown
24th June 2005, 05:23 AM
try to ping or browse that... actually 403 is worst

tejas
24th June 2005, 05:35 AM
403 means permission denied (If I remember)

you aren't from UAE or something where the ISP blocks out a lot of sites are you?

Anyway, try disabling livna and enable the other 3 and try again

alphonsebrown
24th June 2005, 10:35 AM
there's simply no such folder or not world visible /repodata @ http://ftp.iasi.roedu.net/mirrors/fedora.redhat.com/core/4/i386/os/

and livna as far as I know has nothing to do with that?!?

alphonsebrown
24th June 2005, 10:35 AM
and livna as far as I know has nothing to do with that?!?

tejas
24th June 2005, 12:18 PM
Yes, i can see it

But it doesn't look like a yum mirror

It looks more like a DVD of FC4 with both the RPM and the SRPM installed on it

alphonsebrown
24th June 2005, 07:50 PM
how can one keep track what was updated from where/URL

ThersOnly1Hutch
24th June 2005, 10:27 PM
Hi there , I am interested in trying this great little script provided by tejas, only problem is he has explained the how to for those who already know everything so to speak about linux ,example "
To run:
1) dnload the script
2) make it executable by running:
chmod +x yumfix.txt
3) ./yumfix.txt
4) drop me a line.
My queastion is for example what & how do you "dnload the script " as I have wondered for along time now just how to add repos separatly in /etc/yum.repos.d/ as it is not as easy as just adding your repos to sources.list. , I already think I know the rest which is to just type line 2 &3 into terminal with root priviladges etc but how do I dnload the script ,could someone be kind enough to explain to this Humble Fedora4 lover, & is there another way that people add repos to /etc/yum.repos.d/ as I hoped the first time I ever tried this was to just press the add button in the editor & presto ,but its not that easy by the look of it? any help would be appreciated , Thanks AnyOne , I have found that whatever I have learnt so far about using editors for adding & editing files etc has helped my progress in using linux.

alphonsebrown
24th June 2005, 11:35 PM
how can one track in which order updates were applied like numbered or dates?!? is it possible to easily record that ? maybe with mysql?

tejas
25th June 2005, 03:24 AM
how do you "dnload the script "Small typo/intentional typo made to sound cool. It means download the script. This means right click on the link at the top and click 'save link as' or 'save target as'

jgutty
25th June 2005, 07:13 AM
Thanks! This worked...almost. I have some other issue trying to get update to connect to the correct repos. I had to remove the version variable and manually put in 4 at the appropriate path in all the repo files as update was trying to find core 4 files in the core 3 directories. Now maybe I can get an apt update. I'm somewhat lost here, but I'm hoping that will fix my problem.

Ridgerunner
25th June 2005, 10:18 PM
Wow! This is great!!

Thanks tejas

Ken
:)

alphonsebrown
25th June 2005, 10:56 PM
I think it's easier with yumex and having 2 profiles - US updates&Livna&Extras&Develepment&Jpackage-Fedora group Europe: Dag,Dries,Fresh,new,at, didier?!!? and change the profiles on the fly

Lt_Anton
26th June 2005, 05:04 PM
Thanks for taking the time to bang the yumfix out it's uber helpful :D

alphonsebrown
26th June 2005, 05:12 PM
well you could also have 2 aliases to use US/EUR repos :) yum-europe update yum-usa update for example

because they're conflictable

mrgadget
27th June 2005, 03:11 AM
The script is giving me the following error:
[root@bulldog ccruz]# ./yumfix.txt
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] n
Install dag? [y|n] y
Importing Key for Dag
error: http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt: import read failed(-1 ).
Dag Installed!
Install freshrpms? [y|n] y
FreshRPMS Installed!
Install atrpms? [y|n] y
ATRPMS Installed!
[root@bulldog ccruz]#

Then qhen I yum update:

[root@bulldog ccruz]# yum update
Setting up Update Process
Setting up repositories
Cannot open/read repomd.xml file for repository: dag
failure: repodata/repomd.xml from dag: [Errno 256] No more mirrors to try.
[root@bulldog ccruz]#


Any help will be appreciated.

tejas
27th June 2005, 03:57 AM
Try again

It looks like dag was down for some time, I got a 'page not found' when I tried going to the site for 5 mins, but it works now

Also, are you online when doing this?

mrgadget
27th June 2005, 04:14 AM
Yes, Iam online and replying from the computer.
my yum.conf:

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

The problem is with all the repos, except livna.

Look at this with livna:

[root@bulldog ccruz]# ./yumfix.txt
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] y
Livna Installed!
[root@bulldog ccruz]# yum update
Setting up Update Process
Setting up repositories
livna 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
No Packages marked for Update/Obsoletion
[root@bulldog ccruz]#

With the others:

[root@bulldog ccruz]# ./yumfix.txt
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] n
Install dag? [y|n] n
Install freshrpms? [y|n] y
FreshRPMS Installed!
Install atrpms? [y|n] y
ATRPMS Installed!
[root@bulldog ccruz]# yum update
Setting up Update Process
Setting up repositories
Cannot open/read repomd.xml file for repository: atrpms
failure: repodata/repomd.xml from atrpms: [Errno 256] No more mirrors to try.
[root@bulldog ccruz]#

This is happening no matter what conbination of repos I enable.

alphonsebrown
27th June 2005, 12:32 PM
well why don't you people first verify that those URLs are up & running & your ISP currently allows you access with your browser before posting such errors

mrgadget
27th June 2005, 05:31 PM
well why don't you people first verify that those URLs are up & running & your ISP currently allows you access with your browser before posting such errors


Yo are talking without knowing. I have verify that I can ping and access those pages, and it succeeded.

alphonsebrown
27th June 2005, 05:41 PM
why didn't you say so

ontopic: no idea DL manually till it's fixed...

tejas
27th June 2005, 05:41 PM
No need to get personal, but I have no clue what it is.

There has been another thread here somewhere,

They fixed it by setting a proxy

In other news:
This script is now also up at FedoraNEWS.org
http://fedoranews.org/mediawiki/index.php/Setting_up_YUM_for_FC4

mrgadget
27th June 2005, 06:05 PM
How can I clean all the information related to yum (repos, packages info, gpg keys, etc)
I would like to start from scratch.

tejas
27th June 2005, 06:07 PM
No point in that.

Setiing the repos back maybe, set your yum.conf to what you see on the first page.

And see this thread. It suggests changing timeout
http://forums.fedoraforum.org/forum/showthread.php?t=60333

alphonsebrown
27th June 2005, 08:09 PM
yum clean all is not cleaning non enabled repos directories as far as I noticed.. didn't check it though what's exactly the reason but it didn't clean a lot.. don't know why

manojendu
28th June 2005, 06:03 PM
Thanks Tejas, for a very good script!!

inf0c0m
29th June 2005, 03:41 PM
I was having the same problem with dag, fresh and at... I just had to remove the atrpms repo and it worked just fine... I think at hasn't updated to FC4 or something... (that was two days ago at least, I haven't played with atrpms since then)


not to sound too much like a noob, but how do you remove the atrpms repo?

Thanks in advance

tejas
29th June 2005, 04:03 PM
Run the script again and type n when it asks if you want to install atrpms

alphonsebrown
29th June 2005, 06:07 PM
how to REALLY yum clean all?

Gallan
30th June 2005, 08:44 AM
nice work Tejas!!! so easy to use!!! ;)

sgtbob
30th June 2005, 11:27 AM
I've not tried the "cat" process indicated by Tejas, but it appears interesting. Will have to tinker with it later. I encountered another method of getting repositories into the system that I pretty much understand (I think). It isn't my invention, I plaigarized it from another source and it works for me.

As su- (root) and as an example of adding 'FreshRPMS' to the yum.repos.d file, I first enter:

rpm --import http://freshrpms.net/packages/RPM-GPG-KEY.txt

then - cd /etc/yum.repos.d/

I am uncomfortable with 'vi', so I use 'gedit' and enter:

[freshrpms]
name=FreshRPMS-Fresh
baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms
enable=1
gpgcheck=1

Then I save this to yum.repos.d . Then running ....yum update..., files are downloaded for the applicable items on my system and then installs them. I've used this method to install repositores for Red Hat, Extras, DAG, Dries, NewRPMS, etc., and it seems to work so far. I do get some weird feedback occasionally when a repository isn't in tune with FC4. I thank the now forgotten author who steered me to this method., which is one I can use with my limited knowledge.

Bob

tejas
30th June 2005, 11:40 AM
rpm --import http://freshrpms.net/packages/RPM-GPG-KEY.txt

then - cd /etc/yum.repos.d/

I am uncomfortable with 'vi', so I use 'gedit' and enter

Then I save this to yum.repos.d . Actually, this is the exact same thing my script does. Except, instead of using vi or gedit, I used the cat command so that people do not have to type anything or 'cut and paste'.

Basically, cat writes to a file. syntax: cat > file
If you do cat> file <<EOF, it means cat into file until it reads the line 'EOF'
cat >> file is for appending.

Plus it avoids problems, like people opening gedit as a user, and trying to save it in /etc/yum.repos.d (will give an error about 'no write permissions').

Actually my script is very simple. The only catch if you look at the source, is the

if(! rpm -q <string of strange chars>)

this runs the following lines (till the fi, in the script) iff the GPG keys are not already imported. I had a problem with duplicate keys in the beginning

And you may want to consider using nano or pico (I forget which one comes with FC. It is the equivalent of DOS 'edit') for terminal editing

alphonsebrown
1st July 2005, 07:41 AM
mcedit's also good for console

alphonsebrown
1st July 2005, 11:16 PM
I don't want to start a new thread
[root@fbi yum.repos.d]# yum install pango
Repository freshrpms already added, not adding again // why is that happening?
Repository livna-unstable already added, not adding again // also this one as seen below is not enabled...??!
Setting up Install Process
Setting up repositories
dries 100% |=========================| 951 B 00:00
sofia-updates-released 100% |=========================| 951 B 00:00
sofiabase 100% |=========================| 1.1 kB 00:00
atrpms-good 100% |=========================| 951 B 00:00
dag-fc3 100% |=========================| 1.1 kB 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@fbi yum.repos.d]#
and where is pango??

WhackAMole
2nd July 2005, 02:23 AM
Thanks for the script!

alphonsebrown
3rd July 2005, 01:16 AM
what is this kde-redhat repo all about?

inf0c0m
7th July 2005, 03:25 PM
[root@XXX XXXX]# ./yumfix
Which Repos do you want to install? If you install livna, you cannot install any others
Install livna? [y|n] n
Install dag? [y|n] n
Install freshrpms? [y|n] n
Install atrpms? [y|n] y
Importing Key for AT RPMS
error: http://atrpms.net/RPM-GPG-KEY.atrpms: import read failed(-1).
rpmk: url.c:103: XurlFree: Assertion `u && u->magic == 0xd00b1ed0' failed.
./yumfix: line 104: 22301 Aborted rpm --import http://atrpms.net/RPM-GPG-KEY.atrpms
ATRPMS Installed!


this is what i get, any ideas?

fidzila
16th July 2005, 12:42 AM
Okay, tried yum update many times. Still has errors. I am a newbie.
My machine: FC4, amd64.

I downloaded yumfix.txt and followed steps to run. I chose the other 3, not livna.
Then I su -, input password, then yum update.
then a long list of processing dependency. Finaly, I got this

--> Running transaction check
--> Processing Dependency: libosp.so.3 for package: libofx
--> Processing Dependency: libghttp.so.1()(64bit) for package: perl-HTTP-GHTTP
--> Processing Dependency: elfutils-devel for package: rpm-devel
--> Processing Dependency: libosp.so.4 for package: openjade
--> Finished Dependency Resolution
Error: Missing Dependency: libosp.so.4 is needed by package openjade
Error: Missing Dependency: elfutils-devel is needed by package rpm-devel
Error: Missing Dependency: libosp.so.3 is needed by package libofx
Error: Missing Dependency: libghttp.so.1()(64bit) is needed by package perl-HTTP-GHTTP

would anyone please help how to correct these errors? Thanks.

EDIT: Okay, solved by myself. I install elfutils-devel and libghttp from fedora rpms list, then I yum --exclude=openjade update. It worked.

tejas
16th July 2005, 03:55 AM
Looks like few dependencies are unsolvable via yum

Look up those mission ones on pbone.net

kalos
1st October 2005, 05:07 PM
I've been using this script for nearly as long as I've been using Fedora Core, but I've made several changes. Here is my updated file.

It includes these changes (copied from in file changelog):
# Jul 23, 2005 - Added mirrors as described on http://www.fedorafaq.org/samples/yum.conf
# Jul 23, 2005 - fixed mirror for atrpms (wftp.tu-chemnitz.de)
# Oct 01, 2005 - Added kde-redhat repos
# Oct 01, 2005 - Added dries repo
# Oct 01, 2005 - Added newrpms repo

-kalos