Ask Your Question
2

Create Fedora script for installing software

asked 2015-01-02 07:37:00 -0500

kewkie gravatar image

Hey guys,

I recently switch from arch to Fedora and i found a script for arch which i want to write for Fedora, its this one here:

https://gist.github.com/julionc/4162347

So, if i change pacman > yum and the software i want to install, will this work?

Do i need to add some kind of "wait" in order to get it working properly?

So i mean:

yum -y install PKGNAME

[wait]

yum -y install NEXT PKGNAME

and so on.

Or do i dont need to add a "wait" and yum will install the next package after the first is done?

yum -y install PKGNAME

yum -y install NEXTPKGNAME

and so on?

Hope you know what i mean :)

Thanks guys.

edit retag flag offensive close merge delete

Comments

? similar scripts exist in Fedora, read here

davidva gravatar imagedavidva ( 2015-01-03 20:38:05 -0500 )edit

4 Answers

Sort by ยป oldest newest most voted
1

answered 2015-01-04 12:13:52 -0500

fast_rizwaan gravatar image

Yum will install next package, no need to add wait; you can combine pkg1 pk2 as yum -y install pkg1 pkg2 pkg3 as well.

edit flag offensive delete link more

Comments

This answer was already provided. Why provide the same information again? If you agree, please use the vote up function instead of being redundant.

randomuser gravatar imagerandomuser ( 2015-01-04 14:49:37 -0500 )edit
1

answered 2015-01-03 15:21:24 -0500

I'm not sure what software you're attempting to install, but generally yum won't require that you iterate through packages in that manner. Further, if you install a package which is constructed to properly designate its dependencies, and those dependencies are available to your system through your various repositories, yum will install them automatically. I've never personally had to direct yum to install packages in a particular order, and I would be suspicious of any software which required such a process.

Some more details about what you're attempting to accomplish would help me to better guide you, but simply executing yum install -y PKGNAME NEXTPKGNAME NEXTNEXTPKGNAME and so on will instruct yum to install the packages listed.

edit flag offensive delete link more

Comments

1

yum install $(cat packagelist.file) works too :)

randomuser gravatar imagerandomuser ( 2015-01-03 16:13:34 -0500 )edit

But of course, assuming you have your packages nicely listed in a file. Not everyone is as well-prepared as you, randomuser. =)

bitwiseoperator gravatar imagebitwiseoperator ( 2015-01-03 16:30:07 -0500 )edit
0

answered 2015-01-04 19:10:25 -0500

Creuzo gravatar image

There are several packages that are provided by distinct repositories. So, using Fedora as my primary OS for almost a year, I have written this script to install the software I like when I reinstall my workstation. Depending on what I want, I comment/uncomment some sections or add new packages. I commented Intel graphics because it did not have yet a version for Fedora 21 and Gnome15 site is also offline, so I also commented that line. If you uncomment the virtualization preview repository, you will get the most current packages (latest builds) for virtualization. You can use parts of the script below or use it as example:

#!/bin/bash
####################
# Add Repositories #
####################

# Intel Graphics
#wget --no-check-certificate https://download.01.org/gfx/RPM-GPG-KEY-ilg ; \
#rpm --import RPM-GPG-KEY-ilg
#wget --no-check-certificate https://download.01.org/gfx/RPM-GPG-KEY-ilg-2 ; \
#sudo rpm --import RPM-GPG-KEY-ilg-2

#echo -n "Do you want to install Intel Graphics 1.0.6 [Y/N]? "
#read ANSWER
#ANSWER=${ANSWER^^}
#if [ x"$ANSWER" == x"Y" ]; then 
#    yum install https://download.01.org/gfx/fedora/20/x86_64/intel-linux-graphics-installer-1.0.6-20.intel20142.x86_64.rpm -y
#fi

# Virtualization preview
#cd /etc/yum.repos.d/
#wget http://fedorapeople.org/groups/virt/virt-preview/fedora-virt-preview.repo
#yum update
#cd -

# Fusion Repo
yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y

#Gnome15 repo (support for G510 keyboard)
#rpm --import http://packages.russo79.com/fedora/20/gnome15/repodata/repomd.xml.key
#curl -o /etc/yum.repos.d/gnome15.repo http://packages.russo79.com/fedora/20/gnome15/gnome15.repo

# Google Repo
echo [google-chrome] > /etc/yum.repos.d/google-chrome.repo
echo name=google-chrome >> /etc/yum.repos.d/google-chrome.repo
echo baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64 >> /etc/yum.repos.d/google-chrome.repo
echo enabled=1 >> /etc/yum.repos.d/google-chrome.repo
echo gpgcheck=1 >> /etc/yum.repos.d/google-chrome.repo
echo gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub >> /etc/yum.repos.d/google-chrome.repo

# Adobe repo
yum install http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm -y
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

# Add repository for libdvdcss
rpm -ivh http://rpm.livna.org/livna-release.rpm

yum check-update

#################
# Update System #
#################

yum update -y

####################
# Install Packages #
####################

# KVM / Prereq VMWare / lshw / gtk-immodules /samba
yum install @virtualization libvirt gcc kernel-devel kernel-headers lshw-gui gtk2-immodule-xim.i686 gtk2-immodule-xim.x86_64 gtk2-immodules.i686 gtk2-immodules.x86_64 gtk3-immodule-xim.x86_64 gtk3-immodules.x86_64 openssh-askpass libguestfs libguestfs-tools.noarch -y
systemctl start libvirtd

# Poewer Managememt
yum install bltk powertop systemtap tuned-utils kernel-debuginfo -y

#Install Gnome15 packages
#yum install gnome15-core gnome15-driver-g15direct gnome15-gnome-shell gnome15-plugin-weather-yahoo gnome15-plugin-background  gnome15-plugin-cairo-clock gnome15-plugin-cal gnome15-plugin-cal-evolution gnome15-plugin-cal-google gnome15-plugin-clock gnome15-plugin-debug gnome15-plugin-fx gnome15-plugin-im gnome15-plugin-macro-recorder gnome15-plugin-macros gnome15-plugin-sense gnome15-plugin-sysmon gnome15-plugin-panel gnome15-plugin-notify-lcd gnome15-plugin-profiles gnome15-plugin-processes gnome15-plugin-tweak -y

# Install VLC / Google Chrome / Flash Plugin / Zim Notes / DConf / Keepass / TCPLAY (truecrypt) / i7z / gnucash /gtypist / icedtea
yum install vlc google-chrome-stable flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl Zim.noarch dconf-editor.x86_64 keepassx.x86_64 tcplay.x86_64 i7z.x86_64 gnucash libdbi-dbd-sqlite p7zip scrot gtypist icedtea-web -y

# CODECS
yum install gstreamer{1,}-{ffmpeg,libav,plugins-{good,ugly,bad{,-free ...
(more)
edit flag offensive delete link more
0

answered 2015-01-03 21:37:58 -0500

davidva gravatar image

updated 2015-01-04 10:04:58 -0500

Make a simple list about you want

example (called my_list):

binutils
gedit   
pidgin    
vlc  
xarchiver
https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

Next the powerfull script...

#!/usr/bin/env bash

echo 'Installing Free and Nonfree Rpmfusion Repositories'
yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

echo 'Installing my list programs'

file=$HOME/my_list

while IFS= read -r line; do
echo "installing $line" 
yum -y install $line
done <"$file"

I can make a best script; but you need learn or not? you come from Arch Linux no? It is unforgivable ask how to make a script.

edit flag offensive delete link more

Comments

Installing these packages one at a time is just as absurd...

randomuser gravatar imagerandomuser ( 2015-01-04 01:40:04 -0500 )edit

@randomuser; The user came from Arch Linux; example if you install a package from AUR without any "AUR helper" exist a 60% possibility You will fail because some dependencies exist only into AUR. We can recreate the problem into Fedora if we install a unofficial rpm; and some dependencies doesn't exist into Fedora. The user want a automated script, isn't absurd. Thus was born my absurd project haha ;)

davidva gravatar imagedavidva ( 2015-01-04 02:10:38 -0500 )edit

Sure, installing the rpmfusion*release packages first makes sense. Installing one package by itself doesn't mean you have to do that for all :P

randomuser gravatar imagerandomuser ( 2015-01-04 14:52:42 -0500 )edit

@randomuser Not exactly; an example; try to install spotify. You will not solve completely dependencies with rpmfusion... I can write an extensive list with similar issues; but this is another story (off topic). I completely forgot into AUR you can't find precompiled packages (as fedora, example a rpm), is similar to a "src.rpm" a "AUR helper" will help you to install dependencies but also you can install all dependencies for yourself.

davidva gravatar imagedavidva ( 2015-01-04 23:10:20 -0500 )edit

Question Tools

Stats

Asked: 2015-01-02 07:37:00 -0500

Seen: 1,585 times

Last updated: Jan 04 '15