1

While installing a web server, I've been pondering some serious question...
"Do I really need that package?"

I've noticed that when you install your packages for your web server,
you often have two "version" of the same package.

For example, while installing php7.4, you can install php-mbstring and php7.4-mbstring
Or php-gd and php7.4-gd.

So my question is, if I install php7.4-mbstring, do I also need to install php-mbstring?
Does it works the same with all packages having the same naming pattern (php-dev=>php7.4-dev, etc)

2 Answers 2

0
+100

Typically, the package without the version number will "point" to the most current package via dependencies.

So today, you can install php-mbstring, and it will install php7.4-mbstring as well. Some time in the future, php7.5-mbstring will come out, and php-mbstring will then "point" to php7.5-mstring.

So if you have installed php-mbstring, it will resolve to a newer version next time dependencies are checked.

If you only have installed php7.4-mstring, you won't get the newer package.

2
  • I see. So in case of php, it's better to install package version directly to avoid version disparities
    – Preciel
    Commented Jun 27, 2021 at 21:17
  • What is "better" entirely depends on your use case. For production servers it's indeed better to manually upgrade versions.
    – dirkt
    Commented Jun 28, 2021 at 3:34
1

The Guidelines for Naming Fedora Packages defines package names and deals with such cases as in your example. This convention is followed by almost all Linux distributions.

Multiple packages with the same base name

For many reasons, it is sometimes advantageous to keep multiple versions of a package in Fedora to be installed simultaneously. When doing so, the package name MUST reflect this fact. One package SHOULD use the base name (with no version information). All other packages derived from it MUST include the base name suffixed by either:

  • The package version, which SHOULD include the periods present in the original version.
    • If the base package name ends with a digit, a single underscore ("_") MUST be appended to the name, and the version MUST be appended to that, in order to avoid confusion over where the name ends and the version begins.
    • If the base package name does not end with a digit, the version MUST be directly appended to the package name with no intervening separator.
  • a hyphen ("-") followed by a descriptive suffix such as "stable" which provides some indication as to the nature of the packaged version.

Examples:

  • The python-sqlalchemy package occasionally has multiple versions in Fedora for backwards compatibility. The most current version of python-sqlalchemy is named python-sqlalchemy and an older supported version is python-sqlalchemy0.5. No delimiter is used in this situation.
  • The most current version of the v8 package is named v8. In order to package version "3.13", the package MUST be named v8_3.13.

So the version with just the name is the base version, all packages that append more information are derived versions.

Many types of derivation are possible. One of the most common one is used for marking older versions that are kept for compatibility with older software. But others are possible, such as additional tools or libraries for different programming languages.

3
  • Thanks for the link and detailed explanation. dirkt actually makes it more clear for me to understand, so I will valid his answer. As I spent all my points to upvote, I can't upvote you atm... sorry...
    – Preciel
    Commented Jun 27, 2021 at 21:16
  • You said you are "looking for an answer from a reputable source". There can't be any more reputable source than the official Linux guidelines.
    – harrymc
    Commented Jun 28, 2021 at 7:34
  • True. It doesn't mean that the question doesn't need to be answered as well. In fact, it's both your answer anddirkt answer that makes a full one. Yours tell me about the packages with same base name, and his about if I need to install both or not. If I could share the bounty, I would.
    – Preciel
    Commented Jun 28, 2021 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .