Saturday, October 13, 2007

Yum Configurations

How do I make YUM keep more than the default 2 kernels?

When you are updating your Fedora system via Yum and there is a kernel update involved, Yum will delete the oldest kernel on your system and keep the 2 newest. There are those who wish that this wasn't the default action. If you wish to keep more than the default 2 kernels, then open a terminal as root and type gedit /etc/yum.conf and under the [main] section add installonly_limit = N, where N is the number of kernels you wish to keep installed. Save and exit the editor.

IPW3945 Wireless

Fedora 7 with the IPW3945 Wireless Adapter
When I install Fedora 7 on my laptop it's usually very simple to get wireless working. Since support for the IPW3945 is built in to the kernel all I need to do is to go to System > Administration > Services and restart NetworkManager and NetworkManagerDispatch. An icon appears in the top panel. Clicking that icon reveals all available wireless networks. I select my network and away I go. However, many many people, myself included, have had trouble getting wireless working on their laptops, regardless of the model of adapter. On my Toshiba laptop, I had trouble until I found this post, Keeler1's Amazing Wireless Help on Fedora Forum. I followed his steps for getting the IPW3945 drivers and was up and running in no time. Check out the link or read below. With his blessings I've copied most of that post here.

Getting ipw3945 isnt as hard as you first think.

1. Unpack the tar archive I included. This archive contains three files necessary to run it plus a shell script to update ipw3945 after a kernel update. The order in which the shell script removes the packages is crucial.

2. Use rpm -g to group install the three ipw3945 files included in the archive

3. modprobe ipw3945

4. Try to configure a network device and activate it.

5. If it works, great, but it probably wont. Should get an error saying it cant Set the Bit Rate

6. Open /etc/sysconfig/network-scripts/ifcfg- (replace network device name here with the name that it says in netwok manager) and change the last line which should say something like RATE='0 kbs' to RATE=Auto

7. Save the file and try to activate the device again. It should work.

That said, here's what I did to follow along. Download the attached (to his post) tar.gz file and move it to /opt
mv /home/glenn/Desktop/ipw3945wireless.tar.gz /opt/
Change to the /opt folder
cd /opt
Unpack the archive
tar xfvz ipw3945wireless.tar.gz
This leaves 4 new files in the /opt folder
dkms-ipw3945-1.2.0-1.noarch.rpm
ipw3945d-1.7.22-4.i386.rpm
ipw3945-firmware-1.13-1.noarch.rpm
update-3945

Before you proceed make sure you have the packages DKMS and GCC installed with this command
rpm -q dkms gcc
If they are not installed then install them like this
yum -y install dkms gcc
When that's done you can move forward with the wireless install. You are going to install the extracted packages with rpm's group install. Issue these commands.
rpm -i -g dkms-ipw3945*.rpm ipw3945-firmware*.rpm ipw3945d*.rpm
Then
modprobe ipw3945
Now try to configure a network device. At this point my wireless came to life. I was able to connect to my wireless router and the internet.

Install Fedora 7 to USB Stick

I installed Fedora 7 Live to my 4GB Sandisk Cruzer Micro USB stick. It was incredibly easy. First order of business was to backup my files on the stick, which really meant that I copied all of the files to a super secret location. Turns out that this wasn't necessary since when I was done with the install all of the files were still there. For the installation I followed the instructions at the [http://fedoraproject.org/wiki/FedoraLiveCD/USBHowTo Fedora Wiki]. The only steps I needed to execute were, in this order,
df -h
which showed my USB stick as /dev/sdb1,
rpm -q livecd-tools
which showed the livecd-tools was not installed, so I installed them with
su -c 'yum install livecd-tools'
I had already downloaded the Live iso file some time ago. It resided on a network folder so I copied it to my home folder making it more readily available for use. Then, in a terminal as root I issued the command
livecd-iso-to-disk Fedora-7-Live-i686.iso /dev/sdb1
and saw the following output
Copying live image to USB stick
Updating boot config file
Installing boot loader
USB stick set up as live image!

That's all I needed to do. There were no issues with the USB partition being not bootable and I didn't format the USB stick before installing the live ISO. The next step for me was simply to reboot and choose the USB stick as boot media. Fedora 7 booted like a champ.

Pysol

Back when we were using Fedora Core 4 or so I played a card game called Pysol. Liked it a lot, but as time passed and Fedora was updated, so was Python. As of Python 2.5 Pysol would no longer work. Or so it seemed. A user at http://www.fedoraforum.org posted to a thread that I was following stating that he had the game working. I followed his lead and got Pysol working for me too. Here's what to do.

Assuming the link is still good, download Pysol from www.fedoraforum.orgpysol-4.82.1-5.1.noarch.rpm The file should save to your desktop. To install, open a terminal and type
sudo rpm -Uh /home/yourusername/Desktop/pysol-4.82.1-5.1.noarch
This installs Pysol in ''/usr/share/games/pysol''. Now you need to make an alias in your '''.bashrc''' file in your home directory. To do that, in a termial, as your regular user, type
gedit .bashrc
Add this line,
pysol='python /usr/share/games/pysol/pysol.py'
to the bottom of the file, save and exit. Run the game as root the first time. Quoting the member who posted the fix, "run as root first time to ensure the .pyc modules are created correctly." For me, the game still wouldn't work. I tried everything that my particular level of Linux experience would allow me to think of. I remember from the Fedora Core 4 / "Pysol was working" days that the game seemed to depend on '''TCL''' and '''tk''', so I installed both of them,
yum install tcl tk
but that didn't help. They both installed OK but nothing changed. The game still would not work. No matter what I tried Pysol refused to run. After several attempts I got some error output that hinted that Pysol needed tkinter to function. Off to the terminal again
yum install tkinter
This time I met with success. The installation of tkinter was exactly what I needed to get the game working. From a terminal, launch Pysol with this command
python /usr/share/games/pysol/pysol.py &
The game finally worked, so it was time to make a desktop launcher so I don't have to open a terminal and remember what the command was. To do that, right click the desktop and select '''create launcher'''. In the ensuing dialog box enter the name of the game, '''Pysol''', and the command to launch the game, '''python /usr/share/games/pysol/pysol.py &'''.

[[Image:screenshot-create launcher.png]]

I also went to the trouble of getting the correct icon to display, but that isn't so straight forward. You can click the icon button in the launcher dialog but you probably won't be able to select the pysol icon. What I did was to just save the launcher without an icon, then right click the launcher and select '''properties'''. There you can click the icon button and make your way to '''/usr/share/games/pysol'''. There you can select the pysol icon and close the properties dialog. You will now have the lovely '''club''' icon for the game. Good luck.

Printer Setup

=====Printer Setup=====
I have an Epson Stylus C88+ printer attached to a networked Windows XP computer. These are the steps I take to install this printer under Fedora 7.
On the top panel select System > Administration > Printing. You will see the Printer Configuration screen.

[[Image:screenshot-printer1a.png]]

Click the '''New Printer''' icon and you see the '''New Printer''' dialog.

[[Image:screenshot-newprinter.png]]

Enter a printer name, in my case '''Epson'''. Optionally you can enter a description and a location for the printer, but it's not necessary.

[[Image:screenshot-newprinter2.png]]

Click the '''forward''' icon. The next dialog is where you choose the connection type for your printer.

[[Image:screenshot-newprinter3.png]]

Since my printer is connected to a Windows XP box I select '''Windows Printer via SAMBA'''.

[[Image:screenshot-newprinter4.png]]

Now I should be able to click on the arrow that is next to the name of my workgroup, '''johnson''', but that never seems to work so I add the printer location info manually, in the box just above the workgroup name. I know that the printer is attached to a computer called '''shrek''' in the workgroup '''johnson''', and the printer is actually named '''epson88''', so here's what I add, folowing the example that is provided by the utility.
smb://johnson/shrek:631/epson88

[[Image:screenshot-newprinter6.png]]

Click the '''verify''' icon and you should see a confirmation dialog informing you that the printer share is available.

[[Image:screenshot-printer-verified.png]]

Click the '''forward''' icon and select you printer make from the list. I choose '''Epson''' of course and click the '''forward''' icon.

[[Image:screenshot-newprinter7.png]]

Select the printer model from the list. In my case, '''Stylus C88'''.

[[Image:screenshot-newprinter8.png]]

I leave the default printer driver as is and click the '''forward''' icon. The next dialog informs you that the system is going to create a new printer using the information that we entered. In my case, a new printer, '''Epson''', at '''smb://johnson/shrek/epson88'''.

[[Image:screenshot-newprinter9.png]]

Click the '''apply''' icon to create the new printer.

[[Image:screenshot-newprinter10.png]]

Now we're back at the original dialog, the one we saw when we first invoked the printing utility from the top panel. This time our new printer is shown as installed. Just a few more details and we're done. Simply set the printer as default by selecting the '''make default printer''' button and print a test page to make sure that our new printer is functioning as we expect it to.

Passphrase Required

=====Passphrase Required by Wireless Network=====
An annoyance that many Fedora users seem to encounter. Every time you boot your computer it tries to connect to your wireless network. It always asks for a passphrase but you
would like it to be seamless and not ask for a password. Here's what I did using info gathered from
[http://www.fedoraforum.org Fedora Forum].

First off, when setting up the pam_keyring, the user login password and the '"default-keyring"' name must be the same. Also you need to edit the '''/etc/pam.d/gdm''' and add a couple entries. Also, if you are using '''auto login''' the automating of the keyring will not work, as the password needs to be read from the login screen. To change your keyring password, open a terminal window and type:
/usr/libexec/pam-keyring-tool -c
Change the password to the same as your user login password and change your '''/etc/pam.d/gdm''' to look like this:
#%PAM-1.0
auth required pam_env.so
auth optional pam_keyring.so try_first_pass
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
session optional pam_keyinit.so force revoke
session include system-auth
session required pam_loginuid.so
session optional pam_console.so
session optional pam_keyring.so
Make sure you have '''pam_keyring''' and '''gnome-keyring''' installed.
yum install pam_keyring gnome-keyring
Using '''Nautilus''' or your favorite file browser open '''.gnome2/keyrings''' in your home folder. You may need to have your file browser show hidden files to see the '''.gnome2/keyrings''' folder. Delete the file '''default.keyring''' and reboot. When the system is up It should ask for the default keyring password, which should be the same as your user login password, and then ask for the key.

Opera Web Browser

=====Opera Web Browser=====
[[#Install|Install]]

[[#Java|Java]]

=====Install=====
I downloaded the Opera web browser from [http://www.opera.com/download/?platform=linux Opera's download page]. The file saves to my desktop. Since I install from my /opt folder the first order of business is to move the archive to that folder. Open a terminal and type
sudo mv /home/glenn/Desktop/opera-9.23-20070809.6-shared-qt.i386-en.tar.gz /opt/
Change to the /opt folder
cd /opt
and unpack the archive with this command
sudo tar xfvz opera-9.23-20070809.6-shared-qt.i386-en.tar.gz
This unpacks the files into their own folder beneath /opt, '''/opt/opera-9.23-20070809.6-shared-qt.i386-en-660'''. Change to that folder with the command
cd opera-9.23-20070809.6-shared-qt.i386-en-660/
and install Opera by typing
sudo sh install.sh
When the install script starts you see
Files will be installed as follows:
-----------------------------------------------------------
Wrapper Script : /usr/bin
Binaries : /usr/lib/opera/9.23-20070809.6
Plugins : /usr/lib/opera/plugins
Shared files : /usr/share/opera
Documentation : /usr/share/doc/opera
Manual page : /usr/share/man
-----------------------------------------------------------
Is this correct [ y,n,c | yes,no,cancel ] ?
Type '''yes''' and press enter. This brings you to the next prompt.
System wide configuration files:
/etc/opera6rc
/etc/opera6rc.fixed
would be ignored if installed with the prefix "/usr".
Do you want to install them in /etc [ y,n | yes,no ] ?
Type '''yes''' and press enter again. The installation is complete. There will now be a menu entry under Applications > Internet > Opera. I want a desktop shortcut, so I'm going to access Opera from the menu, right click the menu entry and select '''add this launcher to desktop'''. Done. I have successfully installed the latest Opera web browser and have created a nice desktop shortcut for it.
=====Java=====
Enabling Java in Opera for Linux

These instructions were last updated for Opera 9.1.

Opera uses the Java 2 Runtime Environment (JRE) directly, rather than through the use of a Web browser plug-in. Before proceeding, you may wish to test Java to see if Opera has been able to auto-detect your Java installation using our [http://opera.com/applets/clock/ test applet]. If Opera does not show this applet (an animated analog clock), you can try adding the correct Java path for your system in Opera's preferences:
Go to Tools > Preferences > Advanced > Content.
Click the "Java options" button. If this button is dimmed, first check the "Enable Java" option.
Click the "Choose" button for the "Java path" field.
Navigate to the Java directory and click "OK". The path you are looking for is the directory of your Java installation containing the files libjava.so and libawt.so. On the command line, type: find / -name libjava.so 2> /dev/null
For example, on a Debian system, the path is: /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386
Click the "Validate Java path" button. If you get an error message, try again with a different path.
Click "OK" to save your changes and exit the Java dialog.
Click "OK" to save your changes and exit the Preferences dialog.

Nautilus

=====Nautilus Oddities=====
Or, how can I get Nautilus to do this or that?


Open a .txt file for viewing by clicking on the file.

Open Nautilus and select Edit > Preferences and click the '''behaviour''' tab. Under the heading '''Executable Text Files''' select view executable text files when they are clicked. Now any time you click on a text file it will be displayed in the text editor.

Multimedia Codecs

=====MultiMedia Codecs=====
cd /tmp
wget http://www1.mplayerhq.hu/MPlayer/releases/codecs/all-20061022.tar.bz2
tar -jxvf all-20061022.tar.bz2
su -c 'mkdir -p /usr/local/lib/codecs'
su -c 'cp all-20061022/* /usr/local/lib/codecs'
rm -rf /tmp/all-20061022*

=====Optional Step=====
This step is not required. There are some other applications that may need these codecs.
su -c 'ln -sf /usr/local/lib/codecs /usr/lib/codecs && ln -sf /usr/local/lib/codecs /usr/local/lib/win32 && ln -sf /usr/local/lib/codecs /usr/lib/win32'

Mounting Partitions

===Mounting Other Partitions===
=====EXT3, FAT32 and NTFS=====
[[#NTFS|NTFS]]

[[#FAT32|FAT32]]

[[#EXT3|EXT3]]


===NTFS===
Mounting NTFS Partitions in Fedora 7

Fedora 7 ships with NTFS-3g. Quoting from the NTFS-3G web site [http://www.ntfs-3g.org NTFS-3G]
The NTFS-3G driver is an open source, freely available read/write NTFS driver for Linux, FreeBSD, Mac OS X, NetBSD, and Haiku. It provides safe and fast handling of the
Windows XP, Windows Server 2003, Windows 2000 and Windows Vista file systems. Most POSIX file system operations are supported, with the exception of full file
ownership and access right support.
To mount your NTFS partitions you need to
a. know what partitions you want to use
b. create a place to mount them to
c. mount them manually
d. mount them automatically
We'll start by listing the partitions on my laptop hard disk, a 160GB SATA with 4 partitions. Open a terminal as root and type
fdisk -l /dev/sda
Here's the output I get. Your's will be different.
[root@toshiba /]# fdisk -l /dev/sda
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 192 1536000 27 Unknown
/dev/sda2 * 192 16586 131684352 7 HPFS/NTFS
/dev/sda3 16587 19457 23061307+ 5 Extended
/dev/sda5 16587 17891 10482381 83 Linux
/dev/sda6 17892 19196 10482381 83 Linux
/dev/sda7 19197 19457 2096451 82 Linux swap / Solaris
As I stated, I have 4 partitions on this disk. /dev/sda1 is the Toshiba Recovery partition, /dev/sda2 is the Windows Vista partition, /dev/sda5 holds my Debian install, /dev/sda6 holds my Fedora 7 install and /dev/sda7 is the swap partition shared by Fedora and Debian. The one I'm after is the NTFS partition, /dev/sda2. Now that I know what partition is my Windows partition I need to go ahead and create a '''mount point''' for it. This will be where I mount the partition '''to'''. In the terminal, as root, type
mkdir /media/windows (you don't have to use ''windows'', you can call it anything you like)
So far we've determined what partition is the NTFS / Windows partition and created a '''mount point'''. Now all we need to do is to go ahead and mount it. In the terminal, as root, type
mount -t ntfs-3g /dev/sda2 /media/windows
Loosely translated, that's telling the file system to mount the partition /dev/sda3 to the folder /media/windows using the NTFS drivers. If there are no error messages, as there shouldn't be, you can open Nautlius and browse to the /media/windows folder and you should see all of your Windows files. To make the partition mount at boot time we need to add a line to the /etc/fstab file. In the terminal as root type
gedit /etc/fstab
Add a line at the bottom of the file
/dev/sda2 /media/windows ntfs-3g defaults 0 0
Save the file and close the editor. Your partition will now mount automatically at boot time.

=====FAT32=====
Mounting FAT32 Partitions

To mount a FAT32 partition, we follow the same steps that we used for the NTFS partitions. The difference here is the use of VFAT for mounting instead of NTFS-3G. If my NTFS partition, /dev/sda2, was FAT32 this is how we would set it up. Open a terminal as root and create a '''mount point'''.
mkdir /media/windows
Mount the partition.
mount -t vfat /dev/sda2 /media/windows
That's all there is to it. Using Nautilus you should be able to browse to /media/windows and see all of your files. To make the partition mount at boot time we need to add a line to the /etc/fstab file. In the terminal as root type
gedit /etc/fstab
Add a line at the bottom of the file
/dev/sda2 /media/windows vfat defaults 0 0
Save the file and close the editor. Your partition will now mount automatically at boot time.

=====EXT3=====
Mounting EXT3 Partitions

To mount an EXT3 partition, we follow the same steps that we used for the NTFS partitions. The difference here is the use of EXT3 for mounting instead of NTFS-3G. Using the Debian partition, /dev/sda5 as an example, here's how we would mount it. Open a terminal as root and create a '''mount point'''.
mkdir /media/debian
Mount the partition.
mount -t ext3 /dev/sda5 /media/debian
That's all there is to it. Using Nautilus you should be able to browse to /media/debian and see all of your files. To make the partition mount at boot time we need to add a line to the /etc/fstab file. In the terminal as root type
gedit /etc/fstab
Add a line at the bottom of the file
/dev/sda5 /media/debian ext3 defaults 0 0
Save the file and close the editor. Your partition will now mount automatically at boot time.

Return to [[Fedora 7]]