« RPM/DNF/FAQ » : différence entre les versions

De TartareFR
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
 
(3 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
== F.A.Q. Contents ==
== F.A.Q. Contents ==
'''General Questions'''
'''General Questions'''
* [[#question1|What does DNF stand for ?]]
* [[#What does DNF stand for ?|What does DNF stand for ?]]
* [[#question2|Can I have DNF and Yum installed side by side ?]]
* [[#Can I have DNF and Yum installed side by side ?|Can I have DNF and Yum installed side by side ?]]
* [[#question3|What to do with packages that DNF refuses to remove because their ''%pre'' or ''%preun'' scripts are failing ?]]
* [[#What to do with packages that DNF refuses to remove because their ''%pre'' or ''%preun'' scripts are failing ?|What to do with packages that DNF refuses to remove because their ''%pre'' or ''%preun'' scripts are failing ?]]
* [[#question4|Why are ''dnf check-update'' packages not marked for upgrade in the following ''dnf upgrade'' ?]]
* [[#Why are ''dnf check-update'' packages not marked for upgrade in the following ''dnf upgrade'' ?|Why are ''dnf check-update'' packages not marked for upgrade in the following ''dnf upgrade'' ?]]
* [[#question5|Why do I get different results with ''dnf upgrade'' vs ''yum update'' ?]]
* [[#Why do I get different results with ''dnf upgrade'' vs ''yum update'' ?|Why do I get different results with ''dnf upgrade'' vs ''yum update'' ?]]
* [[#question6|Is it possible to force DNF to get the latest metadata on ''dnf upgrade'' ?]]
* [[#Is it possible to force DNF to get the latest metadata on ''dnf upgrade'' ?|Is it possible to force DNF to get the latest metadata on ''dnf upgrade'' ?]]
* [[#question7|How do I disable automatic metadata synchronization service ?]]
* [[#How do I disable automatic metadata synchronization service ?|How do I disable automatic metadata synchronization service ?]]
* [[#question8|Shouldn't DNF exit soon from certain commands if it is not run under root ?]]
* [[#Shouldn't DNF exit soon from certain commands if it is not run under root ?|Shouldn't DNF exit soon from certain commands if it is not run under root ?]]
'''Using DNF in Fedora'''
'''Using DNF in Fedora'''
* [[#question9|For my stable Fedora release, can I install the rawhide packages for testing purposes ?]]
* [[#For my stable Fedora release, can I install the rawhide packages for testing purposes ?|For my stable Fedora release, can I install the rawhide packages for testing purposes ?]]


== General Questions ==
== General Questions ==


{{Admon/faq|1|What does DNF stand for ?|Dandified [http://yum.baseurl.org/ Yum]}}
{{Admon/faq|What does DNF stand for ?|Dandified [http://yum.baseurl.org/ Yum]}}
{{Admon/faq|2|Can I have DNF and Yum installed side by side ?|Yes, you can. And this setup is tested by many.
{{Admon/faq|Can I have DNF and Yum installed side by side ?|Yes, you can. And this setup is tested by many.


There is one restriction: DNF and Yum keep additional data about each installed package and every performed transaction. This data is currently not shared between the two managers so if the admin installs half of the packages with DNF and the other half with Yum then each program can not benefit from the information held by the other one. The practical bottom line is that commands like '''autoremove''' can not take a completely informed decision and thus have to "play it safe" and remove only a subset of dependencies they would be able to otherwise. Similar situation exists with groups.}}
There is one restriction: DNF and Yum keep additional data about each installed package and every performed transaction. This data is currently not shared between the two managers so if the admin installs half of the packages with DNF and the other half with Yum then each program can not benefit from the information held by the other one. The practical bottom line is that commands like '''autoremove''' can not take a completely informed decision and thus have to "play it safe" and remove only a subset of dependencies they would be able to otherwise. Similar situation exists with groups.}}
{{Admon/faq|3|What to do with packages that DNF refuses to remove because their ''%pre'' or ''%preun'' scripts are failing ?|If this happens, it is a packaging error and consider reporting the failure to the package's maintainer.
{{Admon/faq|What to do with packages that DNF refuses to remove because their ''%pre'' or ''%preun'' scripts are failing ?|If this happens, it is a packaging error and consider reporting the failure to the package's maintainer.


You can usually remove such package with '''rpm''':
You can usually remove such package with '''rpm''':
<pre>rpm -e <package-version> --noscripts</pre>}}
<pre>rpm -e <package-version> --noscripts</pre>}}
{{Admon/faq|4|Why are ''dnf check-update'' packages not marked for upgrade in the following ''dnf upgrade'' ?|Sometimes one can see that a newer version of a package is available in the repos:
{{Admon/faq|Why are ''dnf check-update'' packages not marked for upgrade in the following ''dnf upgrade'' ?|Sometimes one can see that a newer version of a package is available in the repos:
<pre>
<pre>
$ dnf check-update
$ dnf check-update
Ligne 42 : Ligne 42 :
</pre>
</pre>
}}
}}
{{Admon/faq|5|Why do I get different results with ''dnf upgrade'' vs ''yum update'' ?|We get this reported as a bug quite often, but it usually is not. One reason to see this is that DNF does not list update candidates as it explores them. More frequently however the reporter means actual difference in the proposed transaction. This is most often because the metadata the two packagers are working with were taken at a different time (DNF has a notoriously looser schedule on metadata updates to save time and bandwidth), and sometimes also because the depsolvers inside are designed to take a different course of action when encountering some specific update scenario.
{{Admon/faq|Why do I get different results with ''dnf upgrade'' vs ''yum update'' ?|We get this reported as a bug quite often, but it usually is not. One reason to see this is that DNF does not list update candidates as it explores them. More frequently however the reporter means actual difference in the proposed transaction. This is most often because the metadata the two packagers are working with were taken at a different time (DNF has a notoriously looser schedule on metadata updates to save time and bandwidth), and sometimes also because the depsolvers inside are designed to take a different course of action when encountering some specific update scenario.


The bottom line is: unless a real update problem occurs (i.e. DNF refuses to update a package that Yum updates) with the same set of metadata, this is not an issue.
The bottom line is: unless a real update problem occurs (i.e. DNF refuses to update a package that Yum updates) with the same set of metadata, this is not an issue.
}}
}}
{{Admon/faq|6|Is it possible to force DNF to get the latest metadata on ''dnf upgrade'' ?|Yes, clear the cache first:
{{Admon/faq|Is it possible to force DNF to get the latest metadata on ''dnf upgrade'' ?|Yes, clear the cache first:
<pre>
<pre>
$ dnf clean metadata
$ dnf clean metadata
Ligne 58 : Ligne 58 :


If you're the kind of the user who always wants the freshest metadata possible, you'll probably want to disable the automatic metadata updates.}}
If you're the kind of the user who always wants the freshest metadata possible, you'll probably want to disable the automatic metadata updates.}}
{{Admon/faq|7|How do I disable automatic metadata synchronization service ?|Several ways to do that. The DNF way is to add the following to <path>/etc/dnf/dnf.conf</path>:
{{Admon/faq|How do I disable automatic metadata synchronization service ?|Several ways to do that. The DNF way is to add the following to <path>/etc/dnf/dnf.conf</path>:
<pre>
<pre>
metadata_timer_sync=0
metadata_timer_sync=0
</pre>
</pre>
}}
}}
{{Admon/faq|8|Shouldn't DNF exit soon from certain commands if it is not run under root ?|No, there can be systems and scenarios that allow other users than root to successfully perform '''dnf install''' and similar and it would be impractical to stop these from functioning by the UID check. Alternatively, the practice of checking filesystem permissions instead of the effective UID could lead to false positives since there is plenty of time between DNF startup and the possible transaction start when permissions can be changed by a different process.
{{Admon/faq|Shouldn't DNF exit soon from certain commands if it is not run under root ?|No, there can be systems and scenarios that allow other users than root to successfully perform '''dnf install''' and similar and it would be impractical to stop these from functioning by the UID check. Alternatively, the practice of checking filesystem permissions instead of the effective UID could lead to false positives since there is plenty of time between DNF startup and the possible transaction start when permissions can be changed by a different process.


If the time loss incurred by repeated runs of DNF is unacceptable for you, consider using the [https://github.com/akozumpl/dnf-plugins-core/blob/master/plugins/noroot.py noroot plugin].
If the time loss incurred by repeated runs of DNF is unacceptable for you, consider using the [https://github.com/akozumpl/dnf-plugins-core/blob/master/plugins/noroot.py noroot plugin].
Ligne 70 : Ligne 70 :
== Using DNF in Fedora ==
== Using DNF in Fedora ==


{{Admon/faq|9|For my stable Fedora release, can I install the rawhide packages for testing purposes ?|Yes, in two steps: first install the necessary '''.repo''' files:
{{Admon/faq|For my stable Fedora release, can I install the rawhide packages for testing purposes ?|Yes, in two steps
<pre>
* first install the necessary '''.repo''' files :<pre>dnf install fedora-release-rawhide</pre>
dnf install fedora-release-rawhide
* Then, when you want to include the packages from the rawhide repo, execute a DNF command with Rawhide enabled :<pre>dnf install --enablerepo=rawhide upgrade rpm</pre>
</pre>
Then, when you want to include the packages from the rawhide repo, execute a DNF command with Rawhide enabled:
<pre>
dnf install --enablerepo=rawhide upgrade rpm
</pre>
{{Admon/warning||Installing rawhide packages onto a stable Fedora release system is generally discouraged as it leads to less tested combinations of installed packages. Please consider this step carefully.}}
{{Admon/warning||Installing rawhide packages onto a stable Fedora release system is generally discouraged as it leads to less tested combinations of installed packages. Please consider this step carefully.}}
}}
}}

Dernière version du 16 août 2014 à 10:49

F.A.Q. Contents

General Questions

Using DNF in Fedora

General Questions

FaqQuestion.png
What does DNF stand for ?
Dandified Yum

FaqQuestion.png
Can I have DNF and Yum installed side by side ?
Yes, you can. And this setup is tested by many. There is one restriction: DNF and Yum keep additional data about each installed package and every performed transaction. This data is currently not shared between the two managers so if the admin installs half of the packages with DNF and the other half with Yum then each program can not benefit from the information held by the other one. The practical bottom line is that commands like autoremove can not take a completely informed decision and thus have to "play it safe" and remove only a subset of dependencies they would be able to otherwise. Similar situation exists with groups.

FaqQuestion.png
What to do with packages that DNF refuses to remove because their %pre or %preun scripts are failing ?
If this happens, it is a packaging error and consider reporting the failure to the package's maintainer.

You can usually remove such package with rpm:

rpm -e <package-version> --noscripts

FaqQuestion.png
Why are dnf check-update packages not marked for upgrade in the following dnf upgrade ?
Sometimes one can see that a newer version of a package is available in the repos:
$ dnf check-update
libocsync0.x86_64 0.91.4-2.1              devel_repo
owncloud-client.x86_64 1.5.0-18.1         devel_repo

Yet the immediately following dnf upgrade does not offer them for upgrade:

$ dnf upgrade
Resolving dependencies
--> Starting dependency resolution
--> Finished dependency resolution
Dependencies resolved.
Nothing to do.

It might seem odd but in fact this can happen quite easily: what the first command does is only check whether there are some available packages with the same name as an installed package but with a higher version. Those are considered upgrade candidates by check-update, but no actual dependency resolving takes place there. That only happens during dnf upgrade and if the resolving procedure then discovers that some of the packages do not have their dependencies ready yet, then they are not offered in the upgrade. To see the precise reason why it was not possible to do the upgrade in this case, use:

$ dnf upgrade --best

FaqQuestion.png
Why do I get different results with dnf upgrade vs yum update ?
We get this reported as a bug quite often, but it usually is not. One reason to see this is that DNF does not list update candidates as it explores them. More frequently however the reporter means actual difference in the proposed transaction. This is most often because the metadata the two packagers are working with were taken at a different time (DNF has a notoriously looser schedule on metadata updates to save time and bandwidth), and sometimes also because the depsolvers inside are designed to take a different course of action when encountering some specific update scenario. The bottom line is: unless a real update problem occurs (i.e. DNF refuses to update a package that Yum updates) with the same set of metadata, this is not an issue.

FaqQuestion.png
Is it possible to force DNF to get the latest metadata on dnf upgrade ?
Yes, clear the cache first:
$ dnf clean metadata
$ dnf upgrade

An alternative is to shorten the default expiry time of repos, for that edit <path>/etc/dnf/dnf.conf</path> and set:

metadata_expire=0

Of course, some repos might use a custom metadata_expire value, you'll currently have to change these manually too.

If you're the kind of the user who always wants the freshest metadata possible, you'll probably want to disable the automatic metadata updates.

FaqQuestion.png
How do I disable automatic metadata synchronization service ?
Several ways to do that. The DNF way is to add the following to <path>/etc/dnf/dnf.conf</path>:
metadata_timer_sync=0

FaqQuestion.png
Shouldn't DNF exit soon from certain commands if it is not run under root ?
No, there can be systems and scenarios that allow other users than root to successfully perform dnf install and similar and it would be impractical to stop these from functioning by the UID check. Alternatively, the practice of checking filesystem permissions instead of the effective UID could lead to false positives since there is plenty of time between DNF startup and the possible transaction start when permissions can be changed by a different process. If the time loss incurred by repeated runs of DNF is unacceptable for you, consider using the noroot plugin.

Using DNF in Fedora

FaqQuestion.png
For my stable Fedora release, can I install the rawhide packages for testing purposes ?
Yes, in two steps
  • first install the necessary .repo files :
    dnf install fedora-release-rawhide
  • Then, when you want to include the packages from the rawhide repo, execute a DNF command with Rawhide enabled :
    dnf install --enablerepo=rawhide upgrade rpm
Warning.png
Installing rawhide packages onto a stable Fedora release system is generally discouraged as it leads to less tested combinations of installed packages. Please consider this step carefully.