On Mac Big Sur, how do I downgrade my version of Unision to a specific version? - version

I’m running Mac OS 11.5.2 (Big Sur). I have the following version of unison installed using
brew install unison
Which is
$ unison -version
unison version 2.51.4 (ocaml 4.12.0)
However, in order to work with a virtual Ubuntu box, which runs
$ unison -version
unison version 2.51.2 (ocaml 4.08.1)
I need to downgrade my Mac OS version of Unison. But the brew command doesn’t give me control over the version. How do I downgrade my Mac version to match the Linux version?

# copy formula code
pbpaste > $(find $(brew --repository) -name <FORMULA>.rb)
brew install <FORMULA>
follow this blog https://remarkablemark.org/blog/2017/02/03/install-brew-package-version/

Brew is a rolling release package manager, which more or less by design does not let/want you to access previous versions.
If ditching brew is okay for you.
You can go directly to Unison's Github. On there you will be able to download the release you want Unison version 2.51.2 for OSX
Install should be very standard, unzip the file, drag the .app file to your application folder.

modify Unison's Formula code from this url
Unison Formula and copy that
then run command like that
# copy formula code
pbpaste > $(find $(brew --repository) -name unison.rb)
brew install unison

Related

Error when trying to do (sudo apt install flex bison): The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt [duplicate]

I was watching this, and, as you can see, the first command I am told to put in is:
sudo apt-get install python-setuptools
When I do this, it outputs:
sudo: apt-get: command not found
I have no idea why this is the case.
How can I resolve this so I am following the tutorial correctly?
Mac OS X doesn't have apt-get. There is a package manager called Homebrew that is used instead.
This command would be:
brew install python
Use Homebrew to install packages that you would otherwise use apt-get for.
The page I linked to has an up-to-date way of installing homebrew, but at present, you can install Homebrew as follows:
Type the following in your Mac OS X terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After that, usage of Homebrew is brew install <package>.
One of the prerequisites for Homebrew are the XCode command line tools.
Install XCode from the App Store.
Follow the directions in this Stack Overflow answer to install the XCode Command Line Tools.
Background
A package manager (like apt-get or brew) just gives your system an easy and automated way to install packages or libraries. Different systems use different programs. apt and its derivatives are used on Debian based linux systems. Red Hat-ish Linux systems use rpm (or at least they did many, many, years ago). yum is also a package manager for RedHat based systems.
Alpine based systems use apk.
Warning
As of 25 April 2016, homebrew opts the user in to sending analytics by default. This can be opted out of in two ways:
Setting an environment variable:
Open your favorite environment variable editor.
Set the following: HOMEBREW_NO_ANALYTICS=1 in whereever you keep your environment variables (typically something like ~/.bash_profile)
Close the file, and either restart the terminal or source ~/.bash_profile.
Running the following command:
brew analytics off
the analytics status can then be checked with the command:
brew analytics
As Homebrew is my favorite for macOS although it is possible to have apt-get on macOS using Fink.
MacPorts is another package manager for OS X:.
Installation instructions are at The MacPorts Project -- Download & Installation after which one issues sudo port install pythonXX, where XX is 27 or 35.
Conda can also be used as package manager. It can be installed from Anaconda.
Alternatively, a free minimal installer is Miniconda.
apt-get command is only available on Debian or Debian-based Linux distributions (such as Ubuntu, Linux Mint, Kali). It is not accessible on macOS. Alternatively, you can use package managers like Homebrew, MacPorts, and Nix. You can find equivalent commands for each as follows
brew install package_name
sudo port install package_name
nix-env -i package_name
Before installing above package managers, you need to install XCode first. Follow the operation instructions from this guide How to Fix "sudo apt-get command not found" Error on Mac Terminal.
Alternatively You can use the brew or curl command for installing things, wherever apt-get is mentioned with a URL...
For example,
curl -O http://www.magentocommerce.com/downloads/assets/1.8.1.0/magento-1.8.1.0.tar.gz

How can you search for, install and include/link C libraries on a mac?

I already have brew and xcode installed.
I'm trying to install the lz4 C library.
On Ubuntu I'd use:
apt search lz4
sudo apt install liblz4-dev
On Windows I'd use vcpkg.
How do you do it on a MacOs (v 11.3.1)?
I've tried:
brew install lz4
But my IDE isn't detecting the installed library or header file, so I'm assuming that's just the command line version.
Edit: CLion does not automatically detect libraries from your usr sub-directories, adding include targets using Cmake found the headers and libraries that brew did indeed install.
You might have to add -I /opt/homebrew/include -L /opt/homebrew/lib -llz4 to your compiler flags in the project settings. /opt/homebrew is for m1 macs, replace that with /usr/local if you're on intel.

Error while installing CodeLite IDE in Ubuntu

While installing CodeLite IDE in Ubuntu following error occurs.
Any idea?
ERROR:
The following packages have unmet dependencies:
codelite : Depends: libjbig0 but it is not installable
Depends: liblzma5 (>= 5.1.1alpha+20120614) but 5.1.1alpha+20110809-3 is to be installed
Depends: libpango-1.0-0 (>= 1.18.0) but it is not installable
Depends: libpangocairo-1.0-0 (>= 1.14.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
I had a similar problem. You may need to check your version of Ubuntu, and that you've added the correct repositories. If this is the problem, then the fix is very simple!
Firstly, check your version of Ubuntu. From terminal you can do this with the command lsb_release -a. The important part, for our purpose, is the codename. I'm using Ubuntu 13, aka "saucy".
Now let's look at the multiverse repository that you added. From the terminal you can do this with sudo gedit /etc/apt/sources.list. Go down to the end of the file, and you should see something like:
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://repos.codelite.org/ubuntu/ saucy universe
Make sure that your version has your ubuntu codename (in my case 'saucy'). The example code on the website is for Ubuntu 14, and so I wrongly had a 'trusty' source here. Edit the line so that it is correct for your version of Ubuntu, and then save and close the file.
Lastly, you'll need to update your repos so that the change goes through. From the terminal, run sudo apt-get update. All being well, you should now be able to sudo apt-get install codelite without the errors.
My problem was caused by too much cutting-and-pasting code from the codelite website. I followed exactly the same page as you did, and their example code is for people with Ubuntu trusy (14).
You will need to be more specific on how you tried to install codelite.
The official Debian repository manages an ancient version of codelite which we (the codelite team) do not support.
In order to get the most up-to-date version (that we support) please install it from codelite's official website (select the Download at menu at the top)
Before installing, make sure you delete the folder ~/.codelite (incase you are upgrading)
Also, the official Debian installer is split into 2 pakacges codelite and codelite-plugins make sure you purge them both before installing codelite from our repository
I'm the author of Howto install the latest codelite in Ubuntu - EuroBytes. I have tested the latest codelite on Trusty.
If you still have issues with codelite, remove like so: sudo apt-get purge codelite
Note that the dependencies links are dead. But, i managed to install it anyways:
codelite 6.1 on Ubuntu Trusty Thar 14.04.
Image from: Howto install the latest codelite in Ubuntu - EuroBytes
Install like so:
sudo apt-add-repository "deb http://repos.codelite.org/ubuntu/ $(lsb_release -sc) universe"
sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
sudo apt-get update
sudo apt-get install codelite wxcrafter
Feel free to contact me here or on my site, for any issues you may have.
Source:
Howto install the latest codelite in Ubuntu - EuroBytes

How do I know the macports package name for a command?

A script I need to run uses tempfile, but I don't have that on my Mac. I do use Macports. How can I find out which Macports package I need to install to get tempfile?
tempfile is a shell command used in scripting. It's an ELF binary on my Linux box and belongs to the debianutils package, as shown by dpkg -S /bin/tempfile. I Installed the Macports debianutils package and now have tempfile.
Just wondering how I'll figure this out if I don't have a Linux box handy...
Is tempfile a Python library? If so, you should be able to install it with pip if you have it.
On another note, you should probably switch to Homebrew as your package manager.

Am I supposed to do a brew ln after every brew install? (Mac OS Package Manager homebrew)

I'm not sure I'm using the Mac OS brew package manager properly. Packages don't end up in /usr/local unless I follow a
brew install foo
with a
brew ln foo
What makes me suspicious is nearly every quickstart tutorial I see on using brew doesn't indicate that the ln step is required.
Am I missing something?
It's especially annoying when I install something like ffmpeg, that installs a lot of prerequisites. I find myself having to read the log, finding what it installed and manually doing a
brew ln yasm
brew ln videolan
brew ln faac
etc, for each prerequisite installed. I can't believe it's supposed to work this way. What am I doing wrong.
You shouldn't have to; brew ln should be performed automatically after a package is installed.
only if you do a manual compile/install, change formula, non-default location

Resources