Edit repo alias using zypper -- command problem

To edit a repo alias using zypper, the command below is cited.

sudo zypper modifyrepo --alias [new-alias] [repository]

but when trying to apply it, I get message that zypper modifyrepo --alias does not now work.

tom@mydesktop: ~ $ sudo zypper modifyrepo --alias packman--all Packman -- complete
The flag --alias is not known.

I wonder if repo service does not let this work.

tom kosvic

That is the wrong command. Use renamerepo. See man zypper:

 renamerepo (nr) alias|name|#|URI new-alias
           Assign new alias to the repository specified by alias, name, number, or URI.

           Examples:

               $ zypper nr 8 myrepo
                   Rename repository number 8 to myrepo (useful if the repo has some dreadful alias which is not usable on the command line).

With modifyrepo you can change the name of a repo.
With renamerepo you can change the alias of a repo.

1 Like

Which part of man zypper do you base this on?

Command supplied did work

tom@mydesktop: ~ $ sudo zypper nr 13 packman--all
Repository 'packman_--all' renamed to 'packman--all'.
tom@mydesktop: ~ $ 

That initial command came up in an internet search for “zypper edit repo alias”. Don’t recollect direct source.

I did look also at:

sudo zypper modifyrepo --help

I saw term alias there but didn’t really read it too carefully as it is not really that important an issue.

Man zypper is thousands of lines that is basically unreadable and indecipherable. No one can be expected to search in that. I did change manreader to bat and still can’t read man files well.

export MANPAGER=“bat --terminal-width 120 --wrap=never”

You may want to try the online version of manpages at manpages.org which makes it more readable as itt uses your standard browser. There you can better use zoom and search and stuff…

1 Like

@hui, thanks I was unaware of online man pages. I will have a look.

tom kosvic

I read man pages using Konqueror. It formats it pretty well and you can then of course use the search functionality of the browser.

E.g. search for “modifyrepo” and with big steps walk to where to command is specified. There you can not find a --alias option at all.

But yes, one has to spend some effort in using some spare time to browse through man pages to get used to them. Not a bad investment when one manages several systems.

Needless to say that I never would compile a statement out of wishful wording and hope then that it will not break things, but as by miracle do what I want to achieve.

Repo files are plain text files. If not managed by a repo service, anything within one that you want changed, and to remain so, including name, alias, URL and enabling state, can be done with a plain text editor.

1 Like

Yes!

This way, I have often modified any names or URLs. Very comfortable (rather more than by Zypper).

You can do

man zypper > man_zypper.txt

and then use your favorite editor to read/search man_zypper.txt.

1 Like

I just set

PAGER=less

in my environment. And then “man zypper” works pretty well.

However, it is a rather complex man page, so it’s not always easy to find what you are looking for.

1 Like

Easier that than having to first determine which man page is applicable for the various cmdline package management variations and plugins for apt in Debian and dnf in Fedora.

Actually a useful and relatively harmless application of AI would be as a manpage system search and read application.

This Reply is not directed at anyone - I quoted to provide context for my Reply :+1:

Many folks don’t realize the power (i.e., features) of “man” command. At a CLI prompt, type: “man -h” and you will be presented with over 60 lines of helpful text for starting the man command.

So next, let’s say you execute: “man zypper”. Now tap the "h’ key (for Help) … you are now presented with an overwhelming about of options to choose from. Use the DownArrow / UpArrow key or PageDown / PageUp key to move thru the available options.

I have this “Help section” saved to a text file … it contains 300 lines of text (7 page document) !! A lot detail shown there. man is a lot more competent than some folks realize :+1:

1 Like