How and why to edit repositories for dnf. (Lx 4.0 and Cooker)

cooker
dnf
omlx-4
repos
Tags: #<Tag:0x00007fabd9e70658> #<Tag:0x00007fabd9e702c0> #<Tag:0x00007fabd9e70018> #<Tag:0x00007fabd9e77c78>

(Ben Bullard) #1

Currently this will apply to Cooker installations and for Lx 4 ALPHA/BETA until repos are split and we then have Lx 4.0 repos.

Among the changes is switching from urpmi/rpm5.org to dnr/rpm.org. For most of us users we don’t need to be concerned about the rpm part that is just different versions of rpm and maintained by different people, this will affect developers but users likely won’t notice anything different. The change from urpmi to dnf will be noticed by users as the commands will be different. Users can find most anything they need with ‘dnf --help’. For more information ‘man dnf’ should do it.

Anyway currently the repos as installed are not quite logical and what a user should have so we need to edit the repos. They are located in the directory ‘/etc/yum.repos.d’. You can use whatever is your preferred text editor, for this demo I’ll use ‘nano’ which is simple and easy enough for the average Linux Monkey. :monkey:

Here is what we see as of 2018-11-25:

$ ls -lh /etc/yum.repos.d
total 40K
-rw-r--r-- 1 live vboxsf 1.7K Nov 24 07:52 cooker-contrib-i686.repo
-rw-r--r-- 1 live vboxsf 1.7K Nov 24 07:52 cooker-contrib-x86_64.repo
-rw-r--r-- 1 live vboxsf  860 Nov 24 07:52 cooker-contrib-x86_64-source.repo
-rw-r--r-- 1 live vboxsf 1.6K Nov 24 07:52 cooker-i686.repo
-rw-r--r-- 1 live vboxsf 1.7K Nov 24 07:52 cooker-nonfree-i686.repo
-rw-r--r-- 1 live vboxsf 1.7K Nov 25 11:12 cooker-nonfree-x86_64.repo
-rw-r--r-- 1 live vboxsf  866 Nov 24 07:52 cooker-nonfree-x86_64-source.repo
-rw-r--r-- 1 live vboxsf 1.7K Nov 24 07:52 cooker-restricted-i686.repo
-rw-r--r-- 1 live vboxsf 1.8K Nov 24 07:52 cooker-restricted-x86_64.repo
-rw-r--r-- 1 live vboxsf  887 Nov 24 07:52 cooker-restricted-x86_64-source.repo
-rw-r--r-- 1 live vboxsf 1.6K Nov 24 07:52 cooker-x86_64.repo
-rw-r--r-- 1 live vboxsf  797 Nov 24 07:52 cooker-x86_64-source.repo
-rw-r--r-- 1 root root   1.7K Nov 24 07:52 openmandriva-contrib-i686.repo
-rw-r--r-- 1 root root   1.8K Nov 24 07:52 openmandriva-contrib-x86_64.repo
-rw-r--r-- 1 root root    881 Nov 24 07:52 openmandriva-contrib-x86_64-source.repo
-rw-r--r-- 1 root root   1.6K Nov 24 07:52 openmandriva-i686.repo
-rw-r--r-- 1 root root   1.7K Nov 24 07:52 openmandriva-nonfree-i686.repo
-rw-r--r-- 1 root root   1.8K Nov 24 07:52 openmandriva-nonfree-x86_64.repo
-rw-r--r-- 1 root root    887 Nov 24 07:52 openmandriva-nonfree-x86_64-source.repo
-rw-r--r-- 1 root root   1.8K Nov 24 07:52 openmandriva-restricted-i686.repo
-rw-r--r-- 1 root root   1.8K Nov 24 07:52 openmandriva-restricted-x86_64.repo
-rw-r--r-- 1 root root    908 Nov 24 07:52 openmandriva-restricted-x86_64-source.repo
-rw-r--r-- 1 root root   1.6K Nov 24 07:52 openmandriva-x86_64.repo
-rw-r--r-- 1 root root    818 Nov 24 07:52 openmandriva-x86_64-source.repo

Why so many? Devs in their infinite wisdom have included both Cooker and Lx 4 repos even though Lx 4 repos do not exist yet. Also there are source repos and i686 repos for both Cooker and Lx 4. Users will only need i686 for installing 32 bit software and most users will never use source repos.

Next if I run ‘dnf --refresh upgrade’ the command for system upgrade I will see these enabled:

$ sudo dnf --refresh upgrade
OpenMandriva Cooker - x86_64 - Nonfree - Test Updates                                                                                                        1.1 kB/s | 1.5 kB     00:01    
OpenMandriva Cooker - x86_64 - Nonfree - Test Updates - Debug                                                                                                1.1 kB/s | 1.5 kB     00:01    
OpenMandriva Cooker - x86_64 - Nonfree - Updates                                                                                                             1.1 kB/s | 1.5 kB     00:01    
OpenMandriva Cooker - x86_64 - Nonfree - Updates - Debug                                                                                                     1.1 kB/s | 1.5 kB     00:01    
OpenMandriva Cooker - x86_64 - Nonfree                                                                                                                       1.1 kB/s | 1.5 kB     00:01    
OpenMandriva Cooker - x86_64 - Nonfree - Debug                                                                                                               1.1 kB/s | 1.5 kB     00:01    
OpenMandriva Cooker - x86_64 - Updates                                                                                                                       1.1 kB/s | 1.5 kB     00:01    
OpenMandriva Cooker - x86_64                                                                                                                                 1.1 kB/s | 1.5 kB     00:01    
OpenMandriva Cooker - x86_64                                                                                                                                 1.9 MB/s |  14 MB     00:06    
OpenMandriva 4.0 - x86_64                                                                                                                                    127  B/s | 169  B     00:01    
OpenMandriva 4.0 - x86_64 - Updates

So we see we have a lot of non-free stuff enabled and no contrib or restricted, not so good. Also we have ’ OpenMandriva 4.0 - x86_64’ and ‘OpenMandriva 4.0 - x86_64 - Updates’ enabled even though those do not exist. So lets disable those.

The way the repos are organized is that there is one file each for main, contrib, non-free, and restricted per arch. The main ones do not say main they will just say the arch so the file ‘openmandriva-x86_64.repo’ is for everything Lx 4 main including release, updates, testing and debug repos. So we need to edit that file to disable main release and main updates.

$ sudo nano /etc/yum.repos.d/openmandriva-x86_64.repo

and we have:

To disable the release and updates repos we change for each ‘enabled=1’ to ‘enabled=0’ so the file now looks like:

Next I’m going to edit the 4 x86_64 repos so that the release repo is enabled and all others are disabled. Why? Users don’t need updates or testing because they are empty. No one needs debug repos unless they are debugging something. If you want to confirm just copy and paste some of the URL’s for the files to your browser and see for yourself. There are 4 files to edit:

/etc/yum.repos.d/cooker-x86_64.repo
/etc/yum.repos.d/cooker-contrib-x86_64.repo
/etc/yum.repos.d/cooker-nonfree-x86_64.repo

Optional:

/etc/yum.repos.d/cooker-restricted-x86_64.repo

You want all of them to have for the release repo (the first one in each list, read the URL) to say ‘enabled=1’ and everything else to say ‘enabled=0’. I’ll post screen shots of the ‘/etc/yum.repos.d/cooker-nonfree-x86_64.repo’ before and after as it is the one that will have the most changes.

Before everything says ‘enabled=1’:

After only the release repos will say ‘enabled=1’ all others now say ‘enabled=0’:

Once you get in to this and actually read what is in the files, most importantly what is in the URL’s this will all start to make sense.

Here’s hoping this helps some of you and does not confuse people.

:see_no_evil::hear_no_evil::speak_no_evil:

Remember: In Cooker you do not need any ‘updates’ repos. Why? They are empty. Nothing in them. (This is the opposite for any Official release like Lx 3 or Lx 4, for those updates repos are essential to update your system.) Testing repos are rarely used in Cooker and generally can be ignored unless prompted by a developer regarding a specific issue. Debug repos are only needed if prompted by a developer for debugging a Bug.

Note: It would be great if any of you see any errors or any way to make this better to let me know or post here. :flushed:


Some bugs in OMLX 4 alpha 1
Les dépôts avec Openmandriva 4
How to edit dnf repositories for a specific mirror. (Lx 4.0 Alpha/Beta and Cooker)
DNF - Enabling Repo's
Provata openmandriva Lx4 alpha
What applications are missing in OM Lx 4?
(rugyada) #2

Great how-to! :+1:

Thank you @ben79


(Ben Bullard) #3

Now the result of the above exercise is that when I run ‘dnf --refresh upgrade’ I will see only the 4 x86_64 release repos which will look like:

If you see the words debug, testing, or updates in any listed repos then you have something enabled that you don’t need (normally) and should disable.

If you need to install something that is 32 bit software and there are missing dependencies you will need to enable the release repo only of i686 repo:

cooker-i686.repo

and maybe even the release repo of one or more of the other 3 i686 repos:

cooker-contrib-i686.repo
cooker-nonfree-i686.repo
cooker-restricted-i686.repo

Generally it is considered “best practice” in OM Lx to keep i686 repos disabled on x86_64 systems and only enable if you really need them to install or update 32-bit software. Most users won’t need any 32-bit software. Remember that anything that isn’t developed for 64-bit now a days is about 10-15 years behind the times. I would be very wary of any developers that far behind.


(rugyada) #4


(Ben Bullard) #5

What do the various repos mean, why do they exist? I need to get developers to confirm but my understanding is this:

Main: opensource and OpenMandriva maintained
Non-free : not-opensource OpenMandriva can’t change code so can’t really maintain
Contrib: opensource and OM Community maintained
Restricted: opensource mostly OpenMandriva maintained but some package here may have legal/patent issues in some countries.

It is known that our community maintained contrib repo is not at all well maintained at this time. Frankly there are a lot of packages that won’t install or won’t work. Anything that does work users are welcome to use.

:monkey_face:


(Ben Bullard) #6

Note: It is perfectly OK and possible to have a working system with only main/release repo enabled at this time. That is in this file /etc/yum.repos.d/cooker-x86_64.repo. It is the first thing in the list so you need enable only the first one. Like cooker-x86_64.repo.txt (1.5 KB)


OMLx 4.0 Alpha1 candidate ISO passed QA check and released
(Ben Bullard) #7

Everything in this thread at this time applies until repos are split and there are seperate repos for Cooker and Lx 4. At that time I will revise this thread.


(rugyada) #8

For the time being and until the repos will be shifted (most likely at Beta or even RC stage) you can safely remove the 4.0* repository from/etc/yum.repos.d directory

# rpm -e --nodeps openmandriva-repos-4.0

Also, please bear in mind that further updates, if any, of the package/s openmandriva-repos-* will overwrite your current files. So always keep an eye on what is going to be updated :wink:

My own 2 workarounds I found are:
- have a backup of the file/s and replace in case of overwriting
or
- to update the system with ‘exclude’ option

$ sudo dnf --refresh upgrade --exclude=openmandriva-repos-4.0

:nerd_face:


(Ben Bullard) #10

:+1:

:speak_no_evil::hear_no_evil::see_no_evil:


Unable to install kernel-release-desktop-devel
#11

It is really useful to know where repos config files are placed into the system but it is not really comfortable to edit them by hand. In fact dnf is able to handle some simple operation on repositories.

List used repositories:

 $ dnf repolist
 Last metadata expiration check: 0:07:39 ago on Mon Jan  7 22:52:43 2019.
 repo id                                                          repo name                                                                         status
 cooker-updates-x86_64                                            OpenMandriva Cooker - x86_64 - Updates                                                0
 cooker-x86_64                                                    OpenMandriva Cooker - x86_64                                                      17574

But if we’d like to enable some other repo we need to know its id so let’s list all repos (enabled and not):

$ dnf repolist --all
Last metadata expiration check: 0:12:18 ago on Mon Jan  7 22:52:43 2019.
repo id                                                   repo name                                                                        status
cooker-i686                                               OpenMandriva Cooker - i686                                                       disabled
cooker-i686-contrib                                       OpenMandriva Cooker - i686 - Contrib                                             disabled
cooker-i686-contrib-debuginfo                             OpenMandriva Cooker - i686 - Contrib - Debug                                     disabled
cooker-i686-debuginfo                                     OpenMandriva Cooker - i686 - Debug                                               disabled
cooker-i686-non-free                                      OpenMandriva Cooker - i686 - Non-free                                            disabled
cooker-i686-non-free-debuginfo                            OpenMandriva Cooker - i686 - Non-free - Debug                                    disabled
cooker-i686-restricted                                    OpenMandriva Cooker - i686 - Restricted                                          disabled
cooker-i686-restricted-debuginfo                          OpenMandriva Cooker - i686 - Restricted - Debug                                  disabled
cooker-testing-i686                                       OpenMandriva Cooker - i686 - Test Updates                                        disabled
cooker-testing-i686-contrib                               OpenMandriva Cooker - i686 - Contrib - Test Updates                              disabled
cooker-testing-i686-contrib-debuginfo                     OpenMandriva Cooker - i686 - Contrib - Test Updates - Debug                      disabled
cooker-testing-i686-debuginfo                             OpenMandriva Cooker - i686 - Test Updates - Debug                                disabled
cooker-testing-i686-non-free                              OpenMandriva Cooker - i686 - Non-free - Test Updates                             disabled
cooker-testing-i686-non-free-debuginfo                    OpenMandriva Cooker - i686 - Non-free - Test Updates - Debug                     disabled
cooker-testing-i686-restricted                            OpenMandriva Cooker - i686 - Restricted - Test Updates                           disabled
cooker-testing-i686-restricted-debuginfo                  OpenMandriva Cooker - i686 - Restricted - Test Updates - Debug                   disabled
cooker-testing-x86_64                                     OpenMandriva Cooker - x86_64 - Test Updates                                      disabled
cooker-testing-x86_64-contrib                             OpenMandriva Cooker - x86_64 - Contrib - Test Updates                            disabled
cooker-testing-x86_64-contrib-debuginfo                   OpenMandriva Cooker - x86_64 - Contrib - Test Updates - Debug                    disabled
cooker-testing-x86_64-contrib-source                      OpenMandriva Cooker - x86_64 - Contrib - Test Updates - Source                   disabled
cooker-testing-x86_64-debuginfo                           OpenMandriva Cooker - x86_64 - Test Updates - Debug                              disabled
cooker-testing-x86_64-non-free                            OpenMandriva Cooker - x86_64 - non-free - Test Updates                           disabled
cooker-testing-x86_64-non-free-debuginfo                  OpenMandriva Cooker - x86_64 - non-free - Test Updates - Debug                   disabled
cooker-testing-x86_64-non-free-source                     OpenMandriva Cooker - x86_64 - non-free - Test Updates - Source                  disabled
cooker-testing-x86_64-restricted                          OpenMandriva Cooker - x86_64 - Restricted - Test Updates                         disabled
cooker-testing-x86_64-restricted-debuginfo                OpenMandriva Cooker - x86_64 - Restricted - Test Updates - Debug                 disabled
cooker-testing-x86_64-restricted-source                   OpenMandriva Cooker - x86_64 - Restricted - Test Updates - Source                disabled
cooker-testing-x86_64-source                              OpenMandriva Cooker - x86_64 - Test Updates - Source                             disabled
cooker-updates-i686                                       OpenMandriva Cooker - i686 - Updates                                             disabled
cooker-updates-i686-contrib                               OpenMandriva Cooker - i686 - Contrib - Updates                                   disabled
cooker-updates-i686-contrib-debuginfo                     OpenMandriva Cooker - i686 - Contrib - Updates - Debug                           disabled
cooker-updates-i686-debuginfo                             OpenMandriva Cooker - i686 - Updates - Debug                                     disabled
cooker-updates-i686-non-free                              OpenMandriva Cooker - i686 - Non-free - Updates                                  disabled
cooker-updates-i686-non-free-debuginfo                    OpenMandriva Cooker - i686 - Non-free - Updates - Debug                          disabled
cooker-updates-i686-restricted                            OpenMandriva Cooker - i686 - Restricted - Updates                                disabled
cooker-updates-i686-restricted-debuginfo                  OpenMandriva Cooker - i686 - Restricted - Updates - Debug                        disabled
cooker-updates-x86_64                                     OpenMandriva Cooker - x86_64 - Updates                                           enabled:     0
cooker-updates-x86_64-contrib                             OpenMandriva Cooker - x86_64 - Contrib - Updates                                 disabled
cooker-updates-x86_64-contrib-debuginfo                   OpenMandriva Cooker - x86_64 - Contrib - Updates - Debug                         disabled
cooker-updates-x86_64-contrib-source                      OpenMandriva Cooker - x86_64 - Contrib - Updates - Source                        disabled
cooker-updates-x86_64-debuginfo                           OpenMandriva Cooker - x86_64 - Updates - Debug                                   disabled
cooker-updates-x86_64-non-free                            OpenMandriva Cooker - x86_64 - non-free - Updates                                disabled
cooker-updates-x86_64-non-free-debuginfo                  OpenMandriva Cooker - x86_64 - non-free - Updates - Debug                        disabled
cooker-updates-x86_64-non-free-source                     OpenMandriva Cooker - x86_64 - non-free - Updates - Source                       disabled
cooker-updates-x86_64-restricted                          OpenMandriva Cooker - x86_64 - Restricted - Updates                              disabled
cooker-updates-x86_64-restricted-debuginfo                OpenMandriva Cooker - x86_64 - Restricted - Updates - Debug                      disabled
cooker-updates-x86_64-restricted-source                   OpenMandriva Cooker - x86_64 - Restricted - Updates - Source                     disabled
cooker-updates-x86_64-source                              OpenMandriva Cooker - x86_64 - Updates - Source                                  disabled
cooker-x86_64                                             OpenMandriva Cooker - x86_64                                                     enabled: 17574
cooker-x86_64-contrib                                     OpenMandriva Cooker - x86_64 - Contrib                                           disabled
cooker-x86_64-contrib-debuginfo                           OpenMandriva Cooker - x86_64 - Contrib - Debug                                   disabled
cooker-x86_64-contrib-source                              OpenMandriva Cooker - x86_64 - Contrib - Source                                  disabled
cooker-x86_64-debuginfo                                   OpenMandriva Cooker - x86_64 - Debug                                             disabled
cooker-x86_64-non-free                                    OpenMandriva Cooker - x86_64 - non-free                                          disabled
cooker-x86_64-non-free-debuginfo                          OpenMandriva Cooker - x86_64 - non-free - Debug                                  disabled
cooker-x86_64-non-free-source                             OpenMandriva Cooker - x86_64 - non-free - Source                                 disabled
cooker-x86_64-restricted                                  OpenMandriva Cooker - x86_64 - Restricted                                        disabled
cooker-x86_64-restricted-debuginfo                        OpenMandriva Cooker - x86_64 - Restricted - Debug                                disabled
cooker-x86_64-restricted-source                           OpenMandriva Cooker - x86_64 - Restricted - Source                               disabled
cooker-x86_64-source                                      OpenMandriva Cooker - x86_64 - Source                                            disabled
openmandriva-contrib-x86_64                               OpenMandriva 4.0 - x86_64                                                        disabled
openmandriva-i686                                         OpenMandriva 4.0 - i686                                                          disabled
openmandriva-i686-contrib                                 OpenMandriva 4.0 - i686 - Contrib                                                disabled
openmandriva-i686-contrib-debuginfo                       OpenMandriva 4.0 - i686 - Contrib - Debug                                        disabled
openmandriva-i686-debuginfo                               OpenMandriva 4.0 - i686 - Debug                                                  disabled
openmandriva-i686-non-free                                OpenMandriva 4.0 - i686 - Non-free                                               disabled
openmandriva-i686-non-free-debuginfo                      OpenMandriva 4.0 - i686 - Non-free - Debug                                       disabled
openmandriva-i686-restricted                              OpenMandriva 4.0 - i686 - Restricted                                             disabled
openmandriva-i686-restricted-debuginfo                    OpenMandriva 4.0 - i686 - Restricted - Debug                                     disabled
openmandriva-x86_64                                       OpenMandriva 4.0 - x86_64                                                        disabled
openmandriva-x86_64-contrib                               OpenMandriva 4.0 - x86_64 - Contrib                                              disabled
openmandriva-x86_64-contrib-debuginfo                     OpenMandriva 4.0 - x86_64 - Contrib - Debug                                      disabled
openmandriva-x86_64-contrib-source                        OpenMandriva 4.0 - x86_64 - Contrib - Source                                     disabled
openmandriva-x86_64-debuginfo                             OpenMandriva 4.0 - x86_64 - Debug                                                disabled
openmandriva-x86_64-non-free                              OpenMandriva 4.0 - x86_64 - non-free                                             disabled
openmandriva-x86_64-non-free-debuginfo                    OpenMandriva 4.0 - x86_64 - non-free - Debug                                     disabled
openmandriva-x86_64-non-free-source                       OpenMandriva 4.0 - x86_64 - non-free - Source                                    disabled
openmandriva-x86_64-restricted                            OpenMandriva 4.0 - x86_64 - Restricted                                           disabled
openmandriva-x86_64-restricted-debuginfo                  OpenMandriva 4.0 - x86_64 - Restricted - Debug                                   disabled
openmandriva-x86_64-restricted-source                     OpenMandriva 4.0 - x86_64 - Restricted - Source                                  disabled
openmandriva-x86_64-source                                OpenMandriva 4.0 - x86_64 - Source                                               disabled
testing-i686                                              OpenMandriva 4.0 - i686 - Test Updates                                           disabled
testing-i686-contrib                                      OpenMandriva 4.0 - i686 - Contrib - Test Updates                                 disabled
testing-i686-contrib-debuginfo                            OpenMandriva 4.0 - i686 - Contrib - Test Updates - Debug                         disabled
testing-i686-debuginfo                                    OpenMandriva 4.0 - i686 - Test Updates - Debug                                   disabled
testing-i686-non-free                                     OpenMandriva 4.0 - i686 - Non-free - Test Updates                                disabled
testing-i686-non-free-debuginfo                           OpenMandriva 4.0 - i686 - Non-free - Test Updates - Debug                        disabled
testing-i686-restricted                                   OpenMandriva 4.0 - i686 - Restricted - Test Updates                              disabled
testing-i686-restricted-debuginfo                         OpenMandriva 4.0 - i686 - Restricted - Test Updates - Debug                      disabled
testing-x86_64                                            OpenMandriva 4.0 - x86_64 - Test Updates                                         disabled
testing-x86_64-contrib                                    OpenMandriva 4.0 - x86_64 - Contrib - Test Updates                               disabled
testing-x86_64-contrib-debuginfo                          OpenMandriva 4.0 - x86_64 - Contrib - Test Updates - Debug                       disabled
testing-x86_64-contrib-source                             OpenMandriva 4.0 - x86_64 - Contrib - Test Updates - Source                      disabled
testing-x86_64-debuginfo                                  OpenMandriva 4.0 - x86_64 - Test Updates - Debug                                 disabled
testing-x86_64-non-free                                   OpenMandriva 4.0 - x86_64 - non-free - Test Updates                              disabled
testing-x86_64-non-free-debuginfo                         OpenMandriva 4.0 - x86_64 - non-free - Test Updates - Debug                      disabled
testing-x86_64-non-free-source                            OpenMandriva 4.0 - x86_64 - non-free - Test Updates - Source                     disabled
testing-x86_64-restricted                                 OpenMandriva 4.0 - x86_64 - Restricted - Test Updates                            disabled
testing-x86_64-restricted-debuginfo                       OpenMandriva 4.0 - x86_64 - Restricted - Test Updates - Debug                    disabled
testing-x86_64-restricted-source                          OpenMandriva 4.0 - x86_64 - Restricted - Test Updates - Source                   disabled
testing-x86_64-source                                     OpenMandriva 4.0 - x86_64 - Test Updates - Source                                disabled
updates-contrib-x86_64                                    OpenMandriva 4.0 - x86_64 - Updates                                              disabled
updates-i686                                              OpenMandriva 4.0 - i686 - Updates                                                disabled
updates-i686-contrib                                      OpenMandriva 4.0 - i686 - Contrib - Updates                                      disabled
updates-i686-contrib-debuginfo                            OpenMandriva 4.0 - i686 - Contrib - Updates - Debug                              disabled
updates-i686-debuginfo                                    OpenMandriva 4.0 - i686 - Updates - Debug                                        disabled
updates-i686-non-free                                     OpenMandriva 4.0 - i686 - Non-free - Updates                                     disabled
updates-i686-non-free-debuginfo                           OpenMandriva 4.0 - i686 - Non-free - Updates - Debug                             disabled
updates-i686-restricted                                   OpenMandriva 4.0 - i686 - Restricted - Updates                                   disabled
updates-i686-restricted-debuginfo                         OpenMandriva 4.0 - i686 - Restricted - Updates - Debug                           disabled
updates-x86_64                                            OpenMandriva 4.0 - x86_64 - Updates                                              disabled
updates-x86_64-contrib                                    OpenMandriva 4.0 - x86_64 - Contrib - Updates                                    disabled
updates-x86_64-contrib-debuginfo                          OpenMandriva 4.0 - x86_64 - Contrib - Updates - Debug                            disabled
updates-x86_64-contrib-source                             OpenMandriva 4.0 - x86_64 - Contrib - Updates - Source                           disabled
updates-x86_64-debuginfo                                  OpenMandriva 4.0 - x86_64 - Updates - Debug                                      disabled
updates-x86_64-non-free                                   OpenMandriva 4.0 - x86_64 - non-free - Updates                                   disabled
updates-x86_64-non-free-debuginfo                         OpenMandriva 4.0 - x86_64 - non-free - Updates - Debug                           disabled
updates-x86_64-non-free-source                            OpenMandriva 4.0 - x86_64 - non-free - Updates - Source                          disabled
updates-x86_64-restricted                                 OpenMandriva 4.0 - x86_64 - Restricted - Updates                                 disabled
updates-x86_64-restricted-debuginfo                       OpenMandriva 4.0 - x86_64 - Restricted - Updates - Debug                         disabled
updates-x86_64-restricted-source                          OpenMandriva 4.0 - x86_64 - Restricted - Updates - Source                        disabled
updates-x86_64-source                                     OpenMandriva 4.0 - x86_64 - Updates - Source                                     disabled

First we may notice @ben79 it is rigtht (as usual :wink: :man_student:): Lx alpha is actually using cooker repositoryies and updates is not used.

The command config-manager helps us to configure repositories. As instance let’s enable contrib and restricted repositories:

$ sudo dnf config-manager --enable cooker-x86_64-contrib cooker-updates-x86_64-contrib cooker-x86_64-restricted  cooker-updates-x86_64-restricted

So now the list of enabled repos is changed as expected:

$ dnf repolist  
Last metadata expiration check: 0:00:28 ago on Mon Jan  7 23:12:36 2019.
repo id                                                         repo name                                                                          status
cooker-updates-x86_64                                           OpenMandriva Cooker - x86_64 - Updates                                                 0
cooker-updates-x86_64-contrib                                   OpenMandriva Cooker - x86_64 - Contrib - Updates                                       0
cooker-updates-x86_64-restricted                                OpenMandriva Cooker - x86_64 - Restricted - Updates                                    0
cooker-x86_64                                                   OpenMandriva Cooker - x86_64                                                       17575
cooker-x86_64-contrib                                           OpenMandriva Cooker - x86_64 - Contrib                                             10467
cooker-x86_64-restricted                                        OpenMandriva Cooker - x86_64 - Restricted                                              0

To disable a repo is as simple as enable it. Let’s diasable restricted repo:

$ sudo dnf config-manager --disable cooker-x86_64-restricted cooker-updates-x86_64-restricted 
$ dnf repolist  
Last metadata expiration check: 0:04:00 ago on Mon Jan  7 23:12:36 2019.
repo id                                                         repo name                                                                          status
cooker-updates-x86_64                                           OpenMandriva Cooker - x86_64 - Updates                                                 0
cooker-updates-x86_64-contrib                                   OpenMandriva Cooker - x86_64 - Contrib - Updates                                       0
cooker-x86_64                                                   OpenMandriva Cooker - x86_64                                                       17575
cooker-x86_64-contrib                                           OpenMandriva Cooker - x86_64 - Contrib                                             10467

Provata openmandriva Lx4 alpha
0MLx4: impossibile aggiornare
(Ben Bullard) #12

That is useful. On the other hand to be honest what I wrote is what I learned in Fedora Core 3 & 4 years ago.

I’ll have to get used to dnf config-manager command. That will be very useful after repos are split and we need to tell a user how to install a package or package group form testing repos. FWIW after repos are split we will have the familiar release, updates, testing, and debug lists for each repo category (main, contrib, non-free, and restricted) as we have had forever in Mandrake/Mandriva/OpenMandriva. And as before user would normally enable (if not automatically enabled) both release and updates of which ever catagories they choose. Things are being changed such that it should be more possible to not have contrib or non-free enabled in particular if a user wishes so.


#14

Well I am totally new about dnf so i liked your posts about most common commands on this and I decided to contribute with some other IMHO useful everyday use commands I discover in my own learning process.

Actually I have not a clear idea about how to make this. I only know how to add a new repository in general:

sudo dnf config-manager --add-repo <mirror_url>/<lx_version>/repository///

For instance, here is the command to add mirrorservice mirror for main/release

sudo dnf config-manager --add-repo https://www.mirrorservice.org/sites/downloads.openmandriva.org/cooker/repository/x86_64/main/release

All other repos and branches should be added by hand and abf-downloads should be disabled by hand too.

I find the above is not a really smart process and maybe there is an easy way to make this I still don’t know so for now I prefer not to write about this.


(Ben Bullard) #15

You have added useful stuff to these threads IMO.

I don’t know any practical way to change repos to a mirror other than editing the necessary files manually with a text editor like vim or nano. Can also be done with kwrite and kate.

:speak_no_evil: :hear_no_evil: :see_no_evil:


(Ben Bullard) #16

Why add the cooker-updates? There are no packages in them.


#17

It is just an example as close as possible to the everyday use with a stable version rather than a command d to copy and paste in a test environment. Of course I used cooker repository because 4.0 one is still empty.


(Ben Bullard) #18

OK, makes sense.


#19

enable.txt (82 Bytes)
disable.txt (2.2 KB)
I have limited bandwidth at home and do updates on another network elsewhere. I have disabled timers, uninstalled dnfdragora and KDE discover in Fedora and it still would go online and update repository metadata running my account over my bandwidth limit.
After studying documentation and finding more related timers that could cause it to still update, I finally decided to design two scripts to disable repos after updates, and enable repos before updating. By keeping the repos disabled, it don’t go online downloading anything.
I adapted same system with OpenMandriva and don’t need to uninstall any Software discovery applications anymore. The scripts are called “enable.sh” and “disable.sh”, so before going to apply updates I issue command: sudo bash to get root prompt, then ./enable.sh, after updates completed I issue command: ./disable.sh. Both scripts are in my user’s home directory.

The reason I mention this, is because it’s a simple one word command to enable desired repos and a one word command to ensure all repos are disable. mandian recommends: “abf-downloads should be disabled by hand too”. I disagree, have a look at the commands in the scripts.


#20

In _/etc/dnf/automatic.conf_there is the following setting:

download_updates = yes

You may try to substitute it with the following one:

download_updates = no

#21

Does that work for downloading repository metadata? It’s not updates that use up my bandwidth, it’s checking for updates that is the problem. I have many operating systems, need to keep control. My best option for high speed internet is through my phone, 4GB per month. Anyway, my previous post is about how to enable or disable repos with a single command rather than the time consuming “edit one at a time by hand”.

When I decide to do updates, I hit the up scroll key till the command below shows up, then I hit the enter key, it will enable repos, auto upgrade and disable repos without typing anything because that command is in bash history.

[root@jo-pc jo]# ./enable.sh && dnf -y upgrade && ./disable.sh

Whether updates should be downloaded when they are available, by
dnf-automatic.timer. notifyonly.timer, download.timer and
install.timer override this setting.
download_updates = no