Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
2
answers
275
views
How can I use Mac Ports Bash instead of Apple’s Bash?
I've installed Mac Ports and its bash version on 10.15 Catalina, but when I open the terminal, I am still greeted with Apples old bash version and I am missing all the Mac ports that I have installed. They are there, but only in the new bash version. (1) In Apple’s System Preferences, in the Advance...
I've installed Mac Ports and its bash version on 10.15 Catalina, but when I open the terminal, I am still greeted with Apples old bash version and I am missing all the Mac ports that I have installed. They are there, but only in the new bash version.
(1) In Apple’s System Preferences, in the Advanced section of Users & Groups, I have inserted the Mac Ports bash path
/opt/local/bin/bash
, but it doesn't have any effect.
(2) Changing the Terminal preferences to /opt/local/bin/bash
(see suggestion below from Tim Kennedy) also had no effect.
This is the situation after applying these two changes:
$ echo $BASH_VERSION
5.2.32(1)-release
$ bash -version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.
$ which bash
/bin/bash
There is also a related post «again… bash version mac didn't change », but it covers the Homebrew version and not Mac Ports and it doesn't solve this problem, either. It does contain however some other useful information.
(3) Applyig the solution of above mentioned article also had no effect:
$ chsh -s /opt/local/bin/bash
Changing shell for admin.
Password for admin:
chsh: /opt/local/bin/bash: non-standard shell
$ which bash
/bin/bash
(4) The suggestion to edit the /etc/shells
file also had no effect.
Finally, Marc Wilson’s suggestion about the $PATH (see below) led me to the solution. My /etc/paths
initially looked like this:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
When I placed the Mac Ports directory /opt/local/bin
before Apple’s bash location /bin
, using sudo vi /etc/paths
, I finally succeeded. Now, when open the Terminal, I get:
$ echo $BASH_VERSION
5.2.32(1)-release
$ bash -version
GNU bash, version 5.2.32(1)-release (x86_64-apple-darwin19.6.0)
$ which bash
/opt/local/bin/bash
$ figlet it works
_ _ _
(_) |_ __ _____ _ __| | _____
| | __| \ \ /\ / / _ \| '__| |/ / __|
| | |_ \ V V / (_) | | | <\__ \
|_|\__| \_/\_/ \___/|_| |_|\_\___/
Thanks to all!
Gary U.U. Unixuser
(339 rep)
Dec 3, 2024, 12:52 PM
• Last activity: Dec 6, 2024, 09:13 PM
98
votes
5
answers
118002
views
No sha256sum in MacOS
I tried to use `sha256sum` in High Sierra; I attempted to install it with `MacPorts`, as: sudo port install sha256sum It did not work. What to do?
I tried to use
sha256sum
in High Sierra; I attempted to install it with MacPorts
, as:
sudo port install sha256sum
It did not work.
What to do?
Rui F Ribeiro
(57882 rep)
Feb 27, 2018, 03:05 AM
• Last activity: Mar 22, 2024, 06:04 PM
0
votes
1
answers
118
views
Building and installing GCC 12 in a parallel/sub prefix on heavily modified Ubuntu 14.04
One of my systems that I still use a lot runs a kind of "Frankenbuntu" 14.04 that has received lots of additional updates via PPAs and software I build and install to `/opt/local` (using an adapted version of the MacPorts ports system for Mac; in fact I have most of my Linux ports installed on Mac t...
One of my systems that I still use a lot runs a kind of "Frankenbuntu" 14.04 that has received lots of additional updates via PPAs and software I build and install to
/opt/local
(using an adapted version of the MacPorts ports system for Mac; in fact I have most of my Linux ports installed on Mac too).
The library dirs under that prefix aren't added to ldconfig so I rely on the use or rpaths and runtime setting of LD_LIBRARY_PATH
.
I've been using clang 8 as my main compiler (newest version that was once provided through LLVM repos) because it's a bit faster and probably more capable than the latest GCC available from Ubuntu (9.4.0). I've built clang 12 myself (an extremely boring exercise in patience!) but just read that you really need clang 17 to get proper c++20 support . Or GCC 12.
I happen to have a port
for GCC 12 too, but I've run into troubles before installing GCC (7) under /opt/local, issues that had to do with mixing libstdc++ runtimes. Those *may* have been due to the fact that the OS already had (or got updated to) a newer libstdc++ (the one from GCC 9.4.0), and a similar situation is not going occur again. Not until I upgrade the OS at least.
Still, I'd like to ask about some up-to-date best-practises and a succinct overview of the pitfalls (the ones less evident for someone who's been installing to and running from a parallel prefix for years). Are there any known incompatibilities between libstdc++ 9.4.0 and 12.3.0? Or the libstdc++ from 13.2.0 which is the one I have installed on my Mac?
Thanks in advance!
In reaction to the first couple of comments:
- I'm a retro-computing "fan".
- I know my OS is old and no longer supported. I have reasons to keep it at this version on this particular machine, and am really not looking for further suggestions that it would only take XX minutes to upgrade. I know from experience it'll take a lot more, the system is likely to be unstable until I at least downgrade to a known-compatible kernel (4.14.328 ATM) and in the meantime I won't be able to use it for anything useful. Just building GCC for my parallel prefix will take maybe 5h and will be perfectly reversible (MacPorts has a very handy de/activation feature
- I am also aware that libstdc++ isn't forward ABI compatible but that it is at least intended to be *backwards* ABI compatible:
> apt contains /usr/lib/x86_64-linux-gnu/libstdc++.so.6
libstdc++6:amd64: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
> apt show libstdc++6
Package: libstdc++6
State: installed
Automatically installed: no
Multi-Arch: same
Version: 9.4.0-1ubuntu1~14.04
The libstdc++ version installed by port:libgcc13
on my Mac:
> otool -L /opt/local/lib/libgcc/libstdc++.6.dylib
/opt/local/lib/libgcc/libstdc++.6.dylib:
/opt/local/lib/libgcc/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.32.0)
Same SOVERSION (6), also apparent from the more tighly controlled baked-in versioning numbers of the dylib.
I interpret this as indicating that libstdc++ v13.2.0 is *supposed to be* a drop-in replacement for the one I currently have, just as that one was a drop-in replacement for the earlier versions that are still available for 14.04:
> aptitude versions libstdc++6:amd64
Package libstdc++6:
p 4.8.2-19ubuntu1 trusty 500
p 4.8.4-2ubuntu1~14.04.4 trusty-security,trusty-updates 500
i 9.4.0-1ubuntu1~14.04 trusty 500
My question about known incompatibilities and/or issues was thus meant to be read with in the context of the intended backwards compatibility.
I have already discovered that GCC 13 no longer provides std::auto_ptr
even in C++03 mode where it really ought to be present (but not if that's because of a build configuration thing).
RJVB
(254 rep)
Mar 12, 2024, 12:55 PM
• Last activity: Mar 15, 2024, 01:32 PM
0
votes
1
answers
141
views
Why can't I change my pip3 from the built in to the MacPort-version?
Here is a terminal session: db@air ~ % port select --list pip3 Available versions for pip3: none pip3-apple (active) pip311 db@air ~ % sudo port select --set pip3 pip311 Selecting 'pip311' for 'pip3' succeeded. 'pip311' is now active. db@air ~ % port select --list pip3 Available versions for pip3: n...
Here is a terminal session:
db@air ~ % port select --list pip3
Available versions for pip3:
none
pip3-apple (active)
pip311
db@air ~ % sudo port select --set pip3 pip311
Selecting 'pip311' for 'pip3' succeeded. 'pip311' is now active.
db@air ~ % port select --list pip3
Available versions for pip3:
none
pip3-apple
pip311 (active)
db@air ~ % which pip3
/Users/db/Library/Python/3.9/bin/pip3
db@air ~ % which -a pip3
/Users/db/Library/Python/3.9/bin/pip3
/opt/local/bin/pip3
/usr/bin/pip3
db@air ~ % echo $PATH
/Users/db/Library/Python/3.11/bin:/Users/db/Library/Python/3.9/bin:/Users/db/Library/Python/3.8/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
As you can see I have two
pip3
installed. Changing from the built in to MacPorts is successful (no error message) and the listing is updated accordingly, but which
still says that pip3
points to the built in from Python 3.9 rather than Python 3.11.
What is going on here? How do I make pip from Python 3.11 the "active" one?
d-b
(2047 rep)
Aug 12, 2023, 01:53 PM
• Last activity: Aug 14, 2023, 01:33 PM
3
votes
1
answers
2416
views
No telnet in MacOS
Hi tried to use `telnet` in High Sierra, and I noticed it does not come anymore with MacOS. I also attempted to install it via MacPorts with: $ sudo port install telnet Error: Port telnet not found But it did not work. What to do?
Hi tried to use
telnet
in High Sierra, and I noticed it does not come anymore with MacOS.
I also attempted to install it via MacPorts with:
$ sudo port install telnet
Error: Port telnet not found
But it did not work. What to do?
Rui F Ribeiro
(57882 rep)
Feb 23, 2018, 04:51 PM
• Last activity: Mar 22, 2022, 09:52 AM
Showing page 1 of 5 total questions