Difference between revisions of "Fedora Tips"

From TheBestLinux.com
Jump to navigation Jump to search
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
<h1>Fedora Linux Tips, Tricks, Fixes & More!</h1>
+
= '''Fedora Linux Documentation''' =
<h5>Note: Most of this information also pertains to CentOS, SuSE, Mandriva, and other RedHat derivatives</h5>
+
The main full documentation for Fedora Linux is at https://docs.fedoraproject.org/en-US/docs/.
 
<br />
 
<br />
<h3>Manual Network Configuration Using the Command Line</3>
+
There is also a section called "Quick Docs", which contains the most common documents requested and utilized, located at https://docs.fedoraproject.org/en-US/quick-docs/.
 +
 
 +
= ''' General Fedora Linux Tips, Tricks, Fixes & More!''' =
 +
<h5>Note:  Most of this information also pertains to Rocky Linux, Alma Linux, CentOS, SuSE, Mandriva, and other RedHat derivatives</h5>
 +
<br />
 +
Setup yum repo for Google Chrome Web Browser:
 
<br />
 
<br />
 +
<pre style="color:blue">
 +
cat << EOF > /etc/yum.repos.d/google-chrome.repo
 +
[google-chrome]
 +
name=google-chrome - \$basearch
 +
baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch
 +
enabled=1
 +
gpgcheck=1
 +
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
 +
EOF
 +
</pre>
 +
<br /><br />
  
 +
= '''Fedora Storage Disk Layout & Related Info''' =
 +
== '''Default Disk Partitioning''' ==
 +
The current default Fedora Linux installation as the only OS on a new 512 GB drive would probably end up with a 600 MB efi partition, a 1 GB /boot (ext4) partition, and the remainder as btrfs volume containing the root and home subvolumes. BTRFS volumes can be likened as similar to an LVM volume group and the subvolumes as similar to the LVM logical volume with one notable difference. LVM LVs are created at a fixed size. With btrfs all subvolumes share the entire space of the main volume so the user does not have to adjust size as space is used. It does automatically create those 3 partitions, of the size noted for the efi and /boot partitions, and will adjust the size of the btrfs partition to fit the available space. Fedora uses virtual swap as zram in actual RAM so no swap partition is created by default. For most users zram is quite adequate.
 +
 +
== HowTo's & Other Docs ==
 +
https://docs.fedoraproject.org/en-US/Fedora/17/html/Installation_Guide/Making_Minimal_Boot_Media.html
 +
<br /><br >
 +
== '''Boot Images & Install Media''' ==
 +
There are many ways to create bootable installation media, depending on both the operating system you are currently using, and your preferences to use GUI graphical tools or command-line tools.
 +
 +
For those who prefer graphical tools you can use with your mouse, the best tools these days is Rufu, available at https://rufus.ie/.
 +
 +
For command-line users, the dd command is prefereable.
 +
 +
=== '''Identifying Your USB Deivice Names''' ===
 +
There are a number of ways to identify the device name of your USB drives, and I find using the "dmesg" command works quickest and most reliable.  Here is an example of the command I use to list all storage "block" devices, which includes hard drives and USB flash drives, among others your system may have:
 +
<pre style="color:blue">
 +
[root@server.dawgland.com:~]# dmesg | grep Protect
 +
[    0.962950] sd 0:0:0:0: [sda] Write Protect is off
 +
[    0.963892] sd 2:0:0:0: [sdb] Write Protect is off
 +
[    2.270080] sd 5:0:0:0: [sdc] Write Protect is off
 +
[    2.270409] sd 5:1:0:0: [sdd] Write Protect is off
 +
[    3.353753] sd 7:0:0:0: [sde] Write Protect is off
 +
[  50.181538] sd 8:0:0:0: [sdf] Write Protect is off
 +
[  50.196976] sd 9:0:0:0: [sdg] Write Protect is off
 +
[  50.197901] sd 10:0:0:0: [sdh] Write Protect is off
 +
[  51.212620] sd 13:0:0:0: [sdi] Write Protect is off
 +
[  51.683602] sd 11:0:0:0: [sdj] Write Protect is off
 +
[  51.688550] sd 12:0:0:0: [sdk] Write Protect is off
 +
[  964.308911] sd 14:0:0:0: [sdl] Write Protect is off
 +
[root@server.dawgland.com:~]#
 +
</pre>
 +
 +
As you can see in my example, I have a LOT of devices, sda through sdl(Lowercase L), which stands for "SCSI Device A", etc., through "SCSI Device L", which is my most current USB device plugged into the computer since powering on.  That means the new USB flash drive I just plugged into my computer is at:
 +
<pre style="color:blue">
 +
/dev/sdl
 +
</pre>
 +
 +
Therefore, to write an image file such as an .img or .iso file, I MUST be sure to use the CORRECT USB device name, otherwise I WILL delete valuable data that cannot be recovered!!!  I can not stress the importance of the enough, and you are responsible for any mistakes you might make!
 +
 +
=== '''Modifying Existing Partition Tables''' ===
 +
The "GParted" tool is a graphical front-end to the parted command, and makes it much easier to change partition sizes and move them around easily!  The tool is best used as a bootable USB flash drive, and the latest images are available at https://gparted.org/liveusb.php
 +
 +
To create a new USB flash drive with the image you can download from https://gparted.org/liveusb.php, use the dd command as follows, after first identifying and confirming your correct USB device name as described above, and assuming your most currently plugged in USB device is "/dev/sdl", without the quotes:
 +
<pre style="color:blue">
 +
[jamie@server.dawgland.com:~/Downloads]$ sudo dd if=./gparted-live-1.6.0-10-amd64.iso of=/dev/sdl bs=4M; sync
 +
137+1 records in
 +
137+1 records out
 +
576716800 bytes (577 MB, 550 MiB) copied, 56.0471 s, 10.3 MB/s
 +
[jamie@server.dawgland.com:~/Downloads]$
 +
</pre>
 +
 +
=== '''Creation of Current Fedora Linux Installation Medida''' ===
 +
There are many ways to create bootable installation media for Fedora Linux, and they are all explained in detail on the FedoraProject.org website at
 +
https://docs.fedoraproject.org/en-US/quick-docs/creating-and-using-a-live-installation-image/#:~:text=Command%20line%20methods,-These%20methods%20are%20considered%20unsupported
 +
 +
 +
 +
=== '''Older archived versions of Fedora''' ===
 +
https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/
 +
<br />
 +
<br />
 +
<br />
 +
 +
= Fedora Post Install Tips =
 +
== About Fedy ==
 +
'''Fedy makes installation of non-free stoftware, such as video and audio codecs, much easier!'''
 +
<br /><br />
 +
 +
== Fedy Installation Process ==
 +
Download the latest source code from github:
 +
<pre style="color:blue">
 +
mkdir /tmp/fedy-src
 +
cd /tmp/fedy-src
 +
git clone https://github.com/satya164/fedy.git
 +
</pre>
 +
<br />
 +
'''Output from above command:'''
 +
<pre style="color:red">
 +
Cloning into 'fedy'...
 +
remote: Counting objects: 4529, done.
 +
remote: Compressing objects: 100% (6/6), done.
 +
remote: Total 4529 (delta 0), reused 0 (delta 0), pack-reused 4523
 +
Receiving objects: 100% (4529/4529), 14.45 MiB | 4.77 MiB/s, done.
 +
Resolving deltas: 100% (2407/2407), done.
 +
Checking connectivity... done.
 +
</pre>
 +
<br /><br />
 +
'''Compile & Install Fedy'''
 +
<pre style="color:blue">
 +
cd fedy
 +
make
 +
</pre>
 +
<br /><br />
 +
'''Output from Above Command:'''
 +
<pre style="color:red">
 +
install -dm755 /usr/bin/
 +
install -dm755 /usr/share/fedy/
 +
for f in *; do [[ $f != "plugins" ]] && cp -pr $f /usr/share/fedy/; done
 +
install -Dpm 0755 fedy.exec /usr/bin/fedy
 +
install -Dpm 0644 fedy.desktop /usr/share/applications/org.ozonos.fedy.desktop
 +
install -Dpm 0644 fedy.appdata.xml /usr/share/appdata/fedy.appdata.xml
 +
install -Dpm 0644 fedy.svg /usr/share/icons/hicolor/scalable/apps/fedy.svg
 +
install -Dpm 0644 fedy-symbolic.svg /usr/share/icons/hicolor/scalable/apps/fedy-symbolic.svg
 +
install -Dpm 0644 run-as-root.policy /usr/share/polkit-1/actions/org.ozonos.pkexec.run-as-root.policy
 +
gtk-update-icon-cache: Cache file created successfully.
 +
</pre>
 +
<br /><br />
 +
<h3><br>You should now have a new icon for Fedy, which should look like this:</h3>
 +
[[File:fedy_icon.jpg]]
 +
<br /><br /><br />
 
<br />
 
<br />
 +
Check MySQL for SSL functionality:<br />
 +
show variables like '%ssl%';
 +
<br /><br />
 +
<h3>Manual Network Configuration Using the Command Line</h3>
 +
<br />
 +
<br /><br />
 +
When setting up a LAMP app, if you get this error during config:
 +
<br />
 +
date.timezone not set
 +
<br />
 +
Edit /etc/php.ini and add:<br />
 +
date.timezone = America/Los_Angeles
 +
<br /><br />
 +
Play video from webcam using MPlayer command line:
 +
<pre style="color:blue">mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0</pre>
 +
This example assumes that your webcam device is at /dev/video0
 +
<br />
 +
The resolution (width=??? & height=???) should be chosen to match the output of your device.
 +
<br /><br />
 +
<h2>Use Mencoder to Record with MPlayer</h2>
 +
<h3>Without Audio:</h3>
 +
<pre style="color:blue">mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -ovc
 +
lavc -o webcam.avi</pre>
 +
<br />
 +
<h3>With Audio:</h3>
 +
<pre style="color:blue">
 +
mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0:forceaudio:adevice=/dev/dsp1 -ovc
 +
lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o webcam.avi
 +
</pre>
 +
<br /><br />
 +
<h3>More Info on Above:</h3><br />
 +
Type 'man mencoder' for more info on the audio options.
 +
<br />
 +
/dev/dsp1 refers to the webcam USB Audio device.
 +
<br />
 +
/dev/dsp refers to the sound card.
 +
<br /><br /><br />
 +
Email Setup with Postfix, Dovecot & MySQL:
 +
<br />
 +
<a href="http://www.dawgland.com/wiki/Postfix_Dovecot_MySQL_HowTo.html">Local</a>
 +
<br /><br />
 
Change Time Zone on OS Using Command Line:
 
Change Time Zone on OS Using Command Line:
 
<br />
 
<br />
 
cp /usr/share/zoneinfo/Zone_You_Want to /etc/localtime overwriting the exisisting /etc/localtime file.  Reboot and you are done!
 
cp /usr/share/zoneinfo/Zone_You_Want to /etc/localtime overwriting the exisisting /etc/localtime file.  Reboot and you are done!
 
<br />
 
<br />
<br >
+
OR
 +
<br />
 +
Use the new timedatectl utility!
 +
As root, type timedatectl list-timezones to list available time zones to pick from
 +
Then, type timedatectl set-timezone TimeZone_You_Want.
 +
<br ><br />
 
Fedora Core 17 bootup error message saying can't load font file "True".  Fix for this error message is here:   
 
Fedora Core 17 bootup error message saying can't load font file "True".  Fix for this error message is here:   
 
<p>
 
<p>
Line 38: Line 211:
 
<br />
 
<br />
 
https://bugzilla.redhat.com/show_bug.cgi?id=799401
 
https://bugzilla.redhat.com/show_bug.cgi?id=799401
 +
<br /><br />
 +
 +
= Linux System Configuration =
 +
== Firewall Configuration & Information ==
 +
'''Firewall Configuration'''
 +
<br />
 +
The easiest way to configure the firewall setup is to use the GUI within X-Windows. 
 +
<br />
 +
This command can be run from an X-Windows terminal with the "/usr/bin/firewall-config" command.
 +
<br /><br />
 +
'''Firewall Control'''
 +
<br />
 +
To Start & Stop the Firewall, use the new "systemctl" command instead of the old style "service" command, such as this:
 +
<pre style="color:blue">
 +
[root@server ~]# systemctl stop firewalld.service
 +
</pre>
 +
<br />
 +
and
 +
<br />
 +
<pre style="color:blue">
 +
[root@server ~]# systemctl start firewalld.service
 +
</pre>
 +
<br /><br />

Latest revision as of 00:20, 5 November 2024

Fedora Linux Documentation

The main full documentation for Fedora Linux is at https://docs.fedoraproject.org/en-US/docs/.
There is also a section called "Quick Docs", which contains the most common documents requested and utilized, located at https://docs.fedoraproject.org/en-US/quick-docs/.

General Fedora Linux Tips, Tricks, Fixes & More!

Note: Most of this information also pertains to Rocky Linux, Alma Linux, CentOS, SuSE, Mandriva, and other RedHat derivatives


Setup yum repo for Google Chrome Web Browser:

cat << EOF > /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome - \$basearch
baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF



Fedora Storage Disk Layout & Related Info

Default Disk Partitioning

The current default Fedora Linux installation as the only OS on a new 512 GB drive would probably end up with a 600 MB efi partition, a 1 GB /boot (ext4) partition, and the remainder as btrfs volume containing the root and home subvolumes. BTRFS volumes can be likened as similar to an LVM volume group and the subvolumes as similar to the LVM logical volume with one notable difference. LVM LVs are created at a fixed size. With btrfs all subvolumes share the entire space of the main volume so the user does not have to adjust size as space is used. It does automatically create those 3 partitions, of the size noted for the efi and /boot partitions, and will adjust the size of the btrfs partition to fit the available space. Fedora uses virtual swap as zram in actual RAM so no swap partition is created by default. For most users zram is quite adequate.

HowTo's & Other Docs

https://docs.fedoraproject.org/en-US/Fedora/17/html/Installation_Guide/Making_Minimal_Boot_Media.html

Boot Images & Install Media

There are many ways to create bootable installation media, depending on both the operating system you are currently using, and your preferences to use GUI graphical tools or command-line tools.

For those who prefer graphical tools you can use with your mouse, the best tools these days is Rufu, available at https://rufus.ie/.

For command-line users, the dd command is prefereable.

Identifying Your USB Deivice Names

There are a number of ways to identify the device name of your USB drives, and I find using the "dmesg" command works quickest and most reliable. Here is an example of the command I use to list all storage "block" devices, which includes hard drives and USB flash drives, among others your system may have:

[root@server.dawgland.com:~]# dmesg | grep Protect
[    0.962950] sd 0:0:0:0: [sda] Write Protect is off
[    0.963892] sd 2:0:0:0: [sdb] Write Protect is off
[    2.270080] sd 5:0:0:0: [sdc] Write Protect is off
[    2.270409] sd 5:1:0:0: [sdd] Write Protect is off
[    3.353753] sd 7:0:0:0: [sde] Write Protect is off
[   50.181538] sd 8:0:0:0: [sdf] Write Protect is off
[   50.196976] sd 9:0:0:0: [sdg] Write Protect is off
[   50.197901] sd 10:0:0:0: [sdh] Write Protect is off
[   51.212620] sd 13:0:0:0: [sdi] Write Protect is off
[   51.683602] sd 11:0:0:0: [sdj] Write Protect is off
[   51.688550] sd 12:0:0:0: [sdk] Write Protect is off
[  964.308911] sd 14:0:0:0: [sdl] Write Protect is off
[root@server.dawgland.com:~]#

As you can see in my example, I have a LOT of devices, sda through sdl(Lowercase L), which stands for "SCSI Device A", etc., through "SCSI Device L", which is my most current USB device plugged into the computer since powering on. That means the new USB flash drive I just plugged into my computer is at:

/dev/sdl

Therefore, to write an image file such as an .img or .iso file, I MUST be sure to use the CORRECT USB device name, otherwise I WILL delete valuable data that cannot be recovered!!! I can not stress the importance of the enough, and you are responsible for any mistakes you might make!

Modifying Existing Partition Tables

The "GParted" tool is a graphical front-end to the parted command, and makes it much easier to change partition sizes and move them around easily! The tool is best used as a bootable USB flash drive, and the latest images are available at https://gparted.org/liveusb.php

To create a new USB flash drive with the image you can download from https://gparted.org/liveusb.php, use the dd command as follows, after first identifying and confirming your correct USB device name as described above, and assuming your most currently plugged in USB device is "/dev/sdl", without the quotes:

[jamie@server.dawgland.com:~/Downloads]$ sudo dd if=./gparted-live-1.6.0-10-amd64.iso of=/dev/sdl bs=4M; sync
137+1 records in
137+1 records out
576716800 bytes (577 MB, 550 MiB) copied, 56.0471 s, 10.3 MB/s
[jamie@server.dawgland.com:~/Downloads]$

Creation of Current Fedora Linux Installation Medida

There are many ways to create bootable installation media for Fedora Linux, and they are all explained in detail on the FedoraProject.org website at https://docs.fedoraproject.org/en-US/quick-docs/creating-and-using-a-live-installation-image/#:~:text=Command%20line%20methods,-These%20methods%20are%20considered%20unsupported


Older archived versions of Fedora

https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/


Fedora Post Install Tips

About Fedy

Fedy makes installation of non-free stoftware, such as video and audio codecs, much easier!

Fedy Installation Process

Download the latest source code from github:

mkdir /tmp/fedy-src
cd /tmp/fedy-src
git clone https://github.com/satya164/fedy.git


Output from above command:

Cloning into 'fedy'...
remote: Counting objects: 4529, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 4529 (delta 0), reused 0 (delta 0), pack-reused 4523
Receiving objects: 100% (4529/4529), 14.45 MiB | 4.77 MiB/s, done.
Resolving deltas: 100% (2407/2407), done.
Checking connectivity... done.



Compile & Install Fedy

cd fedy
make



Output from Above Command:

install -dm755 /usr/bin/
install -dm755 /usr/share/fedy/
for f in *; do [[ $f != "plugins" ]] && cp -pr $f /usr/share/fedy/; done
install -Dpm 0755 fedy.exec /usr/bin/fedy
install -Dpm 0644 fedy.desktop /usr/share/applications/org.ozonos.fedy.desktop
install -Dpm 0644 fedy.appdata.xml /usr/share/appdata/fedy.appdata.xml
install -Dpm 0644 fedy.svg /usr/share/icons/hicolor/scalable/apps/fedy.svg
install -Dpm 0644 fedy-symbolic.svg /usr/share/icons/hicolor/scalable/apps/fedy-symbolic.svg
install -Dpm 0644 run-as-root.policy /usr/share/polkit-1/actions/org.ozonos.pkexec.run-as-root.policy
gtk-update-icon-cache: Cache file created successfully.




You should now have a new icon for Fedy, which should look like this:

Fedy icon.jpg



Check MySQL for SSL functionality:
show variables like '%ssl%';

Manual Network Configuration Using the Command Line




When setting up a LAMP app, if you get this error during config:
date.timezone not set
Edit /etc/php.ini and add:
date.timezone = America/Los_Angeles

Play video from webcam using MPlayer command line:

mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0

This example assumes that your webcam device is at /dev/video0
The resolution (width=??? & height=???) should be chosen to match the output of your device.

Use Mencoder to Record with MPlayer

Without Audio:

mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -ovc
lavc -o webcam.avi


With Audio:

mencoder tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0:forceaudio:adevice=/dev/dsp1 -ovc
lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o webcam.avi



More Info on Above:


Type 'man mencoder' for more info on the audio options.
/dev/dsp1 refers to the webcam USB Audio device.
/dev/dsp refers to the sound card.


Email Setup with Postfix, Dovecot & MySQL:
<a href="http://www.dawgland.com/wiki/Postfix_Dovecot_MySQL_HowTo.html">Local</a>

Change Time Zone on OS Using Command Line:
cp /usr/share/zoneinfo/Zone_You_Want to /etc/localtime overwriting the exisisting /etc/localtime file. Reboot and you are done!
OR
Use the new timedatectl utility! As root, type timedatectl list-timezones to list available time zones to pick from Then, type timedatectl set-timezone TimeZone_You_Want.

Fedora Core 17 bootup error message saying can't load font file "True". Fix for this error message is here:

According to the bug report, it's an anaconda bug which can't be fixed on an installed system, so the fix is to manually change it yourself.
Just manually change True every place it is used as a font name in the following 3 files:

/boot/grub2/grub.cfg
/etc/sysconfig/i18n
/etc/default/grub

Typically it was latarcyrheb-sun16 on most systems.

You could use latarcyrheb-sun32 if you want a bigger font for boot messages and in console screens.
sysfont probably has a default font it uses if not specified, so you probably could do without the sysfont parameter without any problems.

Link to bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=799401

Linux System Configuration

Firewall Configuration & Information

Firewall Configuration
The easiest way to configure the firewall setup is to use the GUI within X-Windows.
This command can be run from an X-Windows terminal with the "/usr/bin/firewall-config" command.

Firewall Control
To Start & Stop the Firewall, use the new "systemctl" command instead of the old style "service" command, such as this:

[root@server ~]# systemctl stop firewalld.service


and

[root@server ~]# systemctl start firewalld.service