Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Tuesday, 27 January 2015

Update manager gets stuck on a package download

If the update manager gets stuck at a package download and then you can't use "apt-get install" due to errors like dpkg locked and you try rm /var/lib/../../lock and it still does not work then do the following
check the output of this command: 
ps aux | grep http 
This will result in 2 or 3 lines with the second column of each line being the pid of the process if the process is doing its job. If the result is just 1 line, say the last phrase being grep http or something, the updates are not being downloaded/installed. Its safe to kill the update manager 
To do this: 
run: ps aux | grep update and note the pid of the update-manager being the second column after your user name in the 2/3 line list of output. Let the pid of update-manager be pid 
Kill this process by running: 
kill -9 pid 
If operation is not permitted, try with sudo, but take care that you don't kill any other process. Note the pid of update-manager carefully.
Source - http://ubuntu.aspcode.net/view/635400140124705175239668/how-to-cancel-update-manager-downloading-flashplugin-installer

Monday, 8 September 2014

Solution : System time conflict between ubuntu and windows.

1. Open terminal

2. type the command
~$ gksudo gedit /etc/default/rcS

3. In the gedit window, edit the BIOS clock section to what is below.
 # assume that the BIOS clock is set to UTC time (recommended)
UTC=no
4. Save and exit.
Source. 

Sunday, 10 August 2014

Running a python script from the python shell

To run a script from the python shell or the python prompt, use the command

>> execfile('filename.py')

To clear the screen, do the following,
>>import os
>>os.system("clear")

These are for systems running Ubuntu. Not sure if this will work for other operating systems.

Saturday, 7 December 2013

vimrc file : set tab spaces and get line number

To custom configure the vim interface , we have to edit the vimrc file.

Find it at
$ cd  /usr/share/vim/
$ sudo gedit vimrc

In that file add the following lines

set number 
set tabstop=4


Save and close.