apt-get update error due to armhf - linux

While installing CUDA on Ubuntu, I ran the following command in the terminal:
sudo sh -c 'echo "foreign-architecture armhf" >> /etc/dpkg/dpkg.cfg.d/multiarch'
The command failed and when I do sudo apt-get update, it gives me a whole bunch of failed to fetcherrors. My CUDA installation however, succeeded. How can I revert it back, so that I don't get errors when I update?

In my case,
sudo dpkg --remove-architecture armhf
If you have annoying dpkg: error: cannot remove architecture 'armhf' currently in use by the database, consider remove armhf packages which you'll get from dpkg -l | grep armhf command

you need to delete the entry "foreign-architecture armhf" from "/etc/dpkg/dpkg.cfg.d/multiarch" file.

first:
sudo apt-get remove --purge `dpkg --get-selections | grep armhf | awk '{print $1}'`
then
sudo dpkg --remove-architecture armhf

Related

Getting type echo is not known when installing cassandra on debian

I have a vagrant box up running hashicorps' precise 64 (which is ubuntu I believe). I am installing kong. I have installed kong but now need to install cassandra since kong uses that as a data center. I am following this guide:
http://cassandra.apache.org/download/
I couldn't find the cassandra.sources.list file inside the /etc/apt/sources.list.d/ directory so I created that file and inserted the following:
echo "deb http://www.apache.org/dist/cassandra/debian 22x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
but when I update the repository by sudo apt-get update, I get the following error: Type 'echo' is not known on line 1 in source list /etc/apt/sources.list.d/cassandra.sources.list
Any ideas? Im compeltely new to debian and linux based OS's.
You dont have to copy the line in your file, it is a command that you execute. so directly execute the command from your bash system and it will update the right file for you
$ echo "deb http://www.apache.org/dist/cassandra/debian 22x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
If you really want to create and update the /etc/apt/sources.list.d/cassandra.sources.list file, you just need to add the line as
deb http://www.apache.org/dist/cassandra/debian 22x main
After this you can safely run the update to install cassandra
$ sudo apt-get update
$ sudo apt-get install cassandra

can not install apache dpkg was interrumpted

Someone who has any idea of why and how to fix this error?
and after executing the commands of the end
dpkg --configure -a
shows the following
First try doing the following:
sudo dpkg-reconfigure grub-pc
then select the correct disk (/dev/sda/) when prompted. In that way, if the error does come back again try the following solution:
sudo grub-install /dev/sda
then
sudo update-grub

completely uninstall r linux

I am trying to update my version of R on linux mint, however broken dependencies are stopping me doing this. after trying everything such as adding repos from Cran, sudo apt-get update, I still cannot install the latest version of R.
MY question is how to i completely remove R from my machine, so that I can restart. I have tried :
sudo apt-get remove r-base
however when I run R it still works:
laptop$ R
R version 2.13.1 (2011-07-08)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)
and doesn;t seem to be removed at all.
I want a clean, fresh install, but I don't think I am removing R properly
The R binary (well, front-end script) is part of the r-base-core package which contains the core R system.
The package r-base is a so-called virtual package which exists to just pulls other packages in. Removing it does not remove any parts of the R system --- for which you need to remove r-base-core.
You might want to check on all currently installed R packages.
You can list all packages whose name starts with "r-" like this:
dpkg -l | grep ^ii | awk '$2 ~ /^r-/ { print $2 }'
To uninstall all of them, pipe the output to xargs apt-get remove:
dpkg -l | grep ^ii | awk '$2 ~ /^r-/ { print $2 }' | xargs apt-get remove --purge
dpkg -l | grep ^ii | awk '$2 ~ /^r-/ { print $2 }' | sudo xargs apt-get remove --purge -y
Worked for me on Ubuntu 14.04. Note sudo addition to the previous suggestion by others.
At your Linux command line, try:
dpkg --get-selections | grep "^r\-"
This will list R packages installed on your system. You can then delete them by name.
Hopefully this proves useful.
In addition to running:
sudo apt-get remove r-base
sudo apt-get remove r-base-core
try also:
sudo apt purge r-*
The following does the job especially if you want to update your R version.
sudo apt-get remove r-base-core

Remove packages contain specific word in name

In Linux (Fedora), how I see all the installed packages which contain a certain words in the package name. Then, remove all these packages installed.
Assuming you are using a debian-based Linux (like Ubuntu or Mint, for example), you can do like this to search for mysq:
dpkg -l | grep mysq
and to get only the names
dpkg -l | grep mysq | awk '{print $2}'
if you want remove all packages, containing a specific word, you don't need to pipe lists through grep or whatever. Just type
$ sudo yum remove "*word*"
If you want to review list of such packages before removing, then type
$ rpm -qa "*word*"
That's it.
Fedora is an RPM-based distribution. So you'll want to use the rpm or yum commands.
To list installed: yum list installed | grep <name> or rpm -a | grep <name>
To remove a package: rpm -e <package-name> or yum remove <package-name>
Sources:
Fedora RPM Guide
Fedora yum wiki
in linux, you can install programs in a variety of places. Most of the time, your rpm on your distro is responsible for removing all of the bits and pieces of a program. One solution, although this is fraught with danger, is to grep your usr/bin like this:
ls /usr/bin || grep 'some package name'
and pipe that to an rm-rf ... 'shuddurs'
A safer bet though is to just use apt-get uninstall 'someApp' much safter

Checking for installed package for bash

I need a script that will check whether packages are installed for apache2, mysql and php.
Example output:
apache2 .... ok
mysql .... ok
php ... not installed
Packages are not necessarily named the same on different distributions, and querying for their presence depends on the package manager in use.
Debian (dpkg):
dpkg-query -W -f='${Package}\n' apache2 mysql-server php5 2>/dev/null
Fedora (RPM):
rpm -q --qf '%{NAME}\n' httpd mysql-server php 2>/dev/null
Gentoo (Portage):
equery --quiet list www-servers/apache:2 dev-lang/php dev-db/mysql
Assuming APT:
dpkg -l | grep -i apache2
etc.
For CentOS (will only show the ones that are installed):
yum list installed | egrep -i 'apache|mysql|php'

Resources