Archive for category Ubuntu

How to update Linux time zones

time zone map
On May 1st, Venezuela will change its time zone to UTC-4, therefore in Linux you must update your tzdata package to be ready to this change. To do so just just follow these steps:

Debian/Ubuntu

aptitude update
aptitude safe-upgrade tzdata

Red Hat

yum check-update
yum update tzdata

In order to check whether the update has the time zone changes you can run this command:

zdump -v /usr/share/zoneinfo/right/America/Caracas  | grep 2016

/usr/share/zoneinfo/right/America/Caracas  Sun May  1 06:59:59 2016 UT = Sun May  1 02:29:59 2016 VET isdst=0 gmtoff=-16200
/usr/share/zoneinfo/right/America/Caracas  Sun May  1 07:00:00 2016 UT = Sun May  1 03:00:00 2016 VET isdst=0 gmtoff=-14400

Reference: How to check if the Time Zone database


2 Comments

Debmirror problem: gpgv: Can’t check signature: public key not found

NoMirror.jpg

I have a mirror where  Debian and Ubuntu packages are hosted ,so people in the internal network can upgrade their software using this mirror. But the other day I realized it couldn’t sync against the Debian mirror, as described in the article How to build Debian and Ubuntu mirrors using debmirror. When I tried to run the sync script I got an error and it exited with errors.

Symptoms
When running debmirror script, it fails with a error similar to this one:

gpgv: Signature made Wed 17 Jul 2013 04:40:31 PM CST using RSA key ID 473041FA
[GNUPG:] ERRSIG AED4B06F473041FA 1 2 00 1374050431 9
[GNUPG:] NO_PUBKEY AED4B06F473041FA
gpgv: Can’t check signature: public key not found
gpgv: Signature made Wed 17 Jul 2013 04:40:31 PM CST using RSA key ID 46925553
[GNUPG:] ERRSIG 8B48AD6246925553 1 2 00 1374050431 9
[GNUPG:] NO_PUBKEY 8B48AD6246925553
gpgv: Can’t check signature: public key not found
Release signature does not verify.

Cause

Packages are validated using a key, so we can trust what we are downloading from the source repo and what will installed on our computers. Some repositories have a keyrnig with known keys, and it’s likely that a new key signature was added to the Debian/Ubuntu keyring. This can occur  if there is new distro version, and new keys were added, making our keyring out of date (the new keys are missing).

Solution

In order to fix this issue, follow the next steps depending on the distro you are mirroring:

Debian

Update the repository and import the new keys:

aptitude update
aptitude safe-upgrade
gpg --keyring /usr/share/keyrings/debian-archive-keyring.gpg  --export | gpg --no-default-keyring --keyring /var/data/keyrings/debian/trustedkeys.gpg --import

Sidenote: If no keys were added, download the latest debian-archive-keyring package from the repositories, extract it and use those keyrings. Example:

wget http://ftp.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2012.4_all.deb
dpkg -x debian-archive-keyring_2012.4_all.deb  ~
gpg --keyring ~/usr/share/keyrings/debian-archive-keyring.gpg  --export | gpg --no-default-keyring --keyring /var/data/keyrings/debian/trustedkeys.gpg --import

Ubuntu

Download the latest ubuntu-archive-kering package and extrack it,  later use the those keyrings . Example:

wget http://mirror.pnl.gov/ubuntu//pool/main/u/ubuntu-keyring/ubuntu-keyring_2012.05.19_all.deb
dpkg -x ubuntu-keyring_2012.05.19_all.deb ~
gpg --keyring ~/usr/share/keyrings/ubuntu-archive-keyring.gpg --export|gpg --no-default-keyring --keyring /var/data/keyrings/ubuntu/trustedkeys.gpg --import

After this procedure, the sync script will run without problems and it will downloaded the latest updates.

, ,

2 Comments

Mobile repository on Debian

Debian Mobile Repo

If by chances you have a slow connection but in another place have a better connection (school, university, work, etc.) and have a computer with Debian which on the same architecture (x86, x64, etc.)  with almost the same software selection, you can do this little trick to carry part of the downloaded packages:

Computer with good connection

Update and upgrade the computer with good connection:

root@dell~# aptitude update
aptitude safe-upgrade

On Debian and alike distros the downloaded packages are stored in /var/cache/apt/archives, so you can copy the content of that directory into a pen-drive or external hard drive:

cp -r /var/cache/apt/archives /media/usb0

Computer with poor connection

Update  the package list. Despite you have a poor connection , you still need Internet to retrieved the package’s information:

 root@cupcake:~# aptitude update
 root@cupcake:~# aptitude safe-upgrade
 The following packages will be upgraded:
 bind9-host dnsutils evolution-data-server evolution-data-server-common gdm3 gnome-shell gnome-shell-common google-chrome-stable gvfs
 gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-libs host icedtea-netx icedtea-netx-common krb5-locales libbind9-80 libc-bin libc-dev-bin
 libc6 libc6:i386 libc6-dev libc6-i386 libc6-i686:i386 libcairo-gobject2 libcairo2 libcamel-1.2-33 libdbus-glib-1-2 libdns88 libebackend-1.2-2
 libebook-1.2-13 libecal-1.2-11 libedata-book-1.2-13 libedata-cal-1.2-15 libedataserver-1.2-16 libedataserverui-3.0-1 libglib2.0-0
 libglib2.0-0:i386 libglib2.0-bin libglib2.0-data libgssapi-krb5-2 libgssapi-krb5-2:i386 libisc84 libisccc80 libisccfg82 libk5crypto3
 libk5crypto3:i386 libkrb5-3 libkrb5-3:i386 libkrb5support0 libkrb5support0:i386 liblwres80 libperl5.14 libproxy0 libssh-4 libxen-4.1
 libxenstore3.0 locales multiarch-support openssh-client openssh-server perl perl-base perl-modules python python-minimal vim vim-common
 vim-runtime vim-tiny xserver-xorg-video-nouveau
 The following packages are RECOMMENDED but will NOT be installed:
 xserver-xephyr
 73 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 Need to get 103 MB of archives. After unpacking 16.6 MB will be used.
 Do you want to continue? [Y/n/?] n

Here you can see it needs to download 103 MB. Say no by typing “n”, and copy the packages from the pen-drive to  /var/cache/apt/archives/:

# cp -R /media/C6A7-9F3C/archives/* /var/cache/apt/archives/

Now update the package list and try to upgrade the packages one more time:

root@cupcake:~# aptitude update
 root@cupcake:~# aptitude safe-upgrade
 The following packages will be upgraded:
 bind9-host dnsutils evolution-data-server evolution-data-server-common gdm3 gnome-shell gnome-shell-common google-chrome-stable gvfs
 gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-libs host icedtea-netx icedtea-netx-common krb5-locales libbind9-80 libc-bin libc-dev-bin
 libc6 libc6:i386 libc6-dev libc6-i386 libc6-i686:i386 libcairo-gobject2 libcairo2 libcamel-1.2-33 libdbus-glib-1-2 libdns88 libebackend-1.2-2
 libebook-1.2-13 libecal-1.2-11 libedata-book-1.2-13 libedata-cal-1.2-15 libedataserver-1.2-16 libedataserverui-3.0-1 libglib2.0-0
 libglib2.0-0:i386 libglib2.0-bin libglib2.0-data libgssapi-krb5-2 libgssapi-krb5-2:i386 libisc84 libisccc80 libisccfg82 libk5crypto3
 libk5crypto3:i386 libkrb5-3 libkrb5-3:i386 libkrb5support0 libkrb5support0:i386 liblwres80 libperl5.14 libproxy0 libssh-4 libxen-4.1
 libxenstore3.0 locales multiarch-support openssh-client openssh-server perl perl-base perl-modules python python-minimal vim vim-common
 vim-runtime vim-tiny xserver-xorg-video-nouveau
 The following packages are RECOMMENDED but will NOT be installed:
 xserver-xephyr
 73 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 Need to get 2,474 kB/103 MB of archives. After unpacking 16.6 MB will be used.
 Do you want to continue? [Y/n/?]

As you can see, now it needs 2,4 MB,  much less than originally needed and it will last much less in downloading with a poor connection like the Venezuela’s 3G networks (put here your preferred mobile operator’s name).

, ,

4 Comments

How to build Debian and Ubuntu mirrors using debmirror

Debmirror

Here I explain how to set up a mirror for Debian an Ubuntu repositories, on a Debian server. The steps explained next can be found on other sites, except how to deal with the repository’s keyrings. For instance, on the Ubuntu’s tutorial they explain how to install the keyrings assuming the server you are installing the mirror has Ubuntu running, but what if it’s running on a Debian server?

Installing debmirror

As I mentioned, I used debmirror for mirroring both distros. There are other programs, like apt-cacher, but I chose debmirror because I wanted to mirror all Debian and Ubuntu repos. So, in order to install debmirror just type the following as root:

aptitude install debmirror

Installing the keyrings

Now it’s time for installing the repositories’ keyrings. Because I wanted a mirror for Debian and other for Ubuntu, I had to download both keyrings packages and import the keyrings from them:

Debian

To install the keyrings for Debian’s repos the latest debian-archive-keyrings must be downloaded, for instance from testing:

# wget http://ftp.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2012.4_all.deb

Then the package’s content must be extracted in the root’s home directory:

# dpkg-deb -x debian-archive-keyring_2012.4_all.deb ~

And finally import the keyrings:

# gpg --no-default-keyring --keyring /home/repo/keyrings/debian/trustedkeys.gpg --import /root/usr/share/keyrings/debian-archive-keyring.gpg
 gpg: keyring `/home/repo/keyrings/debian/trustedkeys.gpg' created
 gpg: key B98321F9: public key "Squeeze Stable Release Key " imported
 gpg: key 473041FA: public key "Debian Archive Automatic Signing Key (6.0/squeeze) " imported
 gpg: key 65FFB764: public key "Wheezy Stable Release Key " imported
 gpg: key 46925553: public key "Debian Archive Automatic Signing Key (7.0/wheezy) " imported
 gpg: Total number processed: 4
 gpg: imported: 4 (RSA: 4)
 gpg: no ultimately trusted keys found

Ubuntu

On Ubuntu I did something similar. I downloaded the latest ubuntu-keyring package up-to-date, from quantal’s repos:

# wget http://pa.archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-keyring/ubuntu-keyring_2012.05.19_all.deb

Then I proceed to extract the package content in the root’s home directory and import the keyrinngs:

# dpkg-deb -x ubuntu-keyring_2012.05.19_all.deb ~
# gpg --no-default-keyring --keyring /home/repo/keyrings/ubuntu/trustedkeys.gpg --import /root/usr/share/keyrings/ubuntu-archive-keyring.gpg
gpg: keyring `/home/repo/keyrings/ubuntu/trustedkeys.gpg' created
 gpg: key 437D05B5: public key "Ubuntu Archive Automatic Signing Key " imported
 gpg: key FBB75451: public key "Ubuntu CD Image Automatic Signing Key " imported
 gpg: key C0B21F32: public key "Ubuntu Archive Automatic Signing Key (2012) " imported
 gpg: key EFE21092: public key "Ubuntu CD Image Automatic Signing Key (2012) " imported
 gpg: Total number processed: 4
 gpg: imported: 4 (RSA: 2)
 gpg: no ultimately trusted keys found

The debmirror script

On Ubuntu

The script is an adaptation of the the one at Ubuntu’s documentation, I saved as /home/repo/scripts/debian.sh with the following values:

#!/bin/sh
# Don't touch the user's keyring, have our own instead
export GNUPGHOME=/home/repo/keyrings/ubuntu

# Architecture. For Ubuntu can be i386, powerpc or amd64.
arch=i386,amd64

# Minimum Ubuntu system requires main, restricted
# Section (One of the following - main/restricted/universe/multiverse).
section=main,multiverse,universe,restricted

# Release of the system (Quantal, Precise, etc)
release=quantal,quantal-security,quantal-updates,quantal-backports,precise,precise-security,precise-updates,precise-backports

# Server name, minus the protocol and the path at the end
server=us.archive.ubuntu.com

# Path from the main server, so http://my.web.server/$dir, Server dependant
inPath=/ubuntu

# Protocol to use for transfer (http, ftp, hftp, rsync)
proto=http

# Directory to store the mirror in
outPath=/home/repo/mirrors/ubuntu

# Start script

debmirror       -a $arch \
                --no-source \
                --md5sums \
                --progress \
                --passive \
                --verbose \
                -s $section \
                -h $server \
                -d $release \
                -r $inPath \
                -e $proto \

On Debian

For Debian I used other parameters and save it as /home/repo/scripts/debian.sh with this values:

#!/bin/sh

# Don't touch the user's keyring, have our own instead
export GNUPGHOME=/home/repo/keyrings/debian

# Architecture (i386, powerpc, amd64, etc.)
arch=i386,amd64

# Section (main,contrib,non-free)
section=main,contrib,non-free

# Release of the system (squeeze,lenny,stable,testing,etc)
release=squeeze

# Server name, minus the protocol and the path at the end
server=ftp.us.debian.org

# Path from the main server, so http://my.web.server/$dir, Server dependant
inPath=/debian

# Protocol to use for transfer (http, ftp, hftp, rsync)
proto=http

# Directory to store the mirror in
outPath=/home/repo/mirrors/debian

# Start script

debmirror       -a $arch \
                --no-source \
		--md5sums \
		--progress \
		--passive \
		--verbose \
                -s $section \
                -h $server \
                -d $release \
                -r $inPath \
                -e $proto \
                $outPath

Note: On both cases you have to make the scripts executable, check the connection with the chosen servers and check if you have enough space available for hosting the mirrors.

Scheduled job (crontab)

Once the scripts are working, you can create a cron for keep the mirrors synced. For example, to run he scripts at midnight every day you can put the following in the /etc/crontab:

0 0 * * *    root    /home/repo/scripts/debian.sh
0 0 * * *    root    /home/repo/scripts/ubuntu.sh

Publishing the mirrrors

I published the mirror via http with Apache, the web server:

aptitude install apache2

By default on Debian, Apache uses /var/www as root directory. Thus in order to set the mirrors just make the symbolic links to that directory:

# ln -s /home/repo/mirrors/ubuntu /var/www/
# ln -s /home/repo/mirrors/debian /var/www/

Setting the clients

On the client side, you have to edit the /etc/apt/sources.list file according to the Linux version used on the client.

On Ubuntu

For Ubuntu precise (12.04) you have to put something like this in the /etc/apt/sources.list file:

deb http://192.168.1.1/ubuntu/ precise main restricted universe multiverse
deb http://192.168.1.1/ubuntu/ precise-updates main restricted universe multiverse
deb http://192.168.1.1/ubuntu/ precise-backports main restricted universe multiverse
deb http://192.168.1.1/ubuntu/ precise-security main restricted universe multiverse

In this case the IP addresses 192.168.1.1 belongs to the server hosting the mirrors, which were published via http with Apache. Change to other IP or a DNS entry according to your configuration.

On Debian

For Debian Squeeze you must have the following in your /etc/apt/sources.list:

deb http://192.168.1.1/debian squeeze main contrib non-free
deb http://192.168.1.1/debian-security squeeze/updates main contrib non-free

For both cases after doing these changes you have to update the package list:

aptitude update

Once the package list has been updated you can use those repositories.

, ,

17 Comments

What to do after installing Ubuntu 12.04?

ubuntu_logo_black-orange-300x67

I’m sure you were thinking I was tell you: install Debian!…but no, this time I’m going to be more condescend thus I’m going to give you a tip. After installing Ubuntu one thing you can do to feel you are using Debian is open a terminal and type this:

sudo apt-get install aptitude
sudo aptitude update

Now you will be using the Debian’s default console package management .

But what are the differences between aptitude and apt-get / apt-cache?

That doubt was already commented on this article aptitude vs. apt-get

User password vs. root password

Another thing you can do is to assign a password to root

sudo passwd root

After this you can log in as root and forget about sudo, in addition you will separating the installing user from the real system administrator role.

, ,

14 Comments

How to update to Ubuntu 10.10

Ubuntu 10.10

On October 10, 2010 (10/10/10) Ubuntu 10.10 was released, so if you want to update your system to this version you can type the following from a terminal:

update-manager -d

Once you have done this just click on the Upgrade button and follow the wizard.

,

15 Comments

Addinding Ubuntu repos to cron-apt on Debian

cron-apt ubuntu repos

I have an apt-cacher server at home for caching Debian and Ubuntu repos, and the same PC has cron-apt for downloading Debian packages daily, the idea is to have the packages ready to download whenever I want to update them. On the other hand, my sister has a netbook with Ubuntu, but due to cron-apt is set to download only those packages from the distro it’s running by default, in this case Debian, when my sister’s netbook is updated she can’t take advantage of the cache because she has to wait until all packages are downloaded.

The solution is to make cron-apt download Ubuntu packages. Let’s see how to do it…

Adding Ubuntu repos to cron-apt

In order  to add the Ubuntu repos you have to edit the /etc/cron-apt/config file in the following line:

OPTIONS="-o quiet=1 -o Dir::Etc::SourceList=/etc/apt/sources.list.ubuntu10"

Where the  /etc/apt/sources.list.ubuntu10 file must have the Ubuntu repos definitions. In my case, it’s the apt-cacher server:

deb http://192.168.2.100:3142/ubuntu/ lucid main restricted
deb http://192.168.2.100:3142/ubuntu/ lucid-updates main restricted
deb http://192.168.2.100:3142/ubuntu/ lucid universe
deb http://192.168.2.100:3142/ubuntu/ lucid-updates universe
deb http://192.168.2.100:3142/ubuntu/ lucid multiverse
deb http://192.168.2.100:3142/ubuntu/ lucid-updates multiverse
deb http://192.168.2.100:3142/ubuntu/ lucid-security main restricted
deb http://192.168.2.100:3142/ubuntu/ lucid-security universe
deb http://192.168.2.100:3142/ubuntu/ lucid-security multiverse

Ubuntu public keys

You also have to set the public keys, otherwise apt-cacher will send a email with a message like this one:

W: GPG error: http://192.168.2.100 lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5

In order to download and install the public key you have to do the following steps:

gpg --recv-keys 40976EAF437D05B5
gpg --export --armo 40976EAF437D05B5 | apt-key add -

Now next time I update my sister netbook, many of the packages will be ready to download from the local network at home!!

Reference

, ,

No Comments

Switching to Gnome Desktop on Ubuntu Netbook Edition

Ubuntu Netbook Edition - Switching to Gnome Desktop

In the previous version of Ubuntu for netbooks (Ubuntu Netbook Remix)you could switch from the netbook environment to the complete Gnome. This was possible due to a package called desktop-switcher which gives that option. At first sight I thought users of this version were more restricted, but after seeing all option of gdm (the login manager) I realized that package is not needed any more because that option in included in the session selection. I think it makes sense because the Ubuntu Netbook Edition environment is Gnome with different settings to fix small displays.

Choosing the Gnome environment

In order to switch to the complete Gnome just do this:

  1. If you already logged in, select “Close session” on the menu you use to shutdown your netbook.
  2. Provide your user name.
  3. After typing your user name, choose the Gnome session.
  4. Provide you password
  5. After logging in you will see your complete Gnome environment loaded.

Choosing the Ubuntu Netbook Edition environment

If you want to go back to your Ubuntu Netbook Edition environment,you can repeat the procedure an select Ubuntu Netbook Edition or Ubuntu Netbook Edition 2D session.

Some issues

While testing this option I switched to Gnome and later to the Ubuntu Netbook Edition one more time, and although the latter loads witho problems, the Gnome‘s panel also does. The only way I found to load the Ubuntu Netbook Edition environment was by restarting the graphic server (if it sounds weird or you don’t know how to do it, by rebooting you netbook will be enough).

,

15 Comments

Best Ubuntu mirror

Select best mirror / Seleccionar el mejor Mirror

When you install Ubuntu you’ll never be asked about the mirror from where the packages will be downloaded because Ubuntu select a mirror according to your location or country. Therefore, after installing Ubuntu Netbook Edition the default mirror was http://ve.archive.ubuntu.com. If you come from Debian you will try to install apt-spy to find your best mirror, but Ubuntu doesn’t have such a tool, so how do you set a best mirror according to the best response?

Selecting the best mirror

Go to System > Software Sources. There click on Download from, and select Other. A new window will appear from where you can choose a new server, or click on the Select Best Server button as is shown in the above picture. By clicking that button Ubuntu will performance a test to determine your best server. In my case it was one located in USA.

Testing the best mirror on Ubuntu / Probando el mejor mirror en Ubuntu

Does it really work?

To update my Ubuntu Netbook Edition with the Venezuelan server it said it will last an hour and forty five minutes, but using the new server it lasted just 21 minutes!!

, ,

5 Comments

How to delete the Examples folder on Ubuntu Netbook Edition

Examples folder

Ubuntu Netbook Edition comes by default with an example folder where you’ ll find example files for video, audio and other documents. It’ s interesting to have it for testing purposes but when you know every thing is alright, and for making some room on the screen, you can delete that Example folder.

But this folders is not such, it’s sort of a shortcut. In order to delete it open a terminal in your home directory and list its content:

rebeca@germione:~$ ls -l

drwxr-xr-x 2 rebeca rebeca 4096 2010-07-15 13:16 Download
drwxr-xr-x 2 rebeca rebeca 4096 2010-07-15 13:16 Documents
drwxr-xr-x 2 rebeca rebeca 4096 2010-07-15 13:16 Desktop
-rw-r--r-- 1 rebeca rebeca  179 2010-07-15 12:58 examples.desktop
drwxr-xr-x 2 rebeca rebeca 4096 2010-07-15 21:26 Pictures
drwxr-xr-x 2 rebeca rebeca 4096 2010-07-15 13:16 Music
drwxr-xr-x 2 rebeca rebeca 4096 2010-07-15 13:16 Templates
drwxr-xr-x 2 rebeca rebeca 4096 2010-07-15 13:16 Público
drwxr-xr-x 2 rebeca rebeca 4096 2010-07-15 13:16 Videos

This shortcut is made by examples.desktop file. Just delete this file:

rebeca@germione:~$ rm examples.desktop

Now the that folder Examples shouldn’t appear any more:

Examples folder no more

, ,

10 Comments