msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

30 Nov 2007 Upgrade from Fedora Core 7 to Core 8

This is the steps I took to upgrade a running Fedora Core 7 installation to Core 8 using yum from the command line. Please note that live upgrades are not recommended by the Fedora Project.

Make a list of the systems current packages for later reference:

rpm -qa --qf '%{NAME}\n' | sort | uniq > ~/new-pkgnames.txt

Make a backup of any system configuration data (as root):

tar czf ~/etc-`date +%F`.tar.gz /etc


yum clean all

Make sure the new repo files isn’t placed as .rpmnew files, perhaps by

mv /etc/yum.repos.d/fedora-updates.repo.rpmnew /etc/yum.repos.d/fedora-updates.repo
mv /etc/yum.repos.d/fedora.repo.rpmnew /etc/yum.repos.d/fedora.repo

Also make sure that all the 3rd party repos you normally use point to the repository for the new Fedora release.

Next the upgrade.
Make sure you are in runlevel 3

telinit 3

Run the following command to update the yum repo on your box:

rpm -Uhv rpm -Uvh rpm -Uvh http://mirror.anl.gov/pub/fedora/linux/releases/8/Everything/i386/os/Packages/fedora-release-8-3.noarch.rpm http://mirror.anl.gov/pub/fedora/linux/releases/8/Everything/i386/os/Packages/fedora-release-notes-8.0.0-3.noarch.rpm

yum might complain about conflicts or requirements. That is probably because you have used non-standard repositories or installed non-standard packages manually. Try to guess which packages cause the problem (or at least is a part of the dependency chain) – uninstall them and try again. Remember to install the packages again if they are essential.

Tip: Find and review “lost” packages.
You can find orphaned packages (ie packages not in the repositories anymore) after the upgrade with the tool package-cleanup from the yum-utils package

yum install yum-utils; package-cleanup --orphans

It’s often helpful to run this command before the update, too. For packages with a failing “%postun” script the old package will remain partly installed. Remove it with

rpm -e package-name-and-version

If you forget to remove the avahi package it will refuse to be removed from the system with a error message “error: %postun(avahi-0.6.17-1.fc7.i386) scriptlet failed, exit status 1”. I haven’t looked up this error message any further.

I had to clean yum to make it aware of the recent package change, this might not be necessary.

yum clean all
yum upgrade

Ensure that all (new) essential packages from the new version is installed with

yum groupupdate Base

You might want to update other groups too, see

yum grouplist

The system had to upgrade 937 packages before fedora Core 7 is a fedora Core 8 installation.

After the upgrade has finished a reboot is required and it was time to check for orphaned packages

package-cleanup --orphans

The command for removing these packages is described earlier.

Source: http://docs.fedoraproject.org/install-guide/f8/en_US/sn-upgrade-tree.html, http://www.ioncannon.net/system-administration/133/upgrading-from-fedora-7-to-fedora-8-with-yum/ and http://fedoraproject.org/wiki/YumUpgradeFaq

Tags: , , , , ,

Posted by

30 Nov 2007 Create virtual / alias IP address

This is the code to make an alias IP address on network interface ethX where X is a number to indicate the device we are attaching the IP.
ifconfig eth0:1 192.168.0.30 netmask 255.255.255.0 up
Your machine will now answer on ping requests 192.168.0.30.

You can see the result by running the command

ifconfig eth0:1

Result

eth0:1    Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:192.168.0.30  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:17 Base address:0x1080

To take down this alias use

ifup eth0:1 down

You might experience that the new device/address won’t answer network requests to the IP address after moving it. This happens because the arp cache on the router most likely haven’t discovered that the IP address is on a new MAC address. A solution to this problem is to clear the arp info on the router using the arprelease command

arprelease eth0:1 192.168.0.30

This command can be downloaded from http://sourceforge.net/projects/arprelease/ if it isn’t available on your linux distribution.

Tags: , , ,

Posted by

28 Nov 2007 Deny SSH- but allow SFTP access

This is an alternative way of limiting the SSH access to only SFTP explained in my How to restrict users to SFTP only instead of SSH post.Edit your /etc/sshd_config file and change your settings like thisMatch User usernameAllowTcpForwarding noX11Forwarding noForceCommand /usr/libexec/sftp-server -l INFO Replace username with the user name you would limit the SSH access for.

Tags: ,

Posted by

26 Nov 2007 Query RPM database/packages and list their architecture

If you use the –queryformat argument with rpm it is possible to query RPMs for different architectures installed# rpm -qa --queryformat %{NAME}-%{VERSION}-%{ARCH}\\n | grep dbus-glib | sortResultdbus-glib-0.22-12.EL.5-i386dbus-glib-0.22-12.EL.5-x86_64This can also be used in one of my previous posts: Remove duplicate packages when querying the rpm database.

Tags: , , ,

Posted by

26 Nov 2007 Convert videos to 3gp format

This bash script converts videos like AVI-files to the 3gp format used on newer cell phones like Nokia N95. To use it you should have the libamr_nb and libamr_nw flags available to ffmpeg.< /p>

ffmpeg -formats |grep amrFFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-static --enable-shared --cc=i686-pc-linux-gnu-gcc --disable-mmx --disable-altivec --disable-debug --disable-audio-oss --disable-dv1394 --disable-network --disable-ffplay --disable-opts --enable-libmp3lame --enable-libx264 --enable-libamr-nb --enable-libamr-wb --enable-gpl --enable-pp --disable-strip  libavutil version: 49.4.0  libavcodec version: 51.40.4  libavformat version: 51.12.1  built on Nov 26 2007 00:01:28, gcc: 4.1.2 (Gentoo 4.1.2) DE amr             3gpp amr file format DEA    libamr_nb DEA    libamr_wb

If you don’t see those flags this script won’t work.

#!/bin/bash# File : nokia-encode-3gp.sh script for Nkoia with screensize 128x96.# Usage : nokia-encode-3gp.sh filename.avi# Generates a .3gp file with same name as the .aviFILE=$1shiftrm -f "$FILE".3gpffmpeg -i "${FILE}" -f 3gp \        -vcodec h263 \        -qmin 3 \        -qmax 5 \        -b 120 \        -acodec libamr_nb \        -ar 8000 \        -ab 10.2k \        -ac 1 \        -s 128x96 \        "$FILE".3gp

This script can be modified to work on the Sony Ericsson k700i by changing -s to 176×144, its resolution.
You can download it here

Source: Genoo forums

Tags: , , , , , , ,

Posted by