Category: bash

How to fix “There is no public key available for the following key IDs”

When I run the command

sudo apt-get update

I got this warning:

There is no public key available for the following key IDs: [key_id]

To fix:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [key_id]

The command above downloads the missing key using the hexadecimal numbers given the [key_id] with apt-key. After running apt-key to download the missing [key_id], any packages from that repositories will be considered trusted.

Recursively delete all files with a given extension

Example: I want to delete all .xmp files recursively:

find . -type f -name '*.xmp' -delete

Example: I want to delete any file or directory which contains .tmp in their names recursively:

find . -name '.tmp' -delete

Xubuntu: how to create a local repository

I had the necessity to create a local repository in order to handle the upgrade of local packages, as if they were from official repositories.
 
Create your own repository folder

sudo su
mkdir /usr/local/packages

 
Create and edit the script file which will upgrade the packages’ list every time we add a new one

touch packages_list_upgrade.sh
cat packages_list_upgrade.sh
 
#!/bin/sh
DIR="."
# open each .deb file and create a zipped list file
CMD="dpkg-scanpackages $DIR | gzip > $DIR/Packages.gz"

eval $CMD
chmod +x packages_list_upgrade.sh

 
Update /etc/apt/source.list with the new location

echo "deb file:/usr/local packages" >> /etc/apt/source.list

 
Copy your packages into the folder and run the script

./packages_list_upgrade.sh

 
Now you can install/remove/manage your local packages using command line or through Synaptic

Update Gnome icon cache

When a new icon theme is installed and selected, some applications do not show all their icons. It’s mostly because the icon cache is not up-to-date.

You can fix this problem, without logging out, by rebuilding the GTK+ icon cache using the following command:

gtk-update-icon-cache -f /usr/share/icons/<THEME_NAME>

I am Xubuntu/XFCE user but this should apply also for any GTK environment

WordPress Themes