Fedora installing Git and a few other tips - mhulse/mhulse.github.io GitHub Wiki

When installing a new package on a Linux/Fedora system, some might say that running the following command first is best practice:

dnf update

… which ensures the existing packages are up to date before installing anything new.

Note that you could turn on the -y flag (meaning “say yes to any questions”) but you may end up nuke a/many config file(s) in the update process. In other words, let it prompt you throughout the update process and you can decide what to do as it updates.

Example of a config getting nuked would be the Firewalld; dnf update may close all the ports (default setting) if you had modified the config file before the update.

Next, install Git:

dnf -y install git

Once complete:

git --version

Note: If you’re unsure of the setup, you could just skip to installing Git.

Once the update completes, it’s likely you’ll need to reboot (basically, if anything system-level updates, you‘ll need to reboot). Logging-out and back in (of your session) may work under some circumstances too.

To reboot:

reboot

To restart apache:

systemctl restart httpd

Where httpd is the name of the service. The above is called the “standard system d interface”; it’s likely to work all the time for many different services (in comparison, apachectl restart works too, but it could change or be removed in future, so it’s best to use the systemctl command instead).