Hi all,

I am about to do a bit of a distro hop, and I am looking at Fedora and its spins, after years on Debian / POP.

I am not looking forward to setting it all up again, it’s a drag.

I wonder, is there a tool that lets me script installs?

I’ll want to check if application exists, and if so, update, otherwise, install. That kind of thing.

Things like:

  • Telegram
  • Joplin
  • Docker
  • Firefox
  • Ungoogle Chromium
  • Sublime Text
  • VSCodium
  • Keepass
  • Thunderbird
  • DBeaver
  • Gimp
  • Inkscape
  • KDENLive
  • Syncthing
  • Steam
  • VLC
  • Localsend
  • Flameshot
  • Element
  • Cherrytree
  • Calibre
  • Anydesk

I show the list, only to give an idea of what might be involved.

I’m new to Fedora, so not sure how it differs beyond the package manager. But, thought I’d ask.

Does such a tool exist, and is it worth my time? I can practice on a VM before trying on the final install/s.

Thank you

1 point

Nix and home-manager, those are the only 2 I have off the top of my head.

permalink
report
reply
17 points

Using ansible will help you on your 2nd, 3rd , nth install.

But getting ansible to do what you want (plus testing) for the first time would takes 10x longer than manual install.

I think there’s xkcd about that.

permalink
report
reply
8 points
*

Just installing applications is pretty easy though.

---
- hosts: localhost
  become: yes
  tasks:
    - name: Install required software
      dnf:
        state: latest
        name:
          - firefox
          - telegram
          - calibre

ansible-playbook install.yml

Something like that (untested)

permalink
report
parent
reply
1 point
*

I distinctly remember yum/dnf should be using a loop. Forget why but it’s recommended. Here’s a snippet from my playbook. Simply make the vars as you need and run.

  - name: Install flathub as remote
    ansible.builtin.shell:
      cmd: flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
    tags:
      - apps

  - name: Install flatpak apps
    community.general.flatpak:
      name: "{{ item }}"
      state: present
    loop: "{{ flatpaks }}"
    tags:
      - apps

  - name: Remove some default unused packages
    ansible.builtin.dnf:
      name: "{{ item }}"
      state: absent
      update_cache: no
    loop: "{{ remove }}"
    ignore_errors: true
    tags:
      - apps

  - name: Install our packages
    ansible.builtin.dnf:
      name: "{{ item }}"
      state: present
      update_cache: yes
    loop: "{{ rpms }}"
    ignore_errors: true
    tags:
      - apps```

On mobile. Apologies if formatting is off.
permalink
report
parent
reply
13 points

You could write yourself a bash script to do this.

permalink
report
reply
3 points

This ended up working perfectly

permalink
report
parent
reply
1 point

Awesome!

permalink
report
parent
reply
11 points
*

I have a bash script I use to script my Silverblue install. Something like this should work.

# space-separated list of packages to install
S_RPM_PACKAGES_TO_INSTALL="pkg1 pkg2 pkg3"

# function to install the packages
dnf_install () {
	sudo dnf install -y $1
}

# call to function, passing the list
dnf_install "$S_RPM_PACKAGES_TO_INSTALL"

I have it set up this way so that I just have a bunch of bash variables describing the stuff I want to install all at the top of the file, but the function definitions and calls lower down since I don’t need to see them.

It also does other things like removes packages from the system, removes some preinstalled flatpaks, installs flatpaks from Fedora Flatpaks / Flathub / gnome-nightly, and sets up gnome through a list gsettings commands.

As I use my system, I add new apps to the list I want next time I install and remove apps I don’t use.

permalink
report
reply
2 points

I love this, I will update the script I’ve setup to mirror your idea. Nice and clean.

I wonder if you can help at all? The only app that fails install is Anydesk. I have to do the following:

# Anydesk
sudo tee /etc/yum.repos.d/anydesk.repo<<EOF
[anydesk]
name=AnyDesk Fedora Linux
baseurl=http://rpm.anydesk.com/fedora/x86_64/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://keys.anydesk.com/repos/RPM-GPG-KEY
EOF

sudo dnf install anydesk -y

But it gives an error, saying :

[anydesk]
name=AnyDesk Fedora Linux
baseurl=http://rpm.anydesk.com/fedora/x86_64/
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://keys.anydesk.com/repos/RPM-GPG-KEY
AnyDesk Fedora Linux                                                                                                                                                         397  B/s | 488  B     00:01    
AnyDesk Fedora Linux                                                                                                                                                         1.8 kB/s | 1.7 kB     00:00    
Importing GPG key 0xCDFFDE29:
 Userid     : "philandro Software GmbH <info@philandro.com>"
 Fingerprint: D563 11E5 FF3B 6F39 D5A1 6ABE 18DF 3741 CDFF DE29
 From       : https://keys.anydesk.com/repos/RPM-GPG-KEY
AnyDesk Fedora Linux                                                                                                                                                         796  B/s | 1.2 kB     00:01    
Error: 
 Problem: conflicting requests
  - nothing provides libgtkglext-x11-1_0-0 needed by anydesk-6.3.2-1.x86_64 from anydesk
(try to add '--skip-broken' to skip uninstallable packages)

Is there a special way to add that kind of command to a bash script? All good apart from that though.

permalink
report
parent
reply
1 point

I think that’s just a dependency issue unrelated to the script.

permalink
report
parent
reply
1 point
*

ok, thank you. I’ll address that, in that case. Thanks again!

EDIT, and resolved. Thanks again.

permalink
report
parent
reply
6 points

I did more than 5 installs this weekend (for … reasons) and the “trick” IMHO is …

Do NOT install things ahead of actually needing them. (of course this assume things take minutes to install and thus you will have connectivity)

For me it meant Firefox was top of the list, VLC or Steam (thus NVIDIA driver) second, vim as I had to edit crontab, etc.

Quite a few are important to me but NOT urgent, e.g Cura (for 3D printer) and OpenSCAD (for parametric design) or Blender. So I didn’t event install them yet.

So IMHO as other suggested docker/docker-compose but only for backend.

Now… if you really want a reproducible desktop install : NixOS. You declare your setup rather than apt install -y and “hope” it will work out. Honestly I was tempted but as install a fresh Debian takes me 1h and I do it maybe once a year, at most, no need for me (yet).

permalink
report
reply
1 point

Another “trick” I use is having an ~/Apps directory in which I have AppImage, binaries, etc that I can bring from an old /home to a new one. It’s not ideal, bypassing the package manager, and makes quite a few assumption, first architecture, but in practice, it works.

permalink
report
parent
reply
1 point

Check this out: https://github.com/ivan-hc/AM

Use appman and set the install directory to ~/Apps and now you will be able to install appimages/binaries in the ~/Apps dir using a package manager that keeps them up to date and that you can move to any other distro, I have all of this:

Although more recently for binaries I’ve been using this instead, which pulls from a massive repo of static binaries, though note that dbin needs its own separate directory in HOME to install binaries (you can’t use ~/Apps that is).

permalink
report
parent
reply
1 point

Hmmm very interesting thanks for the links and explanation!

I’m not “ready” for it yet so I’ve bookmarked all that (by adding a file in ~/Apps ;) but that’s definitely and interesting, and arguably neater solution.

Honestly I try to stick to the distribution package manager as much as I can (apt on Debian stable) but sometimes it’s impossible. Getting binaries myself feels a bit “wrong” but usually works. Some, like yt-dlp as I see in your list, do have their own update mechanisms. Interesting to consider stepping back and consider the trade off. Anyway now thanks to you I know there are solutions for a middle ground!

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

Community stats

  • 8.3K

    Monthly active users

  • 3.4K

    Posts

  • 40K

    Comments