Samba and SELinux

If you want to add a share you must tag it with the samba selinux policy (man samba_selinux):

chcon -t samba_share_t /home/alon/shared_win/

Doing non free stuff

Like playing a dvd: http://www.fedorafaq.org/#yumconf (for libdvdcss installation, gstreamer bad/ugly codecs installation, mplayer)

proxy in yum.conf

yum install squid in proxy

in yum.conf

proxy=http://192.168.52.1:3128/

updating from rawhide to new release (branched release)

yum --releasever=15 --disablerepo=updates --enablerepo=updates-testing update --skip-broken -y

Better explanation (from the ML):

> i know somebody mentioned it before but it's not clear to me: how can i move
> from rawhide (f15) to f15 (and not to f16) and, how can i downgrade from
> rawhide (f16) to f15?

Download

fedora-release-15-0.7.noarch.rpm
fedora-release-rawhide-15-0.7.noarch.rpm

from ../updates/testing/15/.. and install them e.g. by excuting 'rpm
-U --force fedora-release-15-0.7.noarch.rpm
fedora-release-rawhide-15-0.7.noarch.rpm'.
If you have already installed some package with an fc16 tag, you have
to downgrade them individually to their fc15 counterpart or you leave
them as they are and wait for an F15 update with a higher version
number which will replace it. ~C

Building packages using bohdi

The first thing is to get the certificates right:

The certificates, there are a couple:

Updating an existing package:

GDM tweaks

set in /etc/gdm/custom.conf for automatic login

[daemon]
TimedLoginEnable=true
TimedLogin=you
TimedLoginDelay=0

Recovering from broken db

Re: yum update: Fatal error, run database recovery ??

Another error+recovery:

error: db4 error(22) from db->close: Invalid argument
error: db4 error(22) from dbenv->close: Invalid argument

fixed by

sudo yum clean all
sudo yum clean metadata
rpmdb --rebuilddb

(note: just rpmdb --rebuilddb is not enough, you'll get more of the same error(22)).

F15 (rawhide atm)

to update kernels, and in general to set options for yum:

Upgrading existing linux by dropping in initrd and vmlinuz

And then using network based installation media.

NOTE: this has already been applicatized: preupgrade does just this. But didn't work for me (broken system) for some reason..

(based off of http://fedorasolved.org/installation-solutions/installing-fedora-using-pxe-images)

Installing unsigned packages

--nogpgcheck

generally to say yes and nogpgcheck:

yum localinstall package.rpm -y --nogpgcheck

Kickstart and qemu

Creating a ks file: on installation completion one exists in /root/anaconda-ks.cfg You can create a floppy from it with this script (thanks uri!). To use:

{{{#!/bin/bash

if [ $# != 1 ]; then

fi

name=$1 ks=$name.ks floppy=$name.floppy d=$(mktemp -d /tmp/$name.d.XXXXXX)

qemu-img create -f raw $floppy 1440k > /dev/null mkfs.msdos -s 1 $floppy > /dev/null mount -o loop $floppy $d cp $ks $d/ks.cfg sync umount $d rmdir $d

echo "created $floppy" }}} Using ks: add to the kernel command line (press tab during grub):

ks=floppy

Other helpful hints:

upgrading to rawhide

2010-07-12 22:41:44

Transaction Summary
================================================================================
Install     144 Package(s)
Upgrade    1549 Package(s)
Remove        2 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Total download size: 2.5 G
Is this ok [y/N]: y

heh


the debian unstable of redhat (slackware - unbrazen?)

The full version is here. The short short version:

sudo yum install fedora-release-rawhide
sudo yum --disablerepo=* --enablerepo=rawhide update

Init process tweaks

This is actually upstart specific, so works equally well for ubuntu for instance.

/etc/inittab - contains only init level

Removing gettys:

Febootstrap

Tool (similar to debootstrap) for creating a root filesystem with fedora packages. Here is how to create a qemu image using febootstrap:

Easier method: have a single partition file, no need for strange offsetted loopback mounts.

qemu-img create -f raw F13_64.raw 10G
mkfs.ext4 F13_64.raw
sudo mount -o loop F13_64.raw t
sudo febootstrap fedora-13 t
sudo cp -R /lib/modules/
qemu.upstream -enable-kvm -kernel /boot/vmlinuz-2.6.33.5-112.fc13.x86_64 -initrd /boot/initramfs-2.6.33.5-112.fc13.x86_64.img -drive file=F13-64.raw -append "root=/dev/sda init=/bin/bash"

Now the rest of the instructions are from within the machine

mount -o remount,rw /
modprobe e1000
dhclient eth0
vi /etc/sysconfig/selinux # set to disabled
yum upgrade -y
yum install xorg-x11-server-devel

Method below is not working - need to set cylinders correctly (guest kernel refused to mount saying bad geometry - haven't tracked the kernel code yet)

qemu-img create -f raw F13_64.raw 10G
# can do the same with dd. It must be raw for the next steps. (can convert to qcow2 later)
fdisk F13_64.raw
# set cylinders to 64 from expert menu
# create a single partition (default type of 83, linux, is ok)
mount_image --loopback --partition 1 --target t --image F13_64.raw
# target doesn't do anything here.
# this is my util that just does a losetup with the correct offset that it gleans from fdisk -l
# basically it amounts to
# losetup -o 512 -f F13_64.raw
# which uses /dev/loop0 or the first available one (replace -f with something else to specify it)
mkfs.ext4 /dev/loop0
# or use whatever filesystem you wish
sudo losetup -d /dev/loop0
# you had to use sudo for losetup, for mkfs.ext4
mount_image --image F13_64.raw --partition 1 --target t
sudo febootstrap fedora-13 t
# takes a while

Repositories

Show all:

Find location of a specific package

yumdownloader --urls spice-client

various yum commands

If you get many 404's when trying to install, including very long hexadecimal checksum, try updating the cache: yum makecache

unpack rpm

rpm2cpio <rpm> | cpio -id

Upgrades

Fedora 12 To Fedora 13 test

Instructions - upgrading fedora using yum

Recovering from accidental upgrade

So you started from fc12 and accidentally upgraded to fc14, and now you want back. You decide to go back to fc13 alpha. How do you do it?

# Don't try this at home!!
sudo yum remove fedora-release-rawhide

Conclusions:

References:

Yum for Debian user

Yum FAQ https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/%20RedHatEnterpriseLinuxAndFedora ubuntu wiki on switching between ubuntu/RHEL and Fedora.

More Yum stuff

Running oprofile

Assorted Links

Kerberos

kinit username@DOMAIN_WITH_LARGE_CAPS

Anaconda

If you need to run anaconda for a failed installation, like I had when trying to dd a fedora netinst (13) to a usb dok and booting from it, then this may help:

anaconda -T --lang=en_US.UTF-8

Smart cards

packages required: gnupg2-smime (for scdaemon, gpg --card-status)

Paste Bins!

http://fpaste.org/

Converting between deb and rpm

use alien

Kernel building

To get the source rpm for the kernel:

http://fedoraproject.org/wiki/Docs/CustomKernel

Kernel from git


CategoryLinux

freelance writing jobs

Fedora (last edited 2011-06-10 15:03:22 by AlonLevy)