Contents
- Samba and SELinux
- Doing non free stuff
- proxy in yum.conf
- updating from rawhide to new release (branched release)
- Building packages using bohdi
- GDM tweaks
- Recovering from broken db
- F15 (rawhide atm)
- Upgrading existing linux by dropping in initrd and vmlinuz
- Installing unsigned packages
- Kickstart and qemu
- upgrading to rawhide
- Init process tweaks
- Febootstrap
- Repositories
- Find location of a specific package
- various yum commands
- unpack rpm
- Upgrades
- Yum for Debian user
- More Yum stuff
- Running oprofile
- Assorted Links
- Kerberos
- Anaconda
- Smart cards
- Paste Bins!
- Converting between deb and rpm
- Kernel building
- Kernel from git
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:
- ~/.fedora.cert - this is where you should put your certificate generated by admin.fedoraproject.org (the app actually generating it is "FAS - The Open Account System")
- there is also a certificate generated by fedora-packages-setup, which you need to install into firefox (instructions above).
Updating an existing package:
- fedpkg new-sources the_new_tar_bz2_file_or_whatever_you_referenced_in_your_spec
- To request a build (this will complain if it can't log in)
- fedpkg -v -u alon build
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 ??
rm -f /var/lib/rpm/db*
- possibly too:
- yum clean all
- yum update
- rpmdb --rebuild
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:
- --setopt=protected_multilib=false
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)
http://mirror.isoc.org.il/pub/fedora/releases/14/Fedora/x86_64/os/images/pxeboot/
- get both
- add to grub.conf
- reboot
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:
- create f14.ks file
- run: ./create_floppy f14 (no ks ending!)
- you get a f14.floppy file
- in qemu: add -fda f14.floppy
{{{#!/bin/bash
if [ $# != 1 ]; then
echo "usage: $0 <name>" echo ' where $name.ks is the kickstart file' echo ' and $name.floppy is the generated floppy img' exit 1
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:
- using text mode installation: append "text" to kernel command line or put text in the ks file (in a line).
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:
- set runlevel to 1 - didn't manage to run hald there
- changing meaning of runlevel 3: remove getty on tty1 - /etc/sysconfig/init, ACTIVE_CONSOLES
- remove gettys from runlevel 3 /etc/sysconfig/init and /etc/init/tty.conf and /etc/init/serial.conf
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:
- yum repolist all
- yum install --enablerepo=rawhide openswan
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?
- get the repos for fedora 13.
- fedora-release-13-0.6.noarch.rpm fedora-release-notes-12.0.2-1.fc12.noarch.rpm
- install them (rpm -ivh repofiles)
- yum update
- be incredibely stupid and remove the core fedora 14 package, thereby removing most of your system (including ssh, udev, initscripts)
# Don't try this at home!! sudo yum remove fedora-release-rawhide
- you are left with a husk, running system that if you reboot will die.
- start updating using groupupdate - but you get stuck, there is no groupdowngrade
- be clever, run the following dumb script:
for x in `yum list installed | grep fc14 | cut -d " " -f 1`; do yum downgrade -y $x; done
This is the right way to do it: yum list installed | grep fc14 | cut -d " " -f 1 | xargs yum downgrade -y
- yum is removed! (thereby stopping in the middle of that loop, right after probably degrading rpm which removed yum? not sure).
- try to install yum from rpms - go to the mirror list and start downloading rpms manually (like the good old days!)
- use rpm -ivh --test bumch_of_rpms first (real smart!)
- then install the newest rpm (cause yum wants it), 4.8 instead of the old 4.7
- you will get both versions on the system. This won't be a problem until you try to do something like "yum update", see later
- now you have an rpmdb that isn't good (it's at /var/lib/rpm).
- do not despare!
rm -f /var/lib/db*
rpm --rebuilddb
it's fine now.
yum groupupdate base
yum grouplist
yum groupinstall "X Software Development"
now remove the old rpm (4.7) using the "remove a specific version of a package" syntax: * yum remove rpm-4.7.2-1.fc12
still have duplicates (packages that are the same exact version but with .fc14 instead of .fc13).
- permanent solution: chkconfig --levels 3 nscd on; chkconfig --levels 1 nscd on
Conclusions:
we need a yum groupdowngrade! References:
Packages (warning: long load) for fc13 x86_64 Yum for Debian user
Yum FAQ https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/%20RedHatEnterpriseLinuxAndFedora ubuntu wiki on switching between ubuntu/RHEL and Fedora.
apt builddep -> yum-builddep (from package X)
doesn't always work - tried yum-builddep iputils, didn't pull in required idn-devel
To get the source rpm for the kernel:
More Yum stuff
yum history Running oprofile
Assorted Links
Professor Kriehn's fedora page includes administrators guide and old comparison with ubuntu. 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
yumdownloader --source kernel http://fedoraproject.org/wiki/Docs/CustomKernel Kernel from git
command: make rpm (spec file is already in the repository)
- sudo vim /boot/grub/menu.lst