Posts Tagged Debian

Installing Java on Debian

centOS 6

If you need to install Oracle Java on Debian, you can follow the next steps once the binary file had been downloaded from Oracles’s download page:

Once it has been downloaded, proceed to extract it into the /opt directory:

# tar xvzf jdk-8u45-linux-x64.tar.gz

First let’s check the current java version:

# java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

Here you can see it points to OpenJDK’s 1.7.0_79 version. Now let’s add a path to the version to use:

# update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_45/bin/java 1

Last line adds the /opt/jdk1.8.0_45/bin/java path to /usr/bin/java java  binary, in other words, it creates a symbolic link to use in case that options is chosen. Let’s set an alternative that points to the new path:

# update-alternatives --config java
  Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 auto mode
 1 /opt/jdk1.8.0_45/bin/java 1 manual mode
 2 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
 3 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
 Enter to keep the current selection[+], or type selection number: |

After choosing the option 1, check the java version one more time:

# java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Now the binary points to the Oracle’s version. You can check it with the symbolic links:

# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 jun  9  2014 /usr/bin/java -> /etc/alternatives/java

# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 25 jun 15 09:21 /etc/alternatives/java -> /opt/jdk1.8.0_45/bin/java

 

 


,

3 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

How to build a Debian packge in 3 steps

 Debian pakage

There are several ways of making a Debian package. In this article you will learn how to create it using equivs tools, to create a simple package (for example, as when you want to package a binary). Without more ado let’s see the procedure:

Requisites

You will need to install the tools to use, in particular:

aptitude install equivs

Procedure

As an example you will be packaging two scripts and an cron job in a .deb file. These are the steps:

  1. Create the template. To do so use the equivs-control command, which generates a base file that you can edit later by removing the comments to the options you want to use. To generate the template use this command:
$ equivs-control backups
  1. Edit the template, which in this example was called  backups. Fill in with the needed data for creating the package by removing the comment in the fields you want to edit:
### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source:
Section: miscD
Priority: optional
Homepage: www.lgallardo.com
Standards-Version: 3.9.2
Package: backups
Version: 1.1
Maintainer: Luis M. Gallardo D. <lgallard@gmail.com>
# Pre-Depends:
# Depends:
# Recommends:
# Suggests:
# Provides:
# Replaces:
Architecture: all
# Copyright:
# Changelog:
Readme: README.Debian
# Extra-Files:
Files: backup.sh /usr/local/bin/
 restore.sh /usr/local/bin/
 backups-cron /etc/cron.d/
Description: Backups scripts
 Scripts for backuping up files on Debian systems

Before you build thee package you must create the files backup.sh, restore.sh, backups-cron and README.debian, the latter to avoid equivs to use the generic README.

  1. Build the package. Just write this command:
$equivs-build backups

This will build a package called backups_1.1_all.deb.  In order to check the package’s info you can type the following:

$ dpkg -I backups_1.1_all.deb
 new debian package, version 2.0.
 size 2396 bytes: control archive=582 bytes.
 25 bytes, 1 lines conffiles 
 302 bytes, 12 lines control 
 322 bytes, 5 lines md5sums 
 Package: backups
 Version: 1.1
 Architecture: all
 Maintainer: Luis M. Gallardo D. <lgallard@gmail.com>
 Architecture: all
 Readme: README.debian
 Installed-Size: 42
 Section: misc
 Priority: optional
 Homepage: www.lgallardo.com
 Description: Backups scripts
 Scripts for backuping up files on Debian systems
That's it. You have build your first Debian package!

,

3 Comments

Installing SubDownloader on Raspberry Pi

SubDownloader 2.0.14 (on raspberrypi)

I’ve already install XBMC as my media center  and also qbittorrent Web as my “download” center. But one piece was missing: a subtitle downloader program. I knew about subdownloader, so I decide to give it a try on my Rasberry Pi but it is not on Raspbian repos…what can you do?

Easy, just add  Debian’s official repos for Sid and install it. Remember, Debian supports lot of architecture, even armhf. Let’s see how to do it…

Installing

  1. Edit file /etc/apt/sources.list to include sid’s repos:
    deb http://ftp.debian.org/debian/ sid main contrib non-free
  2. Update the package list:
    aptitude update
  3. Install SubDonwloader:
    aptitude install subdownloader
  4. Edit file /etc/apt/sources.list to delete sid’s repos (it’s enough by commenting the line with #):
    #deb http://ftp.debian.org/debian/ sid main contrib non-free
  5. Update the package list one more time:
    aptitude update

Now you can run the program on your Rasberry Pi locally or using ssh…but keep in mind it would run a little slow. Enjoy it!

Reference: SubDownloader project page

, , , ,

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

Installing CrossOver on Debian x64

CrossOverCrossOver is a tool that let you install many popular Windows applications and games on PC running Linux. It was developed by Codewevers, and they highlight the fact it’s easy, you can afford it, you won’t need any Windows licenses and you will have Windows applications integrated smoothly on Linux, just click and run.

After this free ad for Codeweavers, I must say CrossOver it’s just a Wine with steroids  I mean, it’s Wine with the needed libraries that makes some Windows programs work without having to deal with those dependencies, and also they organize the installed software into “bottles” which it’s just Wine’s environments with different hard disks settings.

If you are interested in downloading the trial version you an do it here.

The problem

It sounds good until the intro, but when I tried to install it on Debian x64 I ran into this problem:

# gdebi /home/lgallard/Downloads/ia32-crossover_12.1.0-1_amd64.deb
Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 Building data structures... Done
 Building data structures... Done
Requires the installation of the following packages:
 lib32asound2 lib32gcc1 lib32nss-mdns lib32z1 libc6-i386
 Run Windows applications like MS Office
 CrossOver Linux makes it possible to run Windows productivity applications
 such as Microsoft Office, and Quicken, and also lets you play Windows games
 like Skyrim and World of Warcraft.
 Do you want to install the software package? [y/N]: y
  [...]

 (Reading database ... 118461 files and directories currently installed.)
 Unpacking ia32-crossover (from .../ia32-crossover_12.1.0-1_amd64.deb) ...
 dpkg: dependency problems prevent configuration of ia32-crossover:
 ia32-crossover depends on ia32-libs; however:
 Package ia32-libs is not installed.
dpkg: error processing ia32-crossover (--install):
 dependency problems - leaving unconfigured
 Errors were encountered while processing:
 ia32-crossover

I seemed weird to me that gdebi couldn’t install the dependencies, so I tried to install the package by hand:

# aptitude install ia32-libs
 The following NEW packages will be installed:
 ia32-libs{b}
 The following partially installed packages will be configured:
 ia32-crossover
 0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
 Need to get 114 kB of archives. After unpacking 114 kB will be used.
 The following packages have unmet dependencies:
 ia32-libs : Depends: ia32-libs-i386 which is a virtual package.
 The following actions will resolve these dependencies:
Remove the following packages:
 1) ia32-crossover
Keep the following packages at their current version:
 2) ia32-libs [Not Installed]
Accept this solution? [Y/n/q/?] Y
 The following packages will be REMOVED:
 ia32-crossover{a} lib32asound2{u} lib32gcc1{u} lib32nss-mdns{u} lib32z1{u} libc6-i386{u}
 0 packages upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
 Need to get 0 B of archives. After unpacking 163 MB will be freed.
 Do you want to continue? [Y/n/?]
 (Reading database ... 120124 files and directories currently installed.)
 Removing ia32-crossover ...
 Removing lib32asound2 ...
 Removing lib32gcc1 ...
 Removing lib32nss-mdns ...
 Removing lib32z1 ...
 Removing libc6-i386 ...

Current status: 0 broken [-1], 36004 new [-1].

But when I checked the status of the package I realized it wasn’t installed:

# aptitude search ia32-libs
 p ia32-libs - Transitional package to migrate ia32-libs to multiarch
 p ia32-libs-gtk - Transitional package to migrate ia32-libs-gtk to multiarch

The solution

Checking the dependencies CrossOver tries to install I remember one must add the i386 branch. To do so you have to do this:

# dpkg --add-architecture i386
# aptitude update

When the package list is updated, and you try to install CrossOver one more time you will see the package required grows:

# gdebi /home/lgallard/Downloads/ia32-crossover_12.1.0-1_amd64.deb

Reading package lists... Done Building dependency tree Reading state information... Done Building data structures... Done Building data structures... Done

Requires the installation of the following packages:

esound-common freeglut3:i386 gcc-4.7-base:i386 ia32-libs ia32-libs-i386:i386 lesstif2:i386 lib32asound2 lib32gcc1 lib32nss-mdns lib32z1 libacl1:i386 libaio1:i386 libasound2:i386 libasyncns0:i386 libattr1:i386 libaudio2:i386 libaudiofile1:i386 libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libbsd0:i386 libc6-i386 libc6-i686:i386 libc6:i386 libcaca0:i386 libcap2:i386 libcomerr2:i386 libcups2:i386 libcurl3:i386 libdb5.1:i386 libdbus-1-3:i386 libdirectfb-1.2-9:i386 libdrm-intel1:i386 libdrm-nouveau1a:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libesd0:i386 libexif12:i386 libexpat1:i386 libffi5:i386 libflac8:i386 libfltk1.1:i386 libfontconfig1:i386 libfreetype6:i386 libgcc1:i386 libgcrypt11:i386 libgd2-xpm:i386 libgdbm3:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libglapi-mesa:i386 libglu1-mesa:i386 libgnutls26:i386 libgpg-error0:i386 libgphoto2-2:i386 libgphoto2-l10n libgphoto2-port0:i386 libgpm2:i386 libgssapi-krb5-2:i386 libice6:i386 libidn11:i386 libieee1284-3:i386 libjack-jackd2-0:i386 libjbig0:i386 libjpeg62:i386 libjpeg8:i386 libjson0:i386 libk5crypto3:i386 libkeyutils1:i386 libkrb5-3:i386 libkrb5support0:i386 liblcms1:i386 libldap-2.4-2:i386 libltdl7:i386 liblzma5:i386 liblzo2-2:i386 libmpg123-0:i386 libncursesw5:i386 libnspr4-0d:i386 libnspr4:i386 libnss3-1d:i386 libnss3:i386 libodbc1:i386 libogg0:i386 libopenal1:i386 libp11-kit0:i386 libpam0g:i386 libpciaccess0:i386 libpng12-0:i386 libpopt0:i386 libpulse0:i386 librtmp0:i386 libsamplerate0:i386 libsane-extras-common libsane-extras:i386 libsane:i386 libsasl2-2:i386 libsasl2-modules:i386 libsdl1.2debian:i386 libselinux1:i386 libsigc++-2.0-0c2a:i386 libslang2:i386 libsm6:i386 libsndfile1:i386 libsqlite3-0:i386 libssh2-1:i386 libssl1.0.0:i386 libstdc++5:i386 libstdc++6:i386 libsvga1:i386 libsysfs2:i386 libtasn1-3:i386 libtdb1:i386 libtiff4:i386 libtinfo5:i386 libts-0.0-0:i386 libusb-0.1-4:i386 libuuid1:i386 libv4l-0:i386 libv4lconvert0:i386 libvorbis0a:i386 libvorbisenc2:i386 libvorbisfile3:i386 libwrap0:i386 libx11-6:i386 libx11-xcb1:i386 libx86-1:i386 libxau6:i386 libxaw7:i386 libxcb-glx0:i386 libxcb-render-util0:i386 libxcb-render0:i386 libxcb1:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxft2:i386 libxi6:i386 libxinerama1:i386 libxml2:i386 libxmu6:i386 libxmuu1:i386 libxp6:i386 libxpm4:i386 libxrandr2:i386 libxrender1:i386 libxslt1.1:i386 libxss1:i386 libxt6:i386 libxtst6:i386 libxv1:i386 libxxf86vm1:i386 odbcinst1debian2:i386 uuid-runtime xaw3dg:i386 zlib1g:i386

 Run Windows applications like MS Office
CrossOver Linux makes it possible to run Windows productivity applications
such as Microsoft Office, and Quicken, and also lets you play Windows games
like Skyrim and World of Warcraft.
Do you want to install the software package? [y/N]:y

After accepting, all needed packages will be downloaded (they are many) and CrossOver will be installed correctly.

References:

,

No Comments

Enabling the equalizer in Amarok

Amarok - Equalizer issue

If by change you try to set Amarok’s equalizer and see the message shown above, just install the gstreamer backend for phonom:

# aptitude install phonon-backend-gstreamer

After that you can use the equalizer as shown here:

Amarok - Equalizer solved

You can also apply the presets according to the genre or modify the values as you which.

,

2 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

Installing SubDownloader on Debian

In my last article I explained how to watch movies on Android from a multimedia server like MediaTomb, and one things I commented was the possibility of use subtitles in the video player. But, where can we get those subtitles from? There are specialized pages that offer different subtitles versions, just by looking up the exact title movie, download it and try it to see if it is synced with the video.

Can’ t this process  be automated? Yes, the answer is SubDownloader, and is what I will explain how to install on Debian.

Installing

  1. Edit file  /etc/apt/sources.list to include sid’s repos:
    deb http://ftp.debian.org/debian/ sid main contrib non-free
  2. Update the package list:
    aptitude update
  3. Install SubDonwloader:
    aptitude -t sid install subdownloader
  4. Edit file /etc/apt/sources.list to delete sid’s repos (it’s enough by commenting the line with #):
    #deb http://ftp.debian.org/debian/ sid main contrib non-free
  5. Update the package list one more time:
    aptitude update

Now you can run the program by going to Applications > Multimedia > SubDownloader

Reference: SubDownloader project page

,

No Comments