Purchase Linux CDs / DVDs / Flash Drives at OSDisc.com

Welcome to Our Community

While Linux.org has been around for a while, we recently changed management and had to purge most of the content (including users). If you signed up before April 23rd please sign up again. Thanks!

  1. Kennedy Projects is proud to maintain and host Linux.org. Please contact us for any Linux or hosting related services if you find yourself in a jam. - Rob / KennedyProjects.com
    Dismiss Notice

Making a Switch

Discussion in 'Fedora' started by mrcrossroads, Nov 23, 2017.

  1. mrcrossroads

    mrcrossroads Silver Member
    Silver Supporter

    Joined:
    Nov 23, 2017
    Messages:
    23
    Likes Received:
    25
    I've been an avid Mint user for at least the past 3 years, and still love the distro and would still definitely recommend it to new users. Or to anyone I suppose. But having been running Fedora 27 one one of my laptops and on a laptop at work in a VM, I am ready to make the switch to it on my primary machine.

    I created a text file with a command to install a dozen or so programs I want on any fresh install. I'd like to turn it into a script so that's the next thing I need to learn.



    So far it seems like dnf is easier to use than apt. Less verbiage. At least what I've been using the cli for.
     
    wizardfromoz and atanere like this.
  2. atanere

    atanere Moderator
    Gold Supporter

    Joined:
    Apr 6, 2017
    Messages:
    550
    Likes Received:
    429
    That's what it's all about... freedom... deb/rpm/src... hdd/usb/dvd/vm... so many ways to run and enjoy Linux. :cool::D

    Are you going with the standard Gnome desktop on Fedora? Or choosing one of the spins?

    Cheers
     
    wizardfromoz likes this.
  3. mrcrossroads

    mrcrossroads Silver Member
    Silver Supporter

    Joined:
    Nov 23, 2017
    Messages:
    23
    Likes Received:
    25
    I hate Gnome 3, which is what I believe Fedora's default DE is. I had grown accustomed to Cinnamon on Mint so that's what I'm using on F27 now. Have tried KDE on a few occasions but keep finding myself going back to Cinnamon.

    What's your distro/DE of choice?
     
  4. atanere

    atanere Moderator
    Gold Supporter

    Joined:
    Apr 6, 2017
    Messages:
    550
    Likes Received:
    429
    In recent years I have mostly used Linux Mint too, and MATE has been very steady and stable for me. I like Cinnamon too, but I had some video hiccups with it so I have not used it as much (but I do currently have a laptop with Mint/Cinnamon on it). I also like LXDE very well for layout, speed, and low resource requirements.

    I can get around in Gnome 3, KDE, Unity, and the others, but I've never settled into any for long term use. But I download new distros all the time and keep a large pile of DVD's nearby that I can boot up and run for troubleshooting, so I've played with just about all of them at one time or another. Checking out new stuff is a big part of the fun for me. :D
     
    wizardfromoz likes this.
  5. mrcrossroads

    mrcrossroads Silver Member
    Silver Supporter

    Joined:
    Nov 23, 2017
    Messages:
    23
    Likes Received:
    25
    ANY of them beats the W10 GUI! :-D
     
    atanere and wizardfromoz like this.
  6. wizardfromoz

    wizardfromoz Well-Known Member

    Joined:
    Apr 30, 2017
    Messages:
    334
    Likes Received:
    342
    An IT Coordinator, eh? We can make use of him, Stan ? (@atanere )

    Welcome, @mrcrossroads , hope you enjoy this site :D

    I am from Down Under, so I hope you get used to my sometimes bizarre sense of humour.

    Wizard's Rule of Thumb:

    Always keep a live USB/DVD of Ubuntu or Linux Mint on hand ... incredibly reliable for kickstarting your system when it is borked. You can always get rid of it later (I use Linux from the five major Families).

    Cheers and avagudweegend.

    Good taste ;)

    BTW - if you share the list of apps with us, and whether you just want it for RPM-based such as Fedora, or other, we will probably have someone within our ranks whom can assist. Or you might rather wish to work it out yourself. I use the term "druther" - I'd rather do this, or I'd rather do that. So what's your druther?

    Edited - added BTW
     
    #6 wizardfromoz, Nov 25, 2017
    Last edited: Nov 25, 2017
    mrcrossroads and atanere like this.
  7. mrcrossroads

    mrcrossroads Silver Member
    Silver Supporter

    Joined:
    Nov 23, 2017
    Messages:
    23
    Likes Received:
    25
    Thanks @wizardfromoz nice to meet you.

    I always appreciate a good sense of humor, even if it's bizarre. The things going on in the world sucks so it's good to enjoy company with folks with like interests. ;)

    I appreciate the script offer. I think I'd like to just learn how to do it. I want to get past being just a basic Linux user and start digging a little deeper.
     
    atanere and wizardfromoz like this.
  8. JasKinasis

    JasKinasis Active Member

    Joined:
    Apr 25, 2017
    Messages:
    110
    Likes Received:
    172
    It sounds like you already have 99% of a script.
    Turning it into a script is quite simple.

    Assuming you have a text file like this:
    PostInstallActions.txt
    Code:
    To install my preferred programs
    from a fresh install use the command:
    dnf install program1 program2 program3
    
    First up add a shebang (#!) line at the top of the file that tells the shell which interpreter to use. So if you use bash you can add:
    Code:
    #!/bin/bash
    
    NOTE: This must be the very first line in the file.
    Also, if you use a different shell you can specify it there - e.g. sh, zsh, csh etc etc.

    Also, any lines of text that are not part of the command should be commented out using a # at the start of the line. So we should comment out the lines that contain our note to ourself.

    So now we have a file that looks like this:
    Code:
    #!/bin/bash
    # To install my preferred programs
    # from a fresh install use the command:
    dnf install program1 program2 program3
    
    Alternatively, the commented out notes could be removed leaving us with:
    Code:
    #!/bin/bash
    dnf install program1 program2 program3
    
    Whatever you choose to do - now your text file is a valid shell-script.
    The final task is to make it executable:
    Code:
    chmod +x PostInstallActions.txt
    
    Optionally, you might also want to rename the script to lose the .txt extension, or rename it entirely:
    Code:
    mv ./PostInstallActions.txt mypostinstall.sh
    
    Now we have a script called mypostinstall.sh which we can execute using:
    Code:
    ./mypostinstall.sh
    
    You can back that up somewhere (on a USB stick) and then run it each time you do a fresh install on one of your PCs.
    Job done! You've created your first simple script.

    Edit:
    There is a lot of other shell-scripting syntax for looping and branching and dealing with variables - allowing you to create much more complex scripts - I won't touch on that - I'll leave it to you to look into that.
    There are a lot of websites and ebooks available that can help you to learn shell-scripting.
    And there are several of us here who can help with any shell-scripting questions you might have along the way.

    But for now, if you just want to run a sequence of simple commands in a script all you need to know is:
    1. The first line must be a shebang line telling the shell which command interpreter to use
    2. Comments always start with # - everything else is a command. Add any commands you want to run with some useful comments
    3. Make the script executable

    And that's about it at the simplest level.

    I hope this was a useful start for you!
     
    #8 JasKinasis, Dec 1, 2017
    Last edited: Dec 1, 2017
  9. mrcrossroads

    mrcrossroads Silver Member
    Silver Supporter

    Joined:
    Nov 23, 2017
    Messages:
    23
    Likes Received:
    25
    @JasKinasis

    Wow man, thanks! That's simple enough. I'll try it out this evening.

    I appreciate the help. :)

    So, would this be legit?

    ________________________________________________
    #!/bin/bash

    sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

    dnf install -y vlc dropbox unzip icedtea-web java-openjdk gimp qbittorrent VirtualBox wine youtube-dl mediawriter terminator bleachbit redshift chromium filezilla wireshark-qt p7zip p7zip-plugins unrar

    dnf install -y gstreamer1-plugins-base gstreamer1-plugins-good gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-bad-freeworld gstreamer1-plugins-bad-free-extras ffmpeg

    dnf config-manager --add-repo=http://negativo17.org/repos/fedora-steam.repo
    dnf -y install steam

    dnf config-manager --add-repo=http://negativo17.org/repos/fedora-spotify.repo

    dnf install -y spotify-client
     
    #9 mrcrossroads, Dec 1, 2017
    Last edited: Dec 1, 2017
    atanere likes this.
  10. JasKinasis

    JasKinasis Active Member

    Joined:
    Apr 25, 2017
    Messages:
    110
    Likes Received:
    172
    As long as each of those dnf commands are valid and work - then yup, seems legit to me!
    I haven't used any Red Hat based distros for many years... Long before dnf arrived!
     
    mrcrossroads and atanere like this.
  11. atanere

    atanere Moderator
    Gold Supporter

    Joined:
    Apr 6, 2017
    Messages:
    550
    Likes Received:
    429
    I'll just throw in my two cents also. If your list of commands fails to work completely, you may need to concatenate them together. I use rsync to perform a number of separate backups from different folders, and I have these commands saved to a text file that I paste into a terminal to execute. Each of my commands are listed on a separate line with && at the end to join (concatenate) them together... kind of like this:

    Code:
    command #1 &&
    command #2 &&
    command #3 &&
    command #4
    
    So, after I paste all the of the commands into a terminal and hit Enter, they all execute sequentially. Perhaps this isn't needed in a Bash script though... I am not sure. It is just a thought in case your run into trouble creating your script.

    Cheers
     
  12. mrcrossroads

    mrcrossroads Silver Member
    Silver Supporter

    Joined:
    Nov 23, 2017
    Messages:
    23
    Likes Received:
    25
    Thanks for the pointer. I may get around to converting my last machine from Mint to Fedora this week. Will have this page handy! :-D
     

Share This Page