Unable to add repo, can't open file. How to fix?

Noob here. Running TW Gnome Wayland. Any way to fix this?

advait@localhost:~> sudo zypper addrepo https://download.opensuse.org/repositories/hardware/openSUSE_Tumbleweed/hardware.repo
Adding repository 'Hardware tools (openSUSE_Tumbleweed)' ............................................................................................................................................[error]
Unknown problem when adding repository:
Can't open file '/etc/zypp/repos.d/hardware.repo' for writing.
advait@localhost:~> 

I’m on an AMD laptop.

that’s weird did you manually modifiy the repo files before
could you give this output sudo zypper lr -d and the journal of when this happened.

you can see the list of boots using this command sudo journalctl --list-boots.
chose the right boot and sudo journalctl -b ID replace ID with the boot offset you see in the list.

This does not look as if you did this “as root”. And yes, other users can not write there to prevent them from borking the system.

As one can see in the terminal in-/output, the TO used sudo. So everything correct from this side…

@invalid_user_name Do you boot from a read/write snapshot? Make sure that you are not on a readonly snapshot.

Delete any remnants of a broken file/cache:

sudo rm "/etc/zypp/repos.d/hardware.repo"
sudo zypper clean -a
sudo zypper ref

Try to add the repo file again.

Sorry, my fault. (Probably because I do not use sudo).

Not that I know of. I’m a noob and I have no idea how to “manually modify a repo file”. Never done that before.

1 Like
advait@localhost:~> sudo zypper lr -d
[sudo] password for root: 
#  | Alias                            | Name            | Enabled | GPG Check | Refresh | Keep | Priority | Type   | URI                                                                           | Service
---+----------------------------------+-----------------+---------+-----------+---------+------+----------+--------+-------------------------------------------------------------------------------+--------
 1 | Google-Chrome                    | Google-Chrome   | Yes     | (r ) Yes  | No      | -    |   99     | rpm-md | http://dl.google.com/linux/chrome/rpm/stable/x86_64                           | 
 2 | Virtualization                   | Virtualizatio-> | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | http://download.opensuse.org/repositories/Virtualization/openSUSE_Tumbleweed/ | 
 3 | download.opensuse.org-non-oss    | Main Reposito-> | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | http://download.opensuse.org/tumbleweed/repo/non-oss/                         | 
 4 | download.opensuse.org-oss        | Main Reposito-> | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | http://download.opensuse.org/tumbleweed/repo/oss/                             | 
 5 | download.opensuse.org-tumbleweed | Main Update R-> | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | http://download.opensuse.org/update/tumbleweed/                               | 
 6 | google-chrome                    | google-chrome   | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | https://dl.google.com/linux/chrome/rpm/stable/x86_64                          | 
 7 | home_ecsos                       | ecsos's Home -> | Yes     | (r ) Yes  | No      | -    |   99     | rpm-md | https://download.opensuse.org/repositories/home:/ecsos/openSUSE_Tumbleweed/   | 
 8 | microsoft-edge                   | microsoft-edge  | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | https://packages.microsoft.com/yumrepos/edge/                                 | 
 9 | openSUSE-20240112-0              | openSUSE-2024-> | No      | ----      | ----    | -    |   99     | N/A    | hd:/?device=/dev/disk/by-id/usb-hp_v250w_0426580071705207-0:0-part2           | 
10 | repo-debug                       | openSUSE-Tumb-> | No      | ----      | ----    | -    |   99     | N/A    | http://download.opensuse.org/debug/tumbleweed/repo/oss/                       | 
11 | repo-mesa                        | Packman Extra-> | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | https://ftp.fau.de/packman/suse/openSUSE_Tumbleweed/Extra/                    | 
12 | repo-openh264                    | Open H.264 Co-> | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | http://codecs.opensuse.org/openh264/openSUSE_Tumbleweed                       | 
13 | repo-source                      | openSUSE-Tumb-> | No      | ----      | ----    | -    |   99     | N/A    | http://download.opensuse.org/source/tumbleweed/repo/oss/                      | 
14 | snappy                           | snappy          | No      | ----      | ----    | -    |   99     | N/A    | https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed | 
15 | teamviewer                       | TeamViewer - -> | Yes     | (r ) Yes  | Yes     | -    |   99     | rpm-md | https://linux.teamviewer.com/yum/stable/main/binary-x86_64/                   | 
advait@localhost:~> 

Update: The original problem happened when it was recommended that I install some CLI app to fix a problem. But I can no longer remember what the original problem was (I got sidetracked the last few days trying to solve another, more pressing TW issue).

And I’ve learned that it’s good not to install 3rd party tools unless it’s really needed.

So I’ll consider my original request here for help to be now moot and no longer needed. If the issue comes up again, I’ll post it again.

1 Like

you will need to fix this permission problem with time if it still exist

i see you already have a lot of 3rd party repo so you had the write premssion at some point
possibly you installed programe that conflicted with zypper

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.