Archive pour la catégorie 'RPM and Yum'

Fedora8: use the installation DVD as a repositoy

Monday 19 November 2007

If you installed only a subset of the needed packages and want to use yum to complete your installation, you can set up a repo based on the DVD:

  1. copy from the root of the DVD the file media.repo to /etc/yum.repo.d:
  2. edit this file to add the baseurl and have this:

baseurl=file:///media/Fedora%208%20i386%20DVD

Which RPMs are requiring another one

Friday 21 September 2007

Try the small rpmwhatrequires.sh script.

Example use:

$ rpmwhatrequires.sh rpm

Gives:

man-1.6e-3.fc7
createrepo-0.4.10-1.fc7
rpmorphan-1.0-1.EL.fc7
rpm-libs-4.4.2.1-2.EL.fc7
rpm-build-4.4.2.1-2.EL.fc7
rpm-python-4.4.2.1-2.EL.fc7
yum-3.2.5-1.fc7

Check available RPM groups on Fedora

Friday 21 September 2007

Time to write new posts…. I’ve not added anything since too long …

Now the easy answer… If you’re creating your own RPMs (like I do), you sometimes wonder what RPM groups are available. The answer is easy, check in the rpm doc directory:
cat /usr/share/doc/rpm-*/GROUPS
It should give you something like this:

Amusements/Games
Amusements/Graphics
Applications/Archiving
Applications/Communications
Applications/Databases
Applications/Editors
Applications/Emulators
Applications/Engineering
Applications/File
Applications/Internet
Applications/Multimedia
Applications/Productivity
Applications/Publishing
Applications/System
Applications/Text
Development/Debuggers
Development/Languages
Development/Libraries
Development/System
Development/Tools
Documentation
System Environment/Base
System Environment/Daemons
System Environment/Kernel
System Environment/Libraries
System Environment/Shells
User Interface/Desktops
User Interface/X
User Interface/X Hardware Support

rpm install/uninstall scripts [FR]

Wednesday 15 November 2006
  • %pre : Ce script s’exécute juste avant l’installation du paquetage sur le système.
  • %post : Ce script s’exécute juste après l’installation du paquetage sur le système.
  • %preun : Ce script s’exécute juste avant la désinstallation du paquetage sur le système.
  • %postun : Ce script s’exécute juste après la désinstallation du paquetage sur le système.

Valeurs des paramètres passés aux scripts pre et post
=====================================================

Paramètre Script         %pre     %post    %preun     %postun
Première installation      1          1       N/C         N/C
Mise à jour                2          2        1           1
Désinstallation           N/C        N/C       0           0

Cela permettra au programmeur de prévoir des comportements différents à ses scripts selon qu’il s’agisse d’une installation ou d’une mise à jour.

  • Pour des scripts d’installation (%post, %pre) si $1 == "1" alors il s’agit d’une installation fraîche.
  • Pour des scripts de désinstallation (%postun, %preun), si $1 == "0", alors il s’agit d’une désinstallation complète, sinon il s’agit soit d’une mise à jour soit d’une installation avec ––force du même paquet.

Pour tester cette situation, la déclaration suivant est utilisée:

%postun
if [ $1 = 0 ]; then
// Do stuff specific to uninstalls
fi
if [ $1 = 1 ]; then
// Do stuff specific to upgrades
fi

Get the list of available packages

Tuesday 14 November 2006

If, as me, you created your yum repo directory as explained in The Unofficial Fedora FAQ (btw it is still missing for Fedora Core 6), you can use this simple command to get the list of available RPM packages on all repositories :

yum --noplugins --enablerepo=rpmfarm --enablerepo=livna --enablerepo=flash --enablerepo=kde-redhat --enablerepo=atrpms --enablerepo=freshrpms list all > yumlist-fc6.txt

rpm building as a normal user

Tuesday 14 November 2006

As a RPM should never be build as root, you can follow those simple steps to setup a build environment for a normal user:

  • Install rpmdevtools;
  • Launch rpmdev-setuptree;
  • This will create the following directories in $HOME:
    ~/rpmbuild/
    |-- BUILD
    |-- RPMS
    |-- SOURCES
    |-- SPECS
    `-- SRPMS
  • and setup your ~/.rpmmacros file.
  • then you can add you stuff in this file, for example for getting rid of the debuginfo package and signing your builds (see the links page for this):
    %debug_package %{nil}
    
    %_signature gpg
    %_gpg_name  Eric Lassauge
  • As an other example, here is my typical build script for building from a spec file and tarball:
    #!/bin/sh
    disttag=".EL"
    repotag=".fc6"
    
    rpmbuild --sign --clean --target=i686 -ba --define "disttag ${disttag}" --define "repotag ${repotag}" $*

Setting a local repository for yum

Thursday 9 November 2006

Here is the content of my farm.repo file (in /etc/yum.repos.d/) on my development machine (compare it with the file provided in http://rpmfarm.free.fr/configuration.html):

[rpmfarm]
name=RPMfarm  for Fedora Core $releasever - $basearch - Base
baseurl=
file:///var/personal/Fedora/YUM/$releasever/$basearch/RPMS.farm/
http://rpmfarm.free.fr/$releasever/$basearch/RPMS.farm/
enabled=1
protect=yes
failovermethod=priority

[rpmfarm-source]
name=RPMfarm for Fedora Core $releasever - $basearch - Source
baseurl=
file:///var/personal/Fedora/YUM/$releasever/$basearch/SRPMS.farm/
http://rpmfarm.free.fr/$releasever/$basearch/SRPMS.farm/
failovermethod=priority
enabled=0

Restore file owner and permissions using rpmdb

Thursday 9 November 2006

This was used after an ugly changes in the file tree due to the use of the ext2 driver from Windows XP on a dual boot machine: it changes the users and permissions on a lot of files:

rpm -q --queryformat '[%{FILENAMES} %{FILEUSERNAME} %{FILEGROUPNAME} %{FILEMODES:perms}\n]' package_name

The ouput can then be post-processed to restore owner and rights. Example output for gdm:

# File_name User Group Permissions
/usr/share/pixmaps/nohost.png root root -rw-r--r--
/var/gdm root gdm drwxrwx--T
/var/log/gdm root root drwxr-xr-x

The example script based on this can be found here : check_files.sh

The infos from an RPM file, as from the spec file

Thursday 9 November 2006

rpm -q --info -p package_file.i686.rpm

List of installed RPM by date (from the FC6 release notes)

Thursday 9 November 2006

rpm -qa --last > RPMS_by_Install_Time.txt