I ruined my Yast repositories

I tried to add another repository to yast (Index of /repositories/mozilla/openSUSE_11.2) and when I was done, Yast gave me an error message and now no repositories show up.
The error is: “/etc/zypp/repos.d/_mozilla_openSUSE_11.2.repo:Line 2 is missing ‘=’ sign”

How do I fix this? How do I get my repos back? :frowning:

I took a look in that directory and this is what is in it:


[_mozilla/openSUSE_11.2
]
name= mozilla/openSUSE_11.2

enabled=1
autorefresh=1
baseurl=http://download.opensuse.org/repositories/mozilla/openSUSE_11.2
path=/
type=rpm-md
keeppackages=0

You can export the repos and edit it with what you like and then re-import them.


repos –export or lr -e

You can export your complete repository list to a file and import it later or on another machine.

zypper lr --export backups/repos/foo.repo
zypper ar backups/repos/foo.repo

zypper lr -u # to include also repo URI in the table
zypper lr -d # to include several other repo properties in the table
zypper lr -P # to include also repo priority and sort the list by it
zypper lr -e my # export all repository definitions into file named ‘my.repo’

I do not understand what you mean that this in a directory, because a directory contains files. It looks more like the text is in some file.

In any case (and I never looked at these things) to me it looks that the stand alone ] on the second line should be at the end of the text of the first line. You could try if editing this helps (but make a backup of that file first). When it helps, the strange is is of courser: how did this happen?

I’ve just tried as root but root says it can’t open this file in any editor ("KDEInit could not launch ‘/usr/bin/kwrite.’ " - says the same thing about kate too.) I can open it as user and then edit it though, but I get a warning that “no backup copy could be created before saving. If an error occurs while saving, you might lose the data of this file. A reason could be that the media you write to is full or the directory of the file is read-only for you.” So, I can’t save it (it is read only for me as I thought). I did place a copy of it in my home folder though.

Would I be able to just delete the _mozilla_openSUSE_11.2 file?

All this just to try and update FireFox! (I’ll tell you the whole story why later if you want)

@ swannema:
How would I just export one repo file to fix it and then re-import it?
Do you have to give the whole path for that zypper command? (I’m very new at this.)

Easy now, slow down, slow down. Don’t go deleting anything. There are many postings on using zypper in this forum. Do some more research first. You may be able to recreate the repo manually in Yast > Software Repositories

recreate the repo manually in Yast > Software Repositories

Like how? That is where I was when this all started.

I am looking for info now but I’m unsure of what I need.

I tried out the command, “zypper lr -d” and this is what I got:

Unexpected exception.
/etc/zypp/repos.d/_mozilla_openSUSE_11.2
.repo: Line 2 is missing ‘=’ sign
Please file a bug report about this.
See http://en.opensuse.org/Zypper/Troubleshooting for instructions.

But when I go to that page, it says it has been moved (or will be moved.)

Edit the file so that it looks like this:

[_mozilla/openSUSE_11.2]
name= mozilla/openSUSE_11.2

enabled=1
autorefresh=1
baseurl=http://download.opensuse.org/repositories/mozilla/openSUSE_11.2
path=/
type=rpm-md
keeppackages=0

The only change is that the closing bracket is moved from 2nd line to the first line and I believe zypper/Yast expects the repo name in the first line and all other information or parameters (with an EQUAL sign) in the remaining lines…

Okay - I didn’t see the other replies… To edit the file as root enter this from the command line

gnomesu gedit /etc/zypp/repos.d/_mozilla_openSUSE_11.2.repo

On 2010-07-30 02:36, gymnart wrote:
>
> I tried out the command, “zypper lr -d” and this is what I got:
>
> Unexpected exception.
> /etc/zypp/repos.d/_mozilla_openSUSE_11.2
> repo: Line 2 is missing ‘=’ sign
> Please file a bug report about this.
> See http://en.opensuse.org/Zypper/Troubleshooting for instructions.
>
> But when I go to that page, it says it has been moved (or will be
> moved.)

Search for the tittle, or search in the old wiki. Then report the link error in Bugzilla, too.

(’ hate this…)

Ok, here:

<http://old-en.opensuse.org/Zypper/Troubleshooting>

This page says it has been moved to:

<http://en.opensuse.org/openSUSE:Zypper_troubleshooting>

But this other says it has been deleted.

Using the search, I found that it maybe here:

<http://en.opensuse.org/Portal:Zypper>

where they point to:

<http://en.opensuse.org/SDB:Zypper_usage>
and
<http://en.opensuse.org/SDB:Zypper_troubleshooting>

Now, please, will you report all these broken links as a bug against zypper itself, too? It is a bug
in zypper if they point to the wrong link, even if it is not their fault.

Then report your own bug.

Please :slight_smile:

I’m off to bed.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

If you must edit this file, hit alt+F2 and then:

kdesu kwrite /path/to/file

This directly opens the specified file in Kwrite as root.

Alternatively, launch Kwrite as root:

kdesu kwrite

and then use drag-and-drop from Dolphin, or open the file from withing Kwrite.

Now I have 2 _mozilla_openSUSE_11.2.repo files: One with the incorrect info and the other is the corrected one. There’s also a backup file with the same name (green icon).
Now what? How do I get rid of the incorrect ones? Right now, Yast is just reading the incorrect one, still giving me the “needs ‘=’ sign” error.

Try moving the incorrect .repo file to your home directory or some place else and see if Yast/zypper loads properly…

Thank you all, moving the incorrect file to someplace else did the trick.