Page 1 of 1

[SOLVED] How to activate media using CLI?

PostPosted: Mar 12th, '13, 20:19
by riclags
I read Diagram - Mageia Media and the different types of users topic and I am thankful for the explanation there. In that same topic, there is an image showing how to add media to Mageia.

I know that all these 30 media are in my list:
Code: Select all
$ urpmq --list-media
Core Release
Core Release Debug
Core Updates
Core Updates Debug
Core Updates Testing
Core Updates Testing Debug
Core Backports
Core Backports Debug
Core Backports Testing
Core Backports Testing Debug
Nonfree Release
Nonfree Release Debug
Nonfree Updates
Nonfree Updates Debug
Nonfree Updates Testing
Nonfree Updates Testing Debug
Nonfree Backports
Nonfree Backports Debug
Nonfree Backports Testing
Nonfree Backports Testing Debug
Tainted Release
Tainted Release Debug
Tainted Updates
Tainted Updates Debug
Tainted Updates Testing
Tainted Updates Testing Debug
Tainted Backports
Tainted Backports Debug
Tainted Backports Testing
Tainted Backports Testing Debug


But the command below only shows 2 active media.

Code: Select all
$ urpmq --list-media active
Core Release
Core Updates


I have checked the Wiki on URPMI but there is no mention of activating already existing, deactivated media; only how to add new media (which at this point I don't feel I need to do as the media is already added, only deactivated). The image referenced has checkboxes, so I was hoping someone could show me how to do the same, enable media, using the CLI.

Re: How to activate media using CLI?

PostPosted: Mar 12th, '13, 21:01
by doktor5000
Code: Select all
urpmi.update --no-ignore "full media name"

it also takes patterns, so
Code: Select all
urpmi.update --no-ignore nonfree
would enable all repos, who have "nonfree" in their name, case does not matter.
Is that what you wanted to know? You can also have a look at the man pages. apropos lists all related ones:
Code: Select all
[doktor5000@Mageia2 ~]$ apropos urpmi

proxy.cfg [proxy]    (5)  - urpmi proxy configuration file format
rurpmi               (8)  - restricted urpmi
urpm                 (3pm)  - Mageia perl tools to handle the urpmi database
urpm::cfg            (3pm)  - routines to handle the urpmi configuration files
urpm::sys            (3pm)  - OS-related routines for urpmi
urpm::util           (3pm)  - Misc. utilities subs for urpmi
urpmi                (8)  - rpm downloader, installer and dependency solver
urpmi.addmedia [urpmi] (8)  - adds a new rpm media to be used by urpmi
urpmi.cfg [urpmi]    (5)  - urpmi option and media configuration file format
urpmi.files [urpmi]  (5)  - files used by the urpmi tools
urpmi.recover [urpmi] (8)  - manages repackaging of old RPMs and rollbacks
urpmi.removemedia [urpmi] (8)  - remove a rpm media from the known media of urpmi
urpmi.update [urpmi] (8)  - Updates package lists for specified media
urpmihowto           (8)  - urpmi Advanced How-To
urpmq                (8)  - urpmi database query tool


Also adding media and enabling them are two different things, by default you only get those two repos you listed.
This is due to our policy to help promote FL/OSS - you may want to read at https://wiki.mageia.org/en/Mirrors_policy

Re: How to activate media using CLI?

PostPosted: Mar 13th, '13, 02:47
by riclags
doktor5000 wrote:Is that what you wanted to know?

Yes. This is totally what I wanted to know. Thanks.

Re: [SOLVED] How to activate media using CLI?

PostPosted: Mar 14th, '13, 17:03
by dedanna1029
man urpmi wrote:<snip>
--->To add a new medium containing rpms, run "urpmi.addmedia"<---. To remove an existing medium, use "urpmi.removemedia". To update the package list (for example when the ftp archive changes) use "urpmi.update".

The beautiful thing about Linux, is there are more ways than one to skin a cat. ;)

Re: [SOLVED] How to activate media using CLI?

PostPosted: Mar 15th, '13, 01:26
by riclags
dedanna1029 wrote:
man urpmi wrote:<snip>
--->To add a new medium containing rpms, run "urpmi.addmedia"<---. To remove an existing medium, use "urpmi.removemedia". To update the package list (for example when the ftp archive changes) use "urpmi.update".

The beautiful thing about Linux, is there are more ways than one to skin a cat. ;)

I totally agree with you on more ways than one to skin a cat :D But I have to say that for my case here, the media was already added but disabled. urpmi.addmedia is used to add additional media.

Re: [SOLVED] How to activate media using CLI?

PostPosted: Mar 19th, '13, 16:41
by dedanna1029
Interesting. I've been searching man urpmi, and man urpmi.addmedia, but I'm not seeing the specific option I used to, in order to enable a repo. I guess it's changed, but I'm thinking urpmi.addmedia would still enable a repo?

Re: [SOLVED] How to activate media using CLI?

PostPosted: Mar 19th, '13, 21:01
by doktor5000
Nope, it will not, when you're using --distrib (which is used to add all default distro repositories). You need to use urpmi.update --no-ignore to enable them and update the hdlists afterwards (that is the same thing that happens in the background when you enable repos in drakrpm-edit-media).

Maybe urpmi.addmedia --interactive can be used for what you want, but IMHO thats too error-prone to recommend that to novices or as general advice.