Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Tuesday, July 22, 2014

Update source.list on Ubuntu

http://askubuntu.com/questions/329450/e-some-index-files-failed-to-download-they-have-been-ignored-or-old-ones-used

  • How to solve this trouble in Ubuntu 12.04
Open a terminal (CTRL+ALT+T) and issue the following commands in order.
SOLUTION:
sudo cp /etc/apt/sources.list ~/ 
sudo wget "http://pastebin.com/raw.php?i=uzhrtg5M" -O /etc/apt/sources.list 
sudo apt-get update
sudo rm /etc/apt/sources.list.d/ubuntu-extras.list
sudo apt-get update
This solution is not general. It is specific to the sources.list file of the Original Poster.
The second command which starts with wget downloads and replaces the sources.list file with a specific for Precise (Ubuntu 12.04) sources.list file. See the file in raw format by visiting this page.
The fourth command removes the ubuntu-extras.list file which had an impact/conflict with another file of the same, so we removed it to avoid the error
W: Duplicate sources.list entry
see comments above.

Friday, January 24, 2014

Forget root password on ubuntu

Use a Ubuntu disk, and boot into the rescue mode. Choose to run a shell. Then you can gain the root privilege.

Network Configuration on Ubuntu

Sample configuration file:

@sr2s17:~$ cat /etc/network/interfaces 
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto eth2
iface eth2 inet static
address 192.168.0.37

netmask 255.255.255.0


I use interface eth0 as the external network and eth2 as the internal network. 

After you install Ubuntu, the interfaces may not be up. Although you can use ethtool to detect if the interfaces are physically connected by cables, This approach is not accurate on Ubuntu (works on CentOS). 

For example, I know there are six interfaces on my server
eth0 and eth1 are on a broadcom network card, and eth2, 3, 4, 5 are on a Intel network card. 
I plugged the Ethernet cable to the eth2 interface, so I just need to write the script into /etc/network/interfaces, which help me to enable the eth2. Next, I run a $ /etc/init.d/networking restart

Thursday, January 23, 2014

NFS on ubuntu

root@sr2s17:/home/fengwei# mount -a
mount: unknown filesystem type 'nfs4'

root@sr2s17:/home/fengwei# apt-get install nfs-common

https://help.ubuntu.com/community/SettingUpNFSHowTo

Fix: sudo: setresuid(ROOT_UID, ROOT_UID, ROOT_UID): Operation not permitted

This is a known bug for Ubuntu 12.04 with LDAP

It is caused by libgcrypt in GnuTLS that used by LDAP for SSL connections.

Solution:
Use libnettle instead of libgcrypt, and recompile gnutls26

Since you don't have sudo, you can use Ubuntu disk boot into rescue mode.
1) create the root user
or
2) gain sudo by disabling the ldap  $ mv /etc/ldap.conf /etc/ldap.conf.backup; $ reboot

After you have the root privilege, boot your machine into normal disk.  The following commands disabled ldap when fixing this bug.

Step 1. Install necessary packages

sudo apt-get install libgmp-dev devscripts 
sudo apt-get build-dep libgnutls26

Step 2. Download and install nettle

$ wget http://www.lysator.liu.se/~nisse/archive/nettle-2.1.tar.gz 
$ tar zxvf nettle-2.1.tar.gz 
$ cd nettle-2.1 
$./configure --with-gmp 
$ make 
$ sudo make install
$ sudo reboot ( I have a compiling issue with gnutls26 if don't reboot here)

Step 3. Compile and build gnutls26

$ sudo apt-get source gnutls26
$ cd gnutls26-2.12.14
$ sudo vim debian/rules
remove --with-libgcrypt

$ sudo debuild -i -uc -us -b 
$ cd .. 
$ dpkg -i libgnutls26_2.12.14*.deb

Source: 
https://jeroenvda.eu/2012/05/03/cannot-setuid-after-ubuntu-12-04lts-upgrade-when-using-ldap-accounts/
http://askubuntu.com/questions/106642/how-to-fix-sudo-setreuidroot-uid-user-uid-operation-not-permitted-error

Create a local root user on Ubuntu

$ sudo passwd root

enter the password. if you want to become a root, then you can just type $ su

It aways good idea to create one, because the sudo may not be functional, such as this bug:

http://askubuntu.com/questions/106642/how-to-fix-sudo-setreuidroot-uid-user-uid-operation-not-permitted-error

Friday, January 10, 2014

Fix nobody issue on CentOS/Ubunut using LDAP and NFS

CentOS

vim /etc/idmapd.conf
add Domain=example.com
restart the services
/etc/init.d/rpcidmapd restart and /etc/init.d/nfs restart

http://lfhck.com/question/100876/centos-6--ldap--nfs-file-ownership-is-stuck-on-nobody

Solved!
I happened to notice this line in /var/log/messages on my NFS server when I was attempting to mount an export from the remote client:
Feb 28 15:54:02 storage1 rpc.idmapd[1651]: nss_getpwnam: name 'nobody' does not map into domain 'localdomain'
This caused me to look at the first few lines of /etc/idmapd.conf:
[General]
#Verbosity = 0
# The following should be set to the local NFSv4 domain name
# The default is the host's DNS domain name.
#Domain = local.domain.edu
I then added Domain=subdomain.mycompany.com under the commented out "Domain" line. Saved, exited and then ran/etc/init.d/rpcidmapd restart and /etc/init.d/nfs restart.



Ubuntu

vim /etc/idmapd.conf
add Domain=example.com
reboot

Tuesday, August 6, 2013

Install httperf on Untuntu

sudo apt-get install httperf

if you get error:
E: Unable to locate package httperf

You need to update your soruce.list

1. generate source list from website:
Generate sources.list : http://debgen.simplylinux.ch/
Don't forget to add contrib and non-free

2. Copy paste source list to /etc/apt/source.list

3. run apt-get update

4. install httperf

More info: 
http://forums.debian.net/viewtopic.php?f=10&t=64694

Thursday, June 13, 2013

fix touchpad sensitive issue on ubuntu of Chromebook


http://craigerrington.com/blog/fixing-touchpad-issues-on-arm-chromebook-chrubuntu/

mkdir ~/backup sudo mv /usr/share/X11/xorg.conf.d/* ~/backup/ cd /usr/share/X11/xorg.conf.d/ (you can issue an ls here to make sure the dir is empty if you like) sudo wget http://craigerrington.com/chrome/x_alarm_chrubuntu.zip sudo unzip x_alarm_chrubuntu.zip sudo rm x_alarm_chrubuntu.zip
NOTE: This will set up a UK keyboard, follow these simple steps to change it:
Example:
sudo vi /usr/share/X11/xorg.conf.d/10-keyboard.conf

reboot

Ubuntu file system becomes read only

My Ubuntu on Chromebook has this problem, and it fixed by $fsck -Af

Source Link is:
http://askubuntu.com/questions/197459/read-only-file-system

The filesystem will usually go into read-only while the system is running if there is a filesystem consistency issue. This is specified in fstab as errors=remount-ro and will occur when a FS access fails or an emergency read-only remount is requested via Alt+SysRq+U. You can run:
sudo fsck -Af
to force a check of all filesystems. As the other very good answer states, looking at dmesg is also very helpful.


Tuesday, August 21, 2012

Install Ubuntu on Chromebook


Install Ubuntu on Samsung series 5:
http://www.devchronicles.com/2011/10/installing-ubuntu-on-samsung-series-5.html

I followed the instructions on my Samsung series 5 550, it works as well.

Another new instruction for installing:
http://chromeos-cr48.blogspot.com/2012/04/chrubuntu-1204-now-with-double-bits.html?

Wednesday, July 18, 2012

Install Custom Kernel on Ubuntu

Please read: https://help.ubuntu.com/community/Kernel/Compile/

Basically, it only supports kernel from Ubuntu source. It doesn't support mainline kernel from kernel.org.
The source code from mainline kernel could successfully compile, but it cannot boot.
The experiment I had is: automatic restart after loading mainline kernel.

Experiment enviroment:
Ubuntu 11.10 + mainline kernnel 2.6.19


Thursday, April 14, 2011

ftrace trace-cmd for Ubuntu

Why do we need trace-cmd:
http://stackoverflow.com/questions/5658170/how-ther-linux-kernel-process-the-write-to-sys-power-state

Download Place:
http://packages.ubuntu.com/maverick/trace-cmd

Thursday, December 16, 2010

login as root on Ubuntu

First of all. you cannot login as root after you installed Ubuntu.

But you could do: $sudo su, which will give you root permission. but you are not root user.

you also could login as root by setting the root password
$sudo passwd
you could enter your root password. Then you could login as root.

Remember, there is a difference between
$su
and
$sudo su

$su has more privilege than $sudo su