The first instructions on Google's '
Command line configuration for APT' page are
Run this command as root:
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
The problem I faced on Ubuntu is that you can't change user to root by using
su - root. All you can do is prepend
sudo in front of your commands. The above command calls
gpg which makes modifications to files in
/etc/apt folder. Even with
sudo prepended to the
wget command, I was getting the following error
gpg: no writable keyring found: eof
gpg: error reading `-': general error
gpg: import from `-' failed: general error
I didn't know how to use gpg. So I used a simple workaround. The
wget command will modify three files in
/etc/apt folder as well as create a new temporary file. So I modified the permissions of those files as well as the directory
cd /etc/apt
sudo chmod 777 trusted.gpg
sudo chmod 777 secring.gpg
sudo chmod 777 trustdb.gpg
sudo chmod 777 .
After changing the permissions you can run
sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
It will output
OK to the shell. Now revert back the permissions on the files and folder
sudo chmod 644 trusted.gpg
sudo chmod 644 trustdb.gpg
sudo chmod 644 secring.gpg
sudo chmod 755 .
Next you can follow the instructions from Google's page as well as here. I have put these instructions for the sake of completeness, they are no different from the ones on Google.
Update apt-get
sudo apt-get update
Add the following rule to
/etc/apt/sources.list, or if your distro has the
/etc/apt/sources.list.d/ directory, add it to a file called
google.list in that directory:
# Google software repository
deb http://dl.google.com/linux/deb/ stable non-free
Then use apt as usual.
sudo apt-get update
sudo apt-get install picasa
That was the workaround. Later on I found the solution. The
wget command is piped to
apt-key command. So the simple solution is to prepend
sudo in front of
apt-key command as well, and the whole command will succeed.
sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -