Is it possible? Yes. Both programs are open source.
Is it convenient? Not really.
Package managers work more or less like this:
They track packages installed on your system(and their version)
To do this, they specify their own format of packages(e.g. .deb), and use these packages as instructions on how to install the program and how to track it
This is a security feature of sudo. In your /etc/sudoers file, you should have a line such as :
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
The meaning of the secure_path option is given in the man page of sudoers:
secure_path : Path used for every command run from sudo. If you don't trust the people running sudo to have a sane PATH ...
brew installs bash in /usr/local/bin so that is what you want to add to $PATH otherwise you'll have to update $PATH every time bash is updated.
Did you also want to make that bash your login shell? Then:
chsh -s /usr/local/bin/bash
If I want the latest version (or if no package is available), I do compile the source code myself. There's really no alternative to comipling if you want the latest version -- all packages have some lag compared to the current repository, and there is software that is only on github etc. and hasn't made it into a package yet.
I install compiled packages ...
Many Linux (and BSD) versions have their own package managers built in and do not require you to touch the source files or use PPA files.
For example, with Linux Mint there is the "Software Manager" which has tens of thousands of applications that can be installed with a few clicks.
I have used PPA's for a few programs, but were possible I use the Software ...
You're getting bitten by the combination of ssh and the notoriously unintuitive way the bash shell chooses the login scripts it executes.
From the ssh(1) man page (emphasis mine):
When the user's identity has been accepted by the server, the server either executes the given command in a non-interactive session or, if no command has been specified, logs into ...
Instead of trying to install gfortran you should try gcc instead. gcc install comes with gfortran. This is available from homebrew or MacPorts.
Another method is to install pre-compiled binaries from here. Select the version based on your Mac OS version and you get an apple style loader. A .dmg file ready to load on your mac.
In earlier versions of MacOSX, the easy fix was to change ownership on /usr/local so that you could create directories in it without using sudo. However, since High Sierra, this is no longer possible - the operating system forbids it entirely.
So the workaround is to create these required folders as root, and then change ownership of them to yourself or to ...
In your Cask, if you need X11, you should add:
depends_on x11: true
if you need java 7 or higer:
if you need exactly java 8:
if you need the formula nmap:
depends_on formula: 'nmap'
if you need the cask virtualbox:
depends_on cask: 'virtualbox'
if you need a minimum macOS version:
depends_on macos: '>= :...
You're sending the selection to stdout and pipe it over to brew upgrade, but brew upgrade does not use stdin. The command updates just everything.
You will need something like this to add the selection as arguments:
brew outdated | fzf -m --tac | xargs brew upgrade