I messed up with libstdc++6 - libstdc++

I messed up with /usr/lib/libstdc++6 while trying to install teamspeak. So there I am, I have no more libstdc++6 file and I'm trying everything I can. I cannot use apt-get or aptitude anymore (I'm on debian). What can I do?

Download the deb package for your system directly from http://packages.debian.org/squeeze/libstdc%2B%2B6 (you may need to use a different computer, or a simple tool like curl or wget).
If dpkg is still working, use dpkg -i <.deb file> to install it.
Otherwise, the deb may be extracted using ar x <.deb file>, and the data files can be extracted with tar xvzf data.tar.gz. You can then mv the files from ./usr/lib into the right place.

Related

FSL installation in Ubuntu FAILED message

I am a traditional Windows user and therefore you have to excuse me for my lack of experience with other OS. I installed Ubuntu in order to install FSL in my computer (seems the Windows installation failed so I tried this). However, the download goes right, but at the end it says "[FAILED] Unable to unpack FSL".
How can I solve it?
Thanks a lot
First of all, this is not a programming question. If it can still be moved to AskUbuntu (or SuperUser) it may be better appreciated.
In Ubuntu the easy way to install software is through the package manager. This is by far the least amount of work and installs binary packages in default locations (FSL is in the path straight away), plus it takes care of all the dependencies!
FSL is in the NeuroDebian repository, and if you add this to one of your 'software sources' then you can install it via Ubuntu's package manager, APT:
go to https://neuro.debian.net and find out how to add the right repository, e.g.
$ wget -O- http://neuro.debian.net/lists/focal.de-fzj.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
$ sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
update the list of packages APT can find:
$ sudo apt update
install the fsl packages you want, e.g.
$ sudo apt install fsl-5.0 fsl-harvard-oxford-cortical-lateralized-atlas

PHP 7.0 with IMAP and MAILPARSE on MAC OS

On 31st of March Homebrew moved some of their formulas around. For this reason I can't find a way to make my PHP 7 work with the following extensions:
mailparse
imap
I have tried many examples found on the internet, such as
brew install php70 --with-imap
brew install -s php70 --with-imap
brew install php70-imap
not mentinoning the brew update, brew upgrade, brew tap etc...
But none of them seems to work as brew php does not work with options anymore.
I had even less options trying to install without homebrew, as I am using nginx in my computer, not apache.
Does any one had this problem and was able to fix it?
Thanks!
After some troubleshooting, it finally worked..... That's how I did:
First I installed the following formulas:
brew install imap-uw
brew install openssl
After that, I downloaded the same version of the pho is running in my computer on http://php.net/downloads.php (saved it in Downloads folder).
In terminal I did.
cd ~/Downloads/php-7.0.29/ext/imap
./configure --with-imap=/usr/local/Cellar/imap-uw/2007f --with-kerberos --with-imap-ssl=/usr/local/opt/openssl
make
where /usr/local/Cellar/ is the path where the formula imap-uw is installed.
P.S this configure file does not accept --with-openssl or --with-openssl-dir or +openssl. I waist a lot of time trying that.
it created a folder modules/ with the imap.so file inside.
Then I created a folder and moved the imap file to inside it
mkdir /usr/local/opt/php70-imap
mv modules/imap.so /usr/local/opt/php70-imap/imap.so
After that just add the extension to the php.ini file
extension="/usr/local/opt/php70-imap/imap.so"
Restart the server and imap will work fine!
For mailparse I had to use pecl.
First I followed this tutorial https://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/
After pecl was installed properly in my computer, I ran the following code:
cd
pecl download mailparse
tar -xvf mailparse-3.0.2.tgz
cd mailparse-3.0.2/
phpize
./configure
sed -i 's/#if\s!HAVE_MBSTRING/#ifndef MBFL_MBFILTER_H/' ./mailparse.c
make
mkdir /usr/local/opt/php70-mailparse
sudo mv modules/mailparse.so /usr/local/opt/php70-mailparse/mailparse.so
I got the piece of code above here https://github.com/php-mime-mail-parser/php-mime-mail-parser . However the line sed -i 's/#if\s!HAVE_MBSTRING/#ifndef MBFL_MBFILTER_H/' ./mailparse.c has not worked properly. I ran make anyways and it worked.
After that just add the extension to the php.ini file
extension="/usr/local/opt/php70-mailparse/mailparse.so"

What is alternative to -dpkg for Mac?

I'm trying to use dpkg command but in Mac OS X it doesn't seem to work for me
dpkg -scanpackages -m . /dev/null -->Packages
-bash: dpkg: command not found
dns:Administrator$ man dpkg
No manual entry for dpkg
I wonder how can I use the dpkg in Mac??
Or homebrew Link
brew install dpkg
The macports version has a lot of dependencies and takes forever.
If all you want to do is see what is in the package then unar and untar it.
ar -x package.deb
You should then have a debian-version, control.tar.gz and data.tar.gz in your current directory. The files the package would add will be in data.tar.gz. The package description will be in a file named control inside the control.tar.gz file.
tar -tvzf data.tar.gz
You will first have to install dpkg. In my opinion the easiest way to do this is to first install macports which is a high level packet manager for os x and then use macports to install dpkg.
Installing macports: http://www.macports.org/install.php
Once installed you can run sudo port install dpkg.
Then you can use dpkg on the command line.
"dpkg" utility can be provided by Fink.

Having trouble configuring sphinx search

I downloaded sphinx 0.9.9 to my ubuntu 10.4 machine.
I ran cd ~/sphinx-0.9.9 then ./configure, then make then make install.
Make install gave me errors so I ran sudo make install and then there were no errors.
I am going through the documentation. I am at 2.6. Quick Sphinx usage tour.
It says:
All the example commands below assume that you installed Sphinx in /usr/local/sphinx, so searchd can be found in /usr/local/sphinx/bin/searchd.
I do have /usr/local/sphinx but there is no bin folder in it, just etc and var.
It then also says:
there's example.sql sample data file to populate that table with a few documents for testing purposes:
$ mysql -u test < /usr/local/sphinx/etc/example.sql
but inside my /usr/local/sphinx/etc/ folder there is only one file: sphinx.conf
and according to the docs that file shouldnt event exist yet, it should be sphinx.conf.dist
I tried to install sphinx 6 months ago and gave up. I am only revisiting it now, so maybe there is a chance I screwed something up then that is giving me problems now. Is there a way to remove everything sphinx so I can try again fresh? Or does anyone have any other ideas what is going on?
You might try installing the package version of sphinx; it's slightly older, but should work as well. As far as compiling problems, you might check the SphinxSearch forum.
Looks like you have installation issue here.
The output of make command will be helpful.
I would suggest reinstalling sphinx, just delete the folder/or run sudo make uninstall, where you had installed the sphinx, and then following these steps to reinstall sphinx
Update and Grab dependencies. Run these commands in order to get the files you need to install Sphinx.
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install build-essential
sudo apt-get install libmysqlclient15-dev
Download source, Untar and prep. Here's where it gets a bit complicated. You'll need to extract the source, change into the directory and configure Sphinx. Do that with these commands.
tar xvzf sphinx-0.9.8.1.tar.gz
cd sphinx-0.9.8.1/
./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql
Make and Install Sphinx
make
sudo make install

What's the opposite of 'make install', i.e. how do you uninstall a library in Linux?

While running
./configure --prefix=/mingw
on a MinGW/MSYS system for a library I had previously run
'./configure --prefix=/mingw && make && make install'
I came across this message:
WARNING: A version of the Vamp plugin SDK is already installed. Expect worries and sorrows if you install a new version without removing the old one first. (Continuing)
This had me worried. What's the opposite of 'make install', i.e. how is a library uninstalled in Linux? Will 'make clean' do the job, or are there other steps involved?
make clean removes any intermediate or output files from your source / build tree. However, it only affects the source / build tree; it does not touch the rest of the filesystem and so will not remove previously installed software.
If you're lucky, running make uninstall will work. It's up to the library's authors to provide that, however; some authors provide an uninstall target, others don't.
If you're not lucky, you'll have to manually uninstall it. Running make -n install can be helpful, since it will show the steps that the software would take to install itself but won't actually do anything. You can then manually reverse those steps.
If sudo make uninstall is unavailable:
In a Debian based system, instead of (or after*) doing make install you can run sudo checkinstall to make a .deb file that gets automatically installed. You can then remove it using the system package manager (e.g. apt/synaptic/aptitude/dpkg). Checkinstall also supports creating other types of package, e.g. RPM.
See also http://community.linuxmint.com/tutorial/view/162 and some basic checkinstall usage and debian checkinstall package.
*: If you're reading this after having installed with make install you can still follow the above instructions and do a dpkg -r $PACKAGE_NAME_YOU_CHOSEN afterwards.
If you have a manifest file which lists all the files that were installed with make install you can run this command which I have from another answer:
cat install_manifest.txt | xargs echo rm | sh
If you have sudo make install you will need to add a sudo to your uninstall:
cat install_manifest.txt | xargs echo sudo rm | sh
How to uninstall after "make install"
Method #1 (make uninstall)
Step 1: You only need to follow this step if you've deleted/altered the build directory in any way: Download and make/make install using the exact same procedure as you did before.
Step 2: try make uninstall.
cd $SOURCE_DIR
sudo make uninstall
If this succeeds you are done. If you're paranoid you may also try the steps of "Method #3" to make sure make uninstall didn't miss any files.
Method #2 (checkinstall -- only for debian based systems)
Overview of the process
In debian based systems (e.g. Ubuntu) you can create a .deb package very easily by using a tool named checkinstall. You then install the .deb package (this will make your debian system realize that the all parts of your package have been indeed installed) and finally uninstall it to let your package manager properly cleanup your system.
Step by step
sudo apt-get -y install checkinstall
cd $SOURCE_DIR
sudo checkinstall
At this point checkinstall will prompt for a package name. Enter something a bit descriptive and note it because you'll use it in a minute. It will also prompt for a few more data that you can ignore. If it complains about the version not been acceptable just enter something reasonable like 1.0. When it completes you can install and finally uninstall:
sudo dpkg -i $PACKAGE_NAME_YOU_ENTERED
sudo dpkg -r $PACKAGE_NAME_YOU_ENTERED
Method #3 (install_manifest.txt)
If a file install_manifest.txt exists in your source dir it should contain the filenames of every single file that the installation created.
So first check the list of files and their mod-time:
cd $SOURCE_DIR
sudo xargs -I{} stat -c "%z %n" "{}" < install_manifest.txt
You should get zero errors and the mod-times of the listed files should be on or after the installation time. If all is OK you can delete them in one go:
cd $SOURCE_DIR
mkdir deleted-by-uninstall
sudo xargs -I{} mv -t deleted-by-uninstall "{}" < install_manifest.txt
User Merlyn Morgan-Graham however has a serious notice regarding this method that you should keep in mind (copied here verbatim): "Watch out for files that might also have been installed by other packages. Simply deleting these files [...] could break the other packages.". That's the reason that we've created the deleted-by-uninstall dir and moved files there instead of deleting them.
99% of this post existed in other answers. I just collected everything useful in a (hopefully) easy to follow how-to and tried to give extra attention to important details (like quoting xarg arguments and keeping backups of deleted files).
Depending on how well the makefile/configure script/autofoo magic of the program in question is the following might solve your problem:
make uninstall
The problem is that you should execute this on the source tree of the version you've got installed and with exactly the same configuration that you used for installing.
make clean generally only cleans built files in the directory containing the source code itself, and rarely touches any installed software.
Makefiles generally don't contain a target for uninstallation -- you usually have to do that yourself, by removing the files from the directory into which they were installed. For example, if you built a program and installed it (using make install) into /usr/local, you'd want to look through /usr/local/bin, /usr/local/libexec, /usr/local/share/man, etc., and remove the unwanted files. Sometimes a Makefile includes an uninstall target, but not always.
Of course, typically on a Linux system you install software using a package manager, which is capable of uninstalling software "automagically".
The "stow" utility was designed to solve this problem: http://www.gnu.org/software/stow/
There is no standard unfortunately, this is one of the perils of installing from source. Some Makefiles will include an "uninstall", so
make uninstall
from the source directory may work. Otherwise, it may be a matter of manually undoing whatever the make install did.
make clean usually just cleans up the source directory - removing generated/compiled files and the like, probably not what you're after.
Make
Make is the program that’s used to install the program that’s compiled from the source code. It’s not the Linux package manager so it doesn’t keep track of the files it installs. This makes it difficult to uninstall the files afterward.
The Make Install command copies the built program and packages into the library directory and specified locations from the makefile. These locations
can vary based on the examination that’s performed by the configure script.
CheckInstall
CheckInstall is the program that’s used to install or uninstall programs that are compiled from the source code. It monitors and copies the files that are installed using the make program. It also installs the files using the Linux package manager which allows it to be uninstalled like any regular package.
The CheckInstall command is used to call the Make Install command. It monitors the files that are installed and creates a binary package from them. It also installs the binary package with the Linux package manager.
Replace "source_location.deb" and "name" with your information from the Screenshot.
Execute the following commands in the source package directory:
Install CheckInstall sudo apt-get install checkinstall
Run the Configure script sudo ./configure
Run the Make command sudo make
Run CheckInstall sudo checkinstall
Reinstall the package sudo dpkg --install --force-overwrite source_location.deb
Remove the package sudo apt remove name
Here's an article article I wrote that covers the whole process with explanations.
Method 1
From the source folder:
#make uninstall
Method 2
If there is no uninstall procedure:
open install_manifest.txt (created by #make install)
remove all the directories/files listed
remove any remaining files you missed:
#xargs rm < install_manifest.txt
remove any hidden directories/files:
$rm -rf ~/.packagename
Remove the source folder.
Method 3
If none of the above options work, view the install procedure:
#make -n install
and reverse the install procedure:
#rm -rf all directories/files created
Example
For example, this is how to uninstall nodejs, npm, and nvm from source:
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
which you can do using any of the above methods.
I know of few packages that support "make uninstall" but many more that support make install DESTDIR=xxx" for staged installs.
You can use this to create a package which you install instead of installing directly from the source. I had no luck with checkinstall but fpm works very well.
This can also help you remove a package previously installed using make install. You simply force install your built package over the make installed one and then uninstall it.
For example, I used this recently to deal with protobuf-3.3.0.
On RHEL7:
make install DESTDIR=dest
cd dest
fpm -f -s dir -t rpm -n protobuf -v 3.3.0 \
--vendor "You Not RedHat" \
--license "Google?" \
--description "protocol buffers" \
--rpm-dist el7 \
-m you#youraddress.com \
--url "http:/somewhere/where/you/get/the/package/oritssource" \
--rpm-autoreqprov \
usr
sudo rpm -i -f protobuf-3.3.0-1.el7.x86_64.rpm
sudo rpm -e protobuf-3.3.0
Prefer yum to rpm if you can.
On Debian9:
make install DESTDIR=dest
cd dest
fpm -f -s dir -t deb -n protobuf -v 3.3.0 \
-C `pwd` \
--prefix / \
--vendor "You Not Debian" \
--license "$(grep Copyright ../../LICENSE)" \
--description "$(cat README.adoc)" \
--deb-upstream-changelog ../../CHANGES.txt \
--url "http:/somewhere/where/you/get/the/package/oritssource" \
usr/local/bin \
usr/local/lib \
usr/local/include
sudo apt install -f *.deb
sudo apt-get remove protobuf
Prefer apt to dpkg where you can.
I've also posted answer this here
Make can tell you what it knows and what it will do.
Suppose you have an "install" target, which executes commands like:
cp <filelist> <destdir>/
In your generic rules, add:
uninstall :; MAKEFLAGS= ${MAKE} -j1 -spinf $(word 1,${MAKEFILE_LIST}) install \
| awk '/^cp /{dest=$NF; for (i=NF; --i>0;) {print dest"/"$i}}' \
| xargs rm -f
A similar trick can do a generic make clean.
Preamble
below may work or may not, this is all given as-is, you and only you are responsible person in case of some damage, data loss and so on. But I hope things go smooth!
To undo make install I would do (and I did) this:
Idea: check whatever script installs and undo this with simple bash script.
Reconfigure your build dir to install to some custom dir. I usually do this: --prefix=$PWD/install. For CMake, you can go to your build dir, open CMakeCache.txt, and fix CMAKE_INSTALL_PREFIX value.
Install project to custom directory (just run make install again).
Now we push from assumption, that make install script installs into custom dir just same contents you want to remove from somewhere else (usually /usr/local). So, we need a script.
3.1. Script should compare custom dir, with dir you want clean. I use this:
anti-install.sh
RM_DIR=$1
PRESENT_DIR=$2
echo "Remove files from $RM_DIR, which are present in $PRESENT_DIR"
pushd $RM_DIR
for fn in `find . -iname '*'`; do
# echo "Checking $PRESENT_DIR/$fn..."
if test -f "$PRESENT_DIR/$fn"; then
# First try this, and check whether things go plain
echo "rm $RM_DIR/$fn"
# Then uncomment this, (but, check twice it works good to you).
# rm $RM_DIR/$fn
fi
done
popd
3.2. Now just run this script (it will go dry-run)
bash anti-install.sh <dir you want to clean> <custom installation dir>
E.g. You wan't to clean /usr/local, and your custom installation dir is /user/me/llvm.build/install, then it would be
bash anti-install.sh /usr/local /user/me/llvm.build/install
3.3. Check log carefully, if commands are good to you, uncomment rm $RM_DIR/$fn and run it again. But stop! Did you really check carefully? May be check again?
Source to instructions:
https://dyatkovskiy.com/2019/11/26/anti-make-install/
Good luck!

Resources