About My Blog



Whenever I get stuck doing something - the time comes to venture in the world of internet to find solution. In most cases I do find the solution, solve my problem and go on with my life. Then one day I am faced with the same problem. But now - I can't remember how the hell I solved it the first time. So the cycle begins again. Then I thought, what if I can remember all the those things? So here it is, my Auxiliary Memory. I decided to save all the problems and their solution in this blog so that I can get back to them when I need them. And the plus point is - so can everybody else.
Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Friday, November 7, 2014

How to add software source in ubuntu from behind proxy

The easiest way to add new software source to ubuntu is using the apt-add-repository command from terminal.
apt-add-repository ppa:user/repository
However, recently when I tried to add a ppa using the above mentioned command from behind proxy, it didn't work. So I had follow a longer way to add the software source.
First goto launchpad.net and search for the software whose source you want to add. Then click on the Technical details about this PPA link, which will show you source.list entries. Select you ubuntu version from the dropdownlist/combobox. Then copy the first line. Picture shown below -
Now you can add this copied source to your ubuntu software sources in two ways. One way is to run the following command from you terminal -
apt-add-repository 'deb http://myserver/path/to/repo stable myrepo'
Or you can just use the gui. For that open up and goto Edit>Software Sources...>Other Sources and clicking the add button. Paste the link on the textbox and click Add Source.
This will only add the source to your ubuntu. But for ubuntu to trust the source you need to add the gpg key of that source. For that you need to first save the key to you machine. Click on the Signing Key link shown in first picture. Then click on the first link on the next page. This will show you some text. Now from that page copy only the part shown below -
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.4
Comment: Hostname: keyserver.ubuntu.com

mI0ETnBj5QEEAOOa9QvcobiU9ulHUlwX/MOzhA2aH52zQ4kIk58PBk+5wM1gjLMUEhXAjJu7
0pQLsm2Te7q25ljYyV6LAN0f0FaFA1fx9P9oQF5dS208Gb5S4b434GieMmgAOC8Tidq
s8c8zTsaufaRaqPrZEGgj9q/dQb88mua5cM9DswHABEBAAG0I0xhdW5jaHBhZCBQUEEgZm9y
IEViZXJoYXJkIEJlaWxoYXJ6wECACIFAk5wY+UCGwMGCwkIBwMCBhUIAgkKCwQWAgMB
Ah4BAheAAAoJEEi2gD6Dnsu+AlIEAIbeU2/crDbYp/wRrpBsvBw44UtIKHYsRXLESWF2+kYk
8jQBfjnRUxoC3PFaoMlWaWJh7Jv5MWkSb0aws9DaRzFVcNu6/SDoj7t2/mXLgnDMQryw9CkL
gYcUcNlWvrgKicgqo9/v2L2FH2393i9blMJz7216j28NGjgoKeOLTWdv
=viCD
-----END PGP PUBLIC KEY BLOCK-----
Now create a text file and save this text with any name in you machine. Again you can do it two ways. First on goto the saved file location from terminal and run the below command -
sudo apt-key add <file>
Or second way, goto the Software Sources window as mentioned above. Then goto the Authentication tab, click on Import Key File.. button and browse and select the save file. This will add the signing key of the source to your ubuntu.
Now all that's left is to update you package repository with sudo apt-get update and you are ready to install any software from the new source you added.

Tuesday, November 4, 2014

How to upgrade kernel on Ubuntu

You can find out which kernel version you are running by opening up a terminal and running the following command:
uname -r

To find out which version is the latest go to www.kernel.org.
To install the latest version you need to download the images. For that go to kernel.ubuntu.com/~kernel-ppa/mainline and open up the folder that matches the version number you found in www.kernel.org.
You need to download three files from the list. For 32 bit they are -
linux-headers-***-generic_***_i386.deb
linux-headers-***_***_all.deb
linux-image-***-generic_***_i386.deb

For 64 bit they are -
linux-headers-***-generic_***_amd64.deb
linux-headers-***_***_all.deb
linux-image-***-generic_***_amd64.deb

After downloading the files copy them to a temporary folder with no other deb files and run the following command from terminal -
sudo dpkg -i *.deb

This will install the new kernel. Restart you machine and uname -r to confirm you are running the latest kernel.
To uninstall the old kernel you could just use ubuntu-tweak. Install it with -
sudo apt-get install ubuntu-tweak

After installing ubuntu tweak, run it and open janitor. Do a clean and it will uninstall the old kernel for you.