#!/bin/sh # # This script will download and install apt for suse on your system. # # (c) Sebastien Corot, 2005 # version 0.1.2 # get suse version and system arch SUSE_VERSION=`grep VERSION /etc/SuSE-release|cut -f3 -d" "` SYSTEM=`uname -i` # wget options WGET_OPT="-nv --retr-symlinks" SITE_APT1=mirrors.mathematik.uni-bielefeld.de/pub/linux/suse/apt SITE_APT2=ftp.gwdg.de/pub/linux/suse/apt # now test if conditions for running this script are satisfied # First test if running system is supported if [ $SYSTEM != "i386" ] && [ $SYSTEM != "x86_64" ]; then echo "$SYSTEM arch is no supported by apt for suse" exit 0 fi # are you logged as root test $UID != 0 && { echo "You have to be root to install apt on your system." echo "Please log as root with su command before running this script." exit 0 } # is apt already installed ? if test -e /usr/bin/apt-get; then echo "apt is already installed on you system." echo "Exiting now." exit 0 fi # test if wget is installed WGET_INSTALLED=0 if test -e /usr/bin/wget; then WGET_INSTALLED=1; fi if [ $WGET_INSTALLED = 0 ]; then echo "wget is needed by this script." echo "Install wget with YaST before using this script." echo "Exiting now." exit 0 fi # set current directory as working directory cd ./ # remove allready downloaded apt packages in current directory # to be sure the lastest are used for i in $i apt-*.rpm do if test -e $i; then echo "$i package allready present in current dir. Remove it..." rm $i fi done # Download apt and apt-libs packages corresponding to running system echo "Setup apt for SuSE Linux $SUSE_VERSION on $SYSTEM..." echo "" echo "Downloading apt and apt-libs packages..." if [ "$SYSTEM" = "i386" ]; then wget $WGET_OPT ftp://$SITE_APT1/SuSE/$SUSE_VERSION-$SYSTEM/RPMS.suser-rbos/apt-0.* wget $WGET_OPT ftp://$SITE_APT1/SuSE/$SUSE_VERSION-$SYSTEM/RPMS.suser-rbos/apt-libs-0.* else if [ "$SYSTEM" = "x86_64" ]; then wget $WGET_OPT ftp://$SITE_APT2/SuSE/$SUSE_VERSION-$SYSTEM/RPMS.suser-jmorris/apt-0.* wget $WGET_OPT ftp://$SITE_APT2/SuSE/$SUSE_VERSION-$SYSTEM/RPMS.suser-jmorris/apt-libs-0.* fi fi echo "" echo "Done." # install the downloaded packages rpm -Uvh $(pwd)/apt-* # Test if the packages are correctly installed ! ( rpm -q apt-libs ) && echo "Package apt-libs is not installed" && exit 0 ! ( rpm -q apt ) && echo "Package apt is not installed" && exit 0 # Create a new sources.list file with comments mv /etc/apt/sources.list /etc/apt/sources.list.default if [ "$SYSTEM" = "i386" ]; then cat > /etc/apt/sources.list << EOF # sources.list file created by $0 script. # This file gives you a descent and "safe" sources.list with selected components # which should not break your system. # The complete list with all available components can be found at: # http://linux01.gwdg.de/apt4rpm # BE CAREFULL: Some components provide experimental software, SELECT WISELY !!! # http://$SITE_APT2/SuSE/$SUSE_VESRION-$SYSTEM/examples/sources.list.FTP # base, update and security components provide official SuSE updates rpm ftp://$SITE_APT1 SuSE/$SUSE_VERSION-$SYSTEM base rpm ftp://$SITE_APT1 SuSE/$SUSE_VERSION-$SYSTEM update rpm ftp://$SITE_APT1 SuSE/$SUSE_VERSION-$SYSTEM security rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM base rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM update rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM security # Non official update for wine drivers provided by SuSE employee rpm ftp://$SITE_APT1 SuSE/$SUSE_VERSION-$SYSTEM wine # Update for mozilla provided by SuSE but not OFFICIALY SUPPORTED !!! # However this component is safe as mozilla update should not break # clean system ! rpm ftp://$SITE_APT1 SuSE/$SUSE_VERSION-$SYSTEM mozilla # The GPG keys of the the packman, suser-*, funktronic, components rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM rpmkeys # packman provides multimedia packages for SuSE such as MPlayer or Xine. # Visit http://packman.links2linux.org/ for a list availabe rpms. # These packages are safe. rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM packman # Xmltv and freevo for i386 rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM funktronics # The SuSE users suser-* components generaly provides extra packages # that are not on the SuSE DVD or CDs. # These packages are safe as they don't update base system packages. # Provides update for apt and synaptic rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-rbos # Many Sound related softwares, see http://www.jacklab.net/index.php?lang=en_EN rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-oc2pus rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-tux # Some multimedia, games and emulators packages rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-scorot # Latest XFCE4 packages rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-ollakka # Various extra rpms with multimedia packages rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-tcousin rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-guru rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-jogley rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-gbv #rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-jengelh # Comment out the followig line for Mythtv packages (SuSE Linux 9.3 only) #rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-scrute EOF # sources.list for x86_64 because the components are not the same as i386 else if [ "$SYSTEM" = "x86_64" ]; then cat > /etc/apt/sources.list << EOF # sources.list file created by $0 script. # This file gives you a descent sources.list with selected components # wich should not break your system. # The list with all available components can be found at: # http://linux01.gwdg.de/apt4rpm # BE CAREFULL: Some components provide experimental software, SELECT WISELY !!! # http://$SITE_APT2/SuSE/$SUSE_VESRION-$SYSTEM/examples/sources.list.FTP # base, update and security components provide official SuSE updates rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM base rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM update rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM security # Non official update for wine drivers provided by SuSE employee #rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM wine # Update for mozilla provided by SuSE but not OFFICIALY SUPPORTED !!! # However this component is safe as mozilla update should not break # clean system ! rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM mozilla # The GPG keys of the the packman, suser-*, funktronic, components rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM rpmkeys # packman provides multimedia packages for SuSE such as MPlayer or Xine. # Visit http://packman.links2linux.org/ for a list availabe rpms. # These packages are safe. rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM packman # The SuSE users suser-* components generaly provides extra packages # that are not on the SuSE DVD or CDs. # These packages are safe as they don't update base system packages. # Some multimedia packages, games, emulators, # and apt packages rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-scorot rpm ftp://$SITE_APT2 SuSE/$SUSE_VERSION-$SYSTEM suser-jmorris EOF fi fi # Now download and install rpmkey apt --yes --sources sources.list update echo "Downloading rpmkey files..." apt --yes --no-checksig --no-post install rpmkey* echo "GPG key files installed." echo "" echo "apt is now ready to use." echo "I have installed a safe and descent sources.list, thus you don't need" echo "to touch anything else. The previous sources.list file has been" echo "saved as sources.list.default." echo "See http://linux01.gwdg.de/apt4rpm/ for more informations." echo "" exit 0