Archive

Archive for November, 2013

gcc error – undefined reference to `__gxx_personality_v0′

November 22, 2013 Leave a comment

Problem:
Got the following error when compiling c program.

$gcc mydice.cc -o dice
/tmp/cc4uHuB6.o:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0′
collect2: error: ld returned 1 exit status

My version of gcc

Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)

Solution:
Turns out that I was using the wrong file extension.
Once I changed it to mydice.c my problem was solved.

This page (below) gives a fairly good reason as to why I was getting the error.
http://todayslearnings.blogspot.com/2007/12/undefined-reference-to-gxxpersonalityv0.html


Source:

https://www.linuxquestions.org/questions/programming-9/gcc-compiler-error-while-compiling-*-c-file-914284/
https://ubuntuforums.org/showthread.php?t=474537

Network Manager – Device not managed

November 20, 2013 Leave a comment

Problem:
Network Manager on debian says “Device not managed”

Solution:
As root edit /etc/NetworkManager/NetworkManager.conf
and change

managed=false to managed=true

restart network manager

/etc/init.d/network-manager restart

Source:
https://wiki.debian.org/NetworkManager

Categories: debian

Setting up network – DNS

November 8, 2013 1 comment

Problem:
I reinstalled my debian system and was not able to browse although I was able to ping other machines on the network. Turned out that my DNS server was not set. I was putting the setting in the DNS section in the Network Connections GUI but clearly I was still doing something wrong.

This is what I would get trying to ping google.

$ ping http://www.google.com
ping: unknown host http://www.google.com

Solution:
1. Installed the resolvconf package.
2. As root, added the following two lines into /etc/resolvconf/resolv.conf.d/tail

nameserver 8.8.8.8
nameserver 8.8.4.4

3. Saved and restarted networking.

That sorted me out.

Source:
http://unix.stackexchange.com/questions/39071/debian-problem-with-dns

Categories: debian Tags: ,

sed – Replace only certain occurances

November 8, 2013 1 comment

Problem:
I needed to change only certain occurances.

Solution:
Best explained with an example.

To change the first one.

$ echo "little kittens on a little boat" | sed 's/little/big/'
big kittens on a little boat

To change the second one only.

$ echo "little kittens on a little boat" | sed 's/little/big/2'
little kittens on a big boat

To change all the rest starting from the second one.

$ echo "little kittens on a little boat eating little fish" | sed 's/little/big/2g'
little kittens on a big boat eating big fish
Categories: sed

Duplicate source list entry

November 3, 2013 Leave a comment

Problem:

I got the following error

W: Duplicate sources.list entry http://ftp.de.debian.org/debian/ wheezy/main i386 Packages (/var/lib/apt/lists/ftp.de.debian.org_debian_dists_wheezy_main_binary-i386_Packages)

Solution:
My /etc/apt/sources.list looks like this:

# deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ – Official i386 DVD Binary-1 20130615-21:54]/ wheezy contrib main

deb cdrom:[Debian GNU/Linux 7.1.0 _Wheezy_ – Official i386 DVD Binary-1 20130615-21:54]/ wheezy contrib main

deb http://security.debian.org/ wheezy/updates main contrib
deb-src http://security.debian.org/ wheezy/updates main contrib

# wheezy-updates, previously known as ‘volatile’
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://ftp.debian.org/debian/ wheezy-updates main contrib
# deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib

# Added on 2013-11-03
deb http://ftp.de.debian.org/debian wheezy main
deb http://ftp.de.debian.org/debian wheezy main non-free

First hit on google unviels that the duplicate entry is caused by main being listed twice as seen below

deb http://ftp.de.debian.org/debian wheezy main
deb http://ftp.de.debian.org/debian wheezy main non-free

I commented out the first one and the problem was solved.

Sources:
http://forums.debian.net/viewtopic.php?f=10&t=76382

Further Reading:
http://www.debian.org/doc/manuals/debian-reference/ch02.en.html

Categories: debian