Tag: ubuntu

  • Canon printer and scanner in Ubuntu

    Canon Printer Driver & ScanGear MP For Ubuntu 14.04
    December 5, 2014

    Canon scangear for Ubuntu 14.04

    Below devices are supported:

    • bjf9000, bjf900, bjs300, bjs500, bjs700 series
    • e500, e510, e600, e610 series
    • i250, i255, i550, i560, i850, i860, i950, i990 series
    • ip100, ip1800, ip1900, ip2200, ip2500, ip2600, ip2700, ip3000, ip3300, ip3500, ip3600, ip4000, ip4200, ip4300, ip4500, ip4600, ip4700, ip4800, ip4900, ip5000, ip5200, ip6600, ip7200, ip7500, ip8500, ip90 series
    • ix6500 series
    • mg2100, mg2200, mg3100, mg3200, mg4100, mg4200, mg5100, mg5200, mg5300, mg5400, mg6100, mg6200, mg6300, mg8100, mg8200 series
    • mp140, mp160, mp190, mp210, mp230, mp240, mp250, mp270, mp280, mp490, mp495, mp500, mp510, mp520, mp540, mp550, mp560, mp600, mp610, mp620, mp630, mp640, mp750, mp780 series
    • mx320, mx330, mx340, mx350, mx360, mx370, mx390, mx410, mx420, mx430, mx450, mx510, mx520, mx710, mx720, mx860, mx870, mx880, mx890, mx920 series
    • pixmaip1000, pixmaip1500 series.
    • pixus250, pixus255, pixus550, pixus560, pixus850, pixus860, pixus950, pixus990 series
    • pixusip3100, pixusip4100, pixusip8600 series

    Install Canon Drivers / ScanGear in Ubuntu 14.04:

    1. To get started, press Ctrl+Alt+T on keyboard to open terminal. When it opens, paste the command below and hit enter to run:

    $ sudo add-apt-repository ppa:inameiname/stable

    Type in your user password when it asks and hit Enter to continue. This will add the PPA repository into your system.

    2. After that, open Synaptic Package Manager from the Unity Dash. If you don’t find it, search for and install it from Ubuntu Software Center.

    Do: Click the Reload button to refresh your system cache.

          To install a printer driver:
              In Quick filter box, type in cnijfilter.
          To install a ScanGear:
              In Quick filter box, type in scangearmp.

    Select a package in the result list that matches your device. Right-click on the package and select “Mark for Installation” Finally click on the “Apply” button to install the driver.

    Once the printer and scanner drivers are installed, connect your device to the computer and start Printers utility test if it works. And launch the Simple Scan utility and select your scanner from app menu Documents → Preferences → Scan Source to test if the scanner works.

    Source: http://ubuntuhandbook.org/index.php/2014/12/canon-driver-scangear-mp-ubuntu-14-04/

  • Installation Cadsoft Eagle for Ubuntu

    *** Warning, 64-bit is not supported by Ubuntu. Please install the 32-bit version. ***

    Start by updating all the libraries

    sudo apt-get update

    Install Missing 32-bit Libraries

    sudo apt-get install libxrender1:i386 libxrandr2:i386 libxcursor1:i386 libfreetype6:i386 libfontconfig1:i386 libxext6:i386 libx11-6:i386 libxi6:i386 libssl1.0.0:i386 libstdc++6:i386 libgcc1:i386 libc6:i386 libc6-i386 libxfixes3:i386 libexpat1:i386 libxcb1:i386 libxdmcp6:i386 libxau6:i386

    Download the .run File

    Here we will create a Folder on Desktop named Eagle. Download the .run file in that folder. Download the .run File

    cd Desktop
    mkdir Eagle
    cd Eagle
    wget http://web.cadsoft.de/ftp/eagle/program/7.3/eagle-lin32-7.3.0.run

    Make the .run file executable

    First we will make it executable & then run the setup.

    chmod a+x eagle-lin32-7.3.0.run
    ./eagle-lin32-7.3.0.run

    You should see the GUI installation on your screen. Just click on NEXT .. & should be good to go.

    Run the program

    cd /home/$USER/eagle-7.3.0/bin
    ./eagle
  • Installing Arduino in Ubuntu

    Some simple steps:

    • Open Software Centre.
    • Search for Arduino.
    • Install.
    • At startup, accept the message by clicking the ‘Add’ button.
    • Log off and log back on again.
    • Now you can start programming.
  • Key expired or missing – Ubuntu error

    Key expired or missing – Ubuntu error

    Thanks to: https://chrisjean.com/fix-apt-get-update-the-following-signatures-couldnt-be-verified-because-the-public-key-is-not-available/

    Example error message in terminal at running apt-get:

    [chris@server ~]$ sudo apt-get update Ign http://security.ubuntu.com trusty-security InRelease Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B] … Fetched 21.9 MB in 14s (1,537 kB/s) Reading package lists… Done W: GPG error: http://security.ubuntu.com trusty-security Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 W: GPG error: http://archive.canonical.com trusty Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 W: GPG error: http://archive.ubuntu.com trusty-updates Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32 [chris@server ~]$

    Reading the text above, you can see for example that public key ‘3B4FE6ACC0B21F32’ can’t be found. This has to retrieved  from a  key server. We’re gonna fix this by running the following command:

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32

    You’ll see that the key will be downloaded en registered. Problem solved!
    Run the command apt-get upgrade again. The error message should be gone.

  • Docker installation

    Docker installation

    Docker is supported on these Ubuntu operating systems:
    * Ubuntu Xenial 16.04 (LTS)
    * Ubuntu Wily 15.10
    * Ubuntu Trusty 14.04 (LTS)
    * Ubuntu Precise 12.04 (LTS)

    This page instructs you to install using Docker-managed release packages and installation mechanisms. Using these packages ensures you get the latest release of Docker. If you wish to install using Ubuntu-managed packages, consult your Ubuntu documentation.

    * Note: Ubuntu Utopic 14.10 and 15.04 exist in Docker’s APT repository but are no longer officially supported.

    Prerequisites

    Docker requires a 64-bit installation regardless of your Ubuntu version. Additionally, your kernel must be 3.10 at minimum. The latest 3.10 minor version or a newer maintained version are also acceptable.

    Kernels older than 3.10 lack some of the features required to run Docker containers. These older versions are known to have bugs which cause data loss and frequently panic under certain conditions.

    To check your current kernel version, open a terminal and use uname -r to display your kernel version:

    $ uname -r
    3.11.0-15-generic

    * Note: If you previously installed Docker using APT, make sure you update your APT sources to the new Docker repository.

    Update your apt sources

    Docker’s APT repository contains Docker 1.7.1 and higher. To set APT to use packages from the new repository:

    1. Log into your machine as a user with sudo or root privileges.
    2. Open a terminal window.
    3. Update package information, ensure that APT works with the https method, and that CA certificates are installed.
    $ sudo apt-get update

    $ sudo apt-get install apt-transport-https ca-certificates

    4. Add the new GPG key.

    $ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

    5. Open the /etc/apt/sources.list.d/docker.list file in your favorite editor.
    If the file doesn’t exist, create it.
    Remove any existing entries.

    Add an entry for your Ubuntu operating system.

    The possible entries are:

    On Ubuntu Precise 12.04 (LTS)

    deb https://apt.dockerproject.org/repo ubuntu-precise main

    On Ubuntu Trusty 14.04 (LTS)

    deb https://apt.dockerproject.org/repo ubuntu-trusty main

    Ubuntu Wily 15.10

    deb https://apt.dockerproject.org/repo ubuntu-wily main

    Ubuntu Xenial 16.04 (LTS)

    deb https://apt.dockerproject.org/repo ubuntu-xenial main

    * Note: Docker does not provide packages for all architectures. You can find nightly built binaries in https://master.dockerproject.org. To install docker on a multi-architecture system, add an [arch=…] clause to the entry. Refer to the Debian Multiarch wiki for details.
    Save and close the /etc/apt/sources.list.d/docker.list file.
    Update the APT package index.

    $ sudo apt-get update

    Purge the old repo if it exists.

    $ sudo apt-get purge lxc-docker

    Verify that APT is pulling from the right repository.

    $ apt-cache policy docker-engine

    From now on when you run apt-get upgrade, APT pulls from the new repository.

    Prerequisites by Ubuntu Version

    * Ubuntu Xenial 16.04 (LTS) * Ubuntu Wily 15.10 * Ubuntu Trusty 14.04 (LTS)

    For Ubuntu Trusty, Wily, and Xenial, it’s recommended to install the linux-image-extra kernel package. The linux-image-extra package allows you use the aufs storage driver.

    To install the linux-image-extra package for your kernel version:

    1. Open a terminal on your Ubuntu host.

    2. Update your package manager.

    $ sudo apt-get update

    3. Install the recommended package.

    $ sudo apt-get install linux-image-extra-$(uname -r)

    Go ahead and install Docker.

    If you are installing on Ubuntu 14.04 or 12.04, apparmor is required. You can install it using:

    apt-get install apparmor

    Ubuntu Precise 12.04 (LTS)
    For Ubuntu Precise, Docker requires the 3.13 kernel version. If your kernel version is older than 3.13, you must upgrade it. Refer to this table to see which packages are required for your environment:

    linux-image-generic-lts-trusty Generic Linux kernel image. This kernel has AUFS built in. This is required to run Docker.
    linux-headers-generic-lts-trusty Allows packages such as ZFS and VirtualBox guest additions which depend on them. If you didn’t install the headers for your existing kernel, then you can skip these headers for the”trusty” kernel. If you’re unsure, you should include this package for safety.
    xserver-xorg-lts-trusty Optional in non-graphical environments without Unity/Xorg. Required when running Docker on machine with a graphical environment.

    To learn more about the reasons for these packages, read the installation instructions for backported kernels, specifically the LTS Enablement Stack — refer to note 5 under each version.
    libgl1-mesa-glx-lts-trusty

    To upgrade your kernel and install the additional packages, do the following:
    * Open a terminal on your Ubuntu host. * Update your package manager.

    $ sudo apt-get update

    Install both the required and optional packages.

    $ sudo apt-get install linux-image-generic-lts-trusty

    Depending on your environment, you may install more as described in the preceding table.

    Reboot your host.

    $ sudo reboot

    After your system reboots, go ahead and install Docker.

    Install

    Make sure you have installed the prerequisites for your Ubuntu version.

    Then, install Docker using the following:

    Log into your Ubuntu installation as a user with sudo privileges.

    Update your APT package index.

    $ sudo apt-get update

    Install Docker.

    $ sudo apt-get install docker-engine

    Start the docker daemon.

    $ sudo service docker start

    Verify docker is installed correctly.

    $ sudo docker run hello-world

    This command downloads a test image and runs it in a container. When the container runs, it prints an informational message. Then, it exits.

    Optional configurations

    This section contains optional procedures for configuring your Ubuntu to work better with Docker.
    * Create a docker group
    * Adjust memory and swap accounting
    * Enable UFW forwarding
    * Configure a DNS server for use by Docker
    * Configure Docker to start on boot

    Create a Docker group

    The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can access it with sudo. For this reason, docker daemon always runs as the root user.

    To avoid having to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.

    * Warning: The docker group is equivalent to the root user; For details on how this impacts security in your system, see Docker Daemon Attack Surface for details.

    To create the docker group and add your user: 1. Log into Ubuntu as a user with sudo privileges.
    2. This procedure assumes you log in as the ubuntu user. 3. Create the docker group.

    $ sudo groupadd docker

    Add your user to docker group.

    $ sudo usermod -aG docker ubuntu

    Log out and log back in.

    This ensures your user is running with the correct permissions.

    Verify your work by running docker without sudo.

    $ docker run hello-world

    If this fails with a message similar to this:

    Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?

    Check that the DOCKER_HOST environment variable is not set for your shell. If it is, unset it.

    Adjust memory and swap accounting

    When users run Docker, they may see these messages when working with an image:

    WARNING: Your kernel does not support cgroup swap limit. WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.

    To prevent these messages, enable memory and swap accounting on your system. Enabling memory and swap accounting does induce both a memory overhead and a performance degradation even when Docker is not in use. The memory overhead is about 1% of the total available memory. The performance degradation is roughly 10%.

    To enable memory and swap on system using GNU GRUB (GNU GRand Unified Bootloader), do the following:
    1. Log into Ubuntu as a user with sudo privileges.
    2. Edit the /etc/default/grub file.
    3. Set the GRUB_CMDLINE_LINUX value as follows:

    GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

    4. Save and close the file
    5. Update GRUB.

    $ sudo update-grub

    6. Reboot your system.

    $ sudo reboot now

    Enable UFW forwarding

    If you use UFW (Uncomplicated Firewall) on the same host as you run Docker, you’ll need to do additional configuration. Docker uses a bridge to manage container networking. By default, UFW drops all forwarding traffic. As a result, for Docker to run when UFW is enabled, you must set UFW’s forwarding policy appropriately.

    Also, UFW’s default set of rules denies all incoming traffic. If you want to reach your containers from another host allow incoming connections on the Docker port. The Docker port defaults to 2376 if TLS is enabled or 2375 when it is not. If TLS is not enabled, communication is unencrypted. By default, Docker runs without TLS enabled.

    To configure UFW and allow incoming connections on the Docker port:
    1. Log into Ubuntu as a user with sudo privileges.
    2. Verify that UFW is installed and enabled.

    $ sudo ufw status

    3. Open the /etc/default/ufw file for editing.

    $ sudo nano /etc/default/ufw

    4. Set the DEFAULT_FORWARD_POLICY policy to:

    DEFAULT_FORWARD_POLICY="ACCEPT"

    5. Save and close the file.
    6. Reload UFW to use the new setting.

    $ sudo ufw reload

    7. Allow incoming connections on the Docker port.

    $ sudo ufw allow 2375/tcp

    Configure a DNS server for use by Docker

    Systems that run Ubuntu or an Ubuntu derivative on the desktop typically use 127.0.0.1 as the default nameserver in /etc/resolv.conf file. The NetworkManager also sets up dnsmasq to use the real DNS servers of the connection and sets up nameserver 127.0.0.1 in /etc/resolv.conf.

    When starting containers on desktop machines with these configurations, Docker users see this warning:

    WARNING: Local (127.0.0.1) DNS resolver found in resolv.conf and containers can’t use it. Using default external servers : [8.8.8.8 8.8.4.4]

    The warning occurs because Docker containers can’t use the local DNS nameserver. Instead, Docker defaults to using an external nameserver.

    To avoid this warning, you can specify a DNS server for use by Docker containers. Or, you can disable dnsmasq in NetworkManager. Though, disabling dnsmasq might make DNS resolution slower on some networks.

    The instructions below describe how to configure the Docker daemon running on Ubuntu 14.10 or below. Ubuntu 15.04 and above use systemd as the boot and service manager. Refer to control and configure Docker with systemd to configure a daemon controlled by systemd.

    To specify a DNS server for use by Docker:
    1. Log into Ubuntu as a user with sudo privileges.
    2. Open the /etc/default/docker file for editing.

    $ sudo nano /etc/default/docker

    3. Add a setting for Docker.

    DOCKER_OPTS="--dns 8.8.8.8"

    Replace 8.8.8.8 with a local DNS server such as 192.168.1.1. You can also specify multiple DNS servers. Separated them with spaces, for example:

    1. -dns 8.8.8.8 –dns 192.168.1.1

    * Warning: If you’re doing this on a laptop which connects to various networks, make sure to choose a public DNS server.
    Save and close the file.
    Restart the Docker daemon.

    $ sudo service docker restart

    Or, as an alternative to the previous procedure, disable dnsmasq in NetworkManager (this might slow your network).
    Open the /etc/NetworkManager/NetworkManager.conf file for editing.

    $ sudo nano /etc/NetworkManager/NetworkManager.conf

    Comment out the dns=dnsmasq line:

    dns=dnsmasq

    Save and close the file.

    Restart both the NetworkManager and Docker.

    $ sudo restart network-manager
    $ sudo restart docker

    Configure Docker to start on boot

    Ubuntu uses systemd as its boot and service manager 15.04 onwards and upstart for versions 14.10 and below.

    For 15.04 and up, to configure the docker daemon to start on boot, run

    $ sudo systemctl enable docker

    For 14.10 and below the above installation method automatically configures upstart to start the docker daemon on boot

    Upgrade Docker

    To install the latest version of Docker with apt-get:

    $ sudo apt-get upgrade docker-engine

    Uninstallation

    To uninstall the Docker package:

    $ sudo apt-get purge docker-engine

    To uninstall the Docker package and dependencies that are no longer needed:

    $ sudo apt-get autoremove --purge docker-engine

    The above commands will not remove images, containers, volumes, or user created configuration files on your host. If you wish to delete all images, containers, and volumes run the following command:

    $ rm -rf /var/lib/docker

    You must delete the user created configuration files manually.