Exclude installed packages from the package lists that are proposed for emerging in Gentoo Linux? - gentoo

Taking a simple example:
run the following commands in a gentoo machine with htop installed:
emerge -av htop
The system will start compilling htop package regardless whether htop has been installed or not.
What I wish to achieve is to give a parameter to emerge so that if htop is installed with the same flag, it wouldn't reinstall it.
I am on the processe of installing a software package, which gives me a huge list of packages for emerging. however, some of them have already installed. I hope this method is able to neglect the packages installed in my pc.
Thanks.

Related

Packages apt-get vs brew?

Im trying to get something running in a lab, and I need to install a whole bunch of packages to compile the code:
sudo apt-get install build-essential libgtk2.0-dev libwxgtk3.0-dev libwx-perl libmodule-build-perl git cpanminus libextutils-cppguess-perl libboost-all-dev libxmu-dev liblocal-lib-perl wx-common libopengl-perl libwx-glcanvas-perl libtbb-dev libxmu-dev freeglut3-dev libwxgtk-media3.0-dev libboost-thread-dev libboost-system-dev libboost-filesystem-dev libcurl4-openssl-dev libextutils-makemaker-cpanfile-perl
The problem is, I'm working on a Mac; So I only have brew available - and the package names are not equivalent.
Am I trying to do something dumb and impossible, or is there a way to cross reference those apt-get packages to ones available in brew and install those so I can build the app?
For added context, its a modified "slicer" application for generating files that a 3d printer uses to make parts. I could fire up an ubuntu VM and use apt-get, but I'm on an M1 mac at the moment and recompiling experimental QEMU code just so I can fire up an ubuntu VM takes me way more out of my depth than I already am... I'm running brew on a duplicated, rosetta emulation forced terminal.
There is no straightforward way to automatically figure out whether a corresponding Homebrew package exists for each of these packages, no. But you can probably guess the majority, and manually figure out the rest. Each Debian package has a link to the upstream sources, and a home page if one exists, from which you can often find links to packages for other architectures, etc.
From the Debian package search page you can search e.g. for the libxmu-dev package, and discover the corresponding package page for Buster (the current stable Debian release), which in turn has links to the upstream repo, etc. But this is an X11 package, so it's not straightforwardly compatible with macOS, which uses an entirely different GUI architecture.

macOS Package Managers: Using Nix alongside Homebrew?

I was wondering if there would be any issues with installing Nix and Homebrew on the same system?
I know Homebrew tends to install things all over different directories, but from what I have read, Nix is very clean. If I understand this correctly, Nix installs it's packages all within one single directory.
So if this is the case, could I try running them both side-by-side? I would be careful not to install too many of the same packages from both places in (ie. I wouldn't install grep, htop, or whatever else from both Homebrew and Nix and if I did I would take precautions).
Side-note: This would not be permanent. I am thinking about switching from Homebrew to Nix (just to mix things up a bit), and I wanted to try Nix on my main machine before taking the leap (if at all). I know I could just try Nix on a VM, but I would not get the same experience unless I tried it on my main system. So it would be nice to install it along Homebrew and give it a shot before going through the pains of removing Homebrew and replacing all my Homebrew packages with Nix packages.
Yes, you can install Nix along side Homebrew.
Nix will install all it's packages within /nix/store For example, on my NixOS system vim is currently installed in /nix/store/j6nrk9h1rpxrzmccm0yq520ik625gd1q-vim-8.1.0578
Your shell will choose whether to use a package from Nix or Homebrew, according to how $PATH is set up. For example, if it so happens that the Nix paths are first, then they will take precedence.
Note
A common source of confusion is that install means something different on Nix. When you install a package, such as Python, it becomes part of a Nix environment, and as such can be executed without specifying the full path; Just as you'd expect from any package manager.
However, if you install a package which has, say, Python, as a dependency, Python would get installed, but more likely than not it would not be included in the environment. Hence it can only be executed via the absolute path.
On a related note, due to a similar reason, if you install a library with Nix and then try to compile against it outside of Nix, it will not work; The build tools will not find the library.

apt in Linux Subsystem for Windows 10 is failing with 404 Not Found

OK, so this is my first SO question so I'm gonna try my best to lay this out.
I have a Windows 10 laptop on which I am trying to install gcc. I have in the past tried alternatives such as netbeans, cygwin and various emulators and virtual machines all to no avail.
What has been working so far is that I enabled the 'new' windows developer mode which allowed me to download a Linux bash shell from the windows store. It works for all the regular Linux commands, but doesn't have gcc installed.
When I type in gcc (or gcc --version) in the shell, it prints the following line:
The program 'gcc' is currently not installed. You can install it by typing:
sudo apt install gcc
Which I tried, it then ran through a bunch of installer stuff but consistently seemed to run into errors such as the following:
Err:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libdpkg- >perl all 1.18.4ubuntu1.2
404 Not Found [IP: INSERT IP ADDRESS HERE ]
where the ip address is different on each error line.
It ultimately fails with the following line:
Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
I have tried but again I get the same kinds of errors as above.
I would really like to get gcc working in the Windows/Linux shell as it is working great for everything else, and I'm trying to keep the number of programs on my computer to a minimum.
Does anyone know why this isn't working, or how (if possible) I can make it work?
P.S I do need it to be gcc because of school reasons
For what it's worth: I landed on this SO topic after having a similar issue.
What fixed it for me was to run
sudo apt-get update
sudo apt-get upgrade
I guess the repo URLs were too old, even though my Ubuntu was in a recent version.
I just ran into the same thing attempting to install python-pip. According to this article, this happens when you have the Windows 10 Anniversary Update (older) instead of the Creators update (newer). The solution is to either uninstall and re-install Ubuntu, or upgrade it (from 14.04 to 16.04). I found the upgrade to be simple and painless:
sudo do-release-upgrade
To check what you have, before and after via:
lsb_release -a
I had the same problem. Pinging the IP resulted in no response and visiting the website returned a 404.
I found a ppa with most current GCC and registered the PPA and was able to successfully install GCC with it; ppa website. I used GCC to build some software I wanted that was not found with apt-get.
From their page:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
Try to run Ubuntu application in Windows with an option "Run as Administrator".

IPython3 for Mac OSX

I have Ipython installed but it runs on python 2.7.5 , I also have python 3.3 installed. How can I make changes such that Ipython runs on python 3.3 not 2.7.5?
You need to install pip for Python 3 - it's as easy as going to the pip-installer.org Installation page and following the instructions. Briefly, download get-pip.py and save it someplace, like your Downloads folder. Navigate there in Terminal, and run
sudo python3 get-pip.py
and you should soon have either a pip3 or pip-3.3 command (maybe both, I don't remember). You should now be able to run
sudo pip3 install ipython[all]
and hopefully all the dependencies will be installed as well. If installation chokes, use pip3 to install pyzmq, tornado, pyreadline, jinja2, pygments, and maybe a few others. Make sure you read the docs before you start, so you have an idea of what you're trying to achieve. IPython is large and quite complex, with many moving parts, so in the absence of a package manager (see below) it can take a bit of time before everything is up and running.
The Package Manager Way
There are other options, too. You can install Anaconda, a "Completely free enterprise-ready Python distribution for large-scale data processing, predictive analytics, and scientific computing" with over 100 packages, including IPython and its dependencies. By default, the Anaconda installer gives you Python 2.7, but you can use the conda command to install Python 3.
My personal favorite is to install Python 3 and IPython using MacPorts. Yes, it'll install Py3 all over again, but unless you're really starving for disk space (in which case you probably don't want to be installing large packages like IPython) it's no big deal. Using the port command, once the base MacPorts installation has been put in place, you can just run
sudo port install py33-ipython +pyqt4
and all the other dependencies will be taken care of, (hopefully) flawlessly, without your having to do anything else except wait for a long time while things like PyQt are compiled. You may also need to run sudo port install py33-ipython +notebook if you want the notebook, I don't recall if it's installed otherwise. BTW, you do need X11, Xcode, and the Xcode command-line tools for MacPorts, but they would likely be required if you do the first option as not all packages have binaries available for OS X. The excellent documentation walks you through everything, from installation to using the port command to maintaining your system. I would highly recommend modifying your ~/.profile (or ~/.bash_profile, ~/.bashrc, or equivalent for your shell) to add the MacPorts install directories (/opt/local/bin and /opt/local/sbin, by default) to the front of your path. Just add export PATH='/opt/local/bin:/opt/local/sbin:$PATH' to the end of the file.
A third alternative option is to use Homebrew. It's similar to MacPorts, in that the brew command is a type of package manager like port and conda, but in my experience it doesn't have as many packages, and doesn't quite work as seamlessly as port. However, my observations on StackOverflow, Ask Different and other fora seem to indicate that about 50% of people have great experiences with brew and don't like port, while the other half loves port over brew. YMMV.
I hope this helps. Good luck with your installation!

installing scipy on mac 10.6.8

I try to install scipy on my mac 10.6.8 but always have problem with it. I've installed ipython (sudo /usr/bin/easy_install-2.6 ipython) and numpy (python setup.py build/install), but when I installed scipy by the same way, I got always this error message:
RuntimeError: Running cythonize failed!
Could someone tell me how to solve this problem?
Have you tried using the binaries provided for OSX? That should ensure everything works.
EDIT
The easiest way I've found to keep package dependencies under control is to use MacPorts as much as possible because unlike Homebrew, the packages are designed to work together and dependencies are (almost always) automagically installed when you try to install something.
So, first, install MacPorts using the installer for Snow Leopard. Choose the option to install ports in a unique directory like /opt/local, so they don't conflict with whatever built-in versions the OS depends on. Also, ensure that /opt/local/bin and /opt/local/sbin are added to your $PATH before the system directories like /usr/bin, /bin, /sbin etc. so that when you run python from the command prompt you get the version you want. Your ~/.profile should have something like export PATH="/opt/local/bin:/opt/local/sbin:$PATH as its last line.
After MacPorts has been installed, you may want to restart just for fun to ensure that all of your environment variable are set up properly. Start Terminal.app (or your favorite replacement) and enter which port, which should return /opt/local/bin/port if everything worked correctly. Next, run sudo port selfupdate just to make sure everything is synced properly. Once that is done, we can install python and some modules. port allows you to pass a list of ports to be installed, so a command like sudo port install foo bar baz will install the latest versions of the foo, bar, and baz ports, along with any dependencies they may require, in the correct order. Some ports have binary distributions, and others are compiled as needed, so the first time you run it there may be a lot of dependencies to install. A nice feature of MacPorts is that you can have multiple versions of some packages installed at the same time, and you can switch between them if needed. Also, if port search is giving too many results, the online search engine can help you find what you're looking for.
To get a decent IPython-based Python 2 development environment going, you'll need the following:
python27
py27-ipython
py27-numpy
py27-scipy
py27-matplotlib (if you like drawing pretty pictures, but mainly so you can get pylab)
py27-pandas (DataFrames are your friend!)
and perhaps py27-pyqt4 if you run ipython via the qtconsole option
I'd also install py-pip and py27-distribute so you can install modules on your own if there is no MacPort version.
Finally, if you're a forward-looking person and want to use numpy et al. on Python 3, MacPorts has you covered! There are py32- and py33-based versions of all of the above packages except scipy, which is only py32 for now. However, I was able to install it just fine with pip, although I have a whole bunch of other devel tools on my machine, and I'm running 10.8.2, so YMMV.
Good luck!

Resources