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.

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.

No comments:

Post a Comment