how to uninstall opam...? - ocaml

UPDATE:
I've fixed the problem, but I'm still confused.
Or, rather, there wasn't a problem...apparently the fact that the opam--version command still worked didn't prevent me from re-running all the installation commands and getting things to work again.....?
I'm really confused as to why I'm not having more problems than I am. Does the version command still work even if opam is deleted...somehow?? Do I have two distinct copies of opam on my computer, but somehow they aren't interfering? I definitely ran the installation twice....I feel like something should be going wrong.....could someone please explain what's going on?
Below is my initial question:
I've messed up some switch somewhere
(the error is
ERROR] No config file found for switch
with-coq. Switch broken?
if one of you is genius enough to fix this directly lol)
and am trying to delete everything and start over. Opam won't go away, though. I've tried
opam remove --force
as per here and
opam uninstall
as per here, both from my home directory.
I've also tried forcibly deleting the .opam directory with rm -rf.
After all this, the command opam --version command still works. How do I get the damn thing to go away?
Thank you all.

If you want to remove the opam binary, you have to uninstall it the way you installed it, either using your package manager, or, if you installed manually, run which opam and then delete the file that prints.
The opam switches in ~/.opam are data, they are separate from opam the command. This is true of all package managers and almost all programs, in general.

To remove ocaml version including all its packages, use this command ...
opam switch remove <version>

Related

Cannot place vmware-ovftool in the uninstall list

I tried to reinstall Ovftool into my Centos and replace it with an old version but getting a message which I don't know how to fix it.
command to uninstall it
vmware-installer -u vmware-ovftool
command to install it again
sudo ./VMware-ovftool-4.3.0-7948156-lin.x86_64.bundle
Message received :
Cannot place vmware-ovftool 4.3.0 in the uninstall list.
Any advice?
In this case it's better to use the built-in yum remove <package> this may remove conflicting config.
Using rpm -e <package> is even better, if available, because it guarantees to remove remaining config. It will back up modified config files, but these won't interfere with future installations.
The package name for vmware-ovftool is open-vm-tools on my Ubuntu box, it may be worth checking that too, it could be the same on RHEL/CentOS/Oracle Linux as well.
Simply install another bundle and everything back to normal.

gdb os x sierra 10.12.3 not working

the problem is already known, that gdb doesn't work with OS X Sierra anymore.
This is really annoying, since I researched already about the solution, and there were some solutions, but they apparently don't work anymore. I tried to use the .gdbinit file solution and the disable csrutil solution, both doesn't work.
Sooo my question is: Does anyone know how to fix it in 10.12.3 ?
Thank you very much!
Looks like there still isn't a solution to this. I don't think "use LLDB instead of GDB" is the ultimate solution. So I went ahead and built a fairly basic docker container which contains the very basics (g++ and gdb).
Here is the Docker Hub container, and the the Dockerfile is on this Github repo.
This solution at least allows you to use GDB on your Mac via a couple simple commands. And since the folder you're coding on is mounted, as soon as you hit save, all your changes appear automatically.
Hope this helps someone else out there.
So thanks to Basile Starynkevitch, who just gave me the idea to update gdb
SOLUTION:
You simply have to update gdb for the latest version (which is 7.12.1 currently). Assuming you have installed Homebrew:
That's what I did:
brew update
brew remove gdb
brew install gdb
It has now updated to the latest version.
Now codesign gdb again with the cert that you used before.
sudo killall taskgated
codesign -fs gdb-certi /usr/local/bin/gdb
launchctl load /System/Library/LaunchDaemons/com.apple.taskgated.plist
Last step is still to use the workaround to create the .gdbinit file:
nano ~/.gdbinit
-> set startup-with-shell off
Debugging works for me now :) (OS X Sierra 10.12.3 - gdb 7.12.1).
UPDATE:
Apparently it will fix certain problems, but not the whole problematic itself. It will still cause errors. Honestly, my solution: When you can: Switch to LLDB and another IDE (Netbeans does not support LLDB). Or use Linux. I currently use Ubuntu with a stick on my MacBook Pro.
None GDB 7.11 or 7.12.1 will not work on Sierra 10.12.4 In short it's because of Apple security upgrade. We need to wait for re-enabling when some new version will shows up.
Easy WA is to use LLDB as a debugger for now. Sample instructions here
Another LLDB instruction here
I found that gdb 7.12.1 did not work for me either. I do not think it includes the crucial commit 82b19a4d2f9c9e8d56f to gdb made on the 9th Nov 2016.
I was able to get the gdb 8.0 development branch to work, however.
Download with, e.g.
git clone --depth 1 --branch gdb-8.0-branch git://sourceware.org/git/binutils-gdb.git
Then go into the checked-out directory
cd binutils-gdb
I have macports so (a) wanted to link to macports libraries and (b) wanted to avoid putting stuff in /usr/local so configured with
./configure prefix=$HOME LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/include"
make -j8
make install
=> puts gdb executable into ~/bin; (static) libraries into ~/lib; documentation into ~/share
Then follow André's tip above to do the code signing; though it will now be
codesign -fs gdb-certi ~/bin/gdb

Cannot install utop on RHEL 5.0

Having successfully installed opam and having switched to 4.01.0 version of compiler I am struggling to install utop. Installation is failing at 'conf-ncurses.1' step.
Running 'opam depext' does not reveal much, saying that 'no extra dependencies' need to be installed. Switching to latest stable compiler, and then installing utop fails with the same problem. The *.err and *.out files are empty, hence not revealing any problem.
On my box I also have ncurses-devl and pkgconfig installed (see rpm output below)
Below is the screenshot of what I can see (hopefully it give us enough information). Any ideas where to look at ?:
Screehshot
First of all, SO is not an issue tracker and it is better to report this issue to the package maintainers. The following command will reveal URLs for the issue trackers:
opam show conf-ncurses | grep bug-reports
opam show utop | grep bug-reports
Second, your output is not at sync with what I'm seeing in the opam-repository. At the current HEAD there is no check pkg-config ncurses at all, as it was removed three days ago. So, if you indeed have ncurses-devel package installed, then you need just to update opam, with
opam update

How to upgrade a single package?

I did opam update and then opam upgrade, and now OPAM wants to upgrade 10 packages to more recent versions.
However, for fear of breaking something inadvertently, I'd like to upgrade a single package, without touching the others. This package has no dependencies and it seems that none of the other packages depends on it.
However, doing opam upgrade <package> results in the same thing as opam upgrade, that is, OPAM wants to upgrade all 10 packages, not just the one I want.
I even tried opam install <package>.<new version>, but it also wants to upgrade everything at once.
Is there a way to upgrade just this single package, without touching the rest? In theory nothing should break, but in practice it often happens...
I found out that doing
opam reinstall <package>.<new version>
allows me to obtain what I want, that is, install only package <package> and its dependencies, without upgrading unrelated packages.
OPAM emits a warning ([WARNING] <package>.<new version> is not installed.), but it proposes me to install it anyway.
Afterwards, despite some warnings about the destination directory not being empty (due to the already installed previous version), OPAM was able to install only the desired package, without upgrading everything.
Notice that the same thing happens if I try to install a new package: because my previous opam update added several packages to the update list, trying to install anything via opam install will trigger the "update everything" algorithm, while opam reinstall won't.
I don't know if this is undesired behavior, but if so, I hope that it will remain available in future OPAM versions, or that there will be a way to ignore unrelated upgrades.
Edit: as indicated in this OPAM Github issue, using --criteria=paranoid or --criteria=-changed,-notuptodate can also help with not modifying anything else.

Installing PostgreSQL and pyscopg2 on Snow Leopard

I'm still a complete beginner in the field of web development and I'm trying to set up the Django environment. I'm reading "the definitive guide to django" to start my practice.
I'm running Snow Leopard (10.6.2) on a macbook 2.1GHz. It came with Python 2.6.1. Since Snow Leopard cam with Python 2.6.1 preinstalled, so I didn't do any extra set up. Maybe it needs more setup, please let me know. But I've ran it, and it works.
I installed django straight right from the book. I've ran it, and so far it works.
The Database configuration is the one stifling me.
I tried installing MySQL with MySQLdb module for python, but it had complications with the difference between 32 & 64 bit architecture (either mysql had 64 and python had 32 OR vice versa; Either way, I couldn't figure it out). I've read many forums and tinkered with it for hours, still couldn't fix it and I just gave up.
So I tried the next best thing (or so I thought), Let's try to set up Postgre instead. So, I went to the official Postgre website and picked the Mac OS X installment package. I download it, extract it, and all it had was an ".app" installer and a "README". I ran the installer, blah blah blah, I followed the instruction, it did this, it did that. At the end, apparently Postgre is installed.
I didn't feel completely sure if it was installed, so I searched around the internet for some answers. Well, I found the official documentation for installing Django for Mac, but the steps to install
Postgre was completely different. Maybe the ".app" installer did most of the configuration listed in those steps, I don't know.
Then I went to the terminal and type in:
psql -V
(to check which version of Postgre I just installed)
AND
sudo -u postgres pg_ctl start
(to run the database)
'psql' or 'pg_ctl' commands could not be found. To me, this is kind of saying Postgre was not installed or there are some setup I still need to do.
So I started looking at the first steps of installing Postgre from the given instruction by Django (link above). From the instruction it says to edit the '~/.profile', even after unhiding all the files and directories, I still can't find it under my user directory.
At this point I'm just kind of frustrated and don't know where to go. I was wondering if I can get some direction/tips/howto/anythingreallyatthispoint.
I can't really install psycopg2 until I have Postgre running, but from the looks of it, it doesn't look so bad to install it (or so I hope).
Many Many thanks in advance for any help ^_^
-Tri
If you're just getting started, I would try sqlite first. It's file based, so there is almost no configuration. Later, if you want to upgrade to a real database, then it won't be any harder than what you're attempting now.
the easiest way to install these apps would be via macports (http://www.macports.org/). in my experience, the installation was fast and clean. the geodjango installation documentation has a good section on this: http://geodjango.org/docs/install.html#macports.
I suspect the only problem you are having is not setting path. Add this to your ~/.bash_profile:
export PATH=/Library/PostgreSQL/8.4/bin:$PATH
Now you should be able to run the command line tools like psql.
I just spent a couple hours going through multiple different walkthroughs. This was the one that eventually worked:
first install postgress with the dmg:
http://www.enterprisedb.com/products-services-training/pgdownload#osx
then follow this tutorial:
http://stubblog.wordpress.com/2009/06/07/installing-psycopg2-on-osx/
then put this in terminal export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib:$DYLD_LIBRARY_PATH
And I'm pretty sure those were the important parts of what I did..
if you get errors try sudo pip uninstall psycopg2 then sudo pip install psycopg2
if you keep getting errors about ".... something < 10.4", reinstall pip. I think I used something like brew install python to update python... if you don't have homebrew, get it. I'm pretty sure that's what got rid of that error.. it may have been a manual install of pip3 though.
Sorry this is all over the place, it should get you a bit closer though. At least, if you (like me) have had none of the other tutorials work.