Category Archives: SysAdmin

Managing the repositories in Linux

Much of Linux’s software is stored in repositories. Your Linux installation has a list of repositories, with the most stable recent packages for your distro and possibly some others.

To view, add or delete the repos

In Synaptic, go to Settings -> Repositories

  1. Official Repositories
  2. Upgrade to the latest version – PPAs – Personal Package Archives
    • The official repo contains a fully tested set of packages – both tested individually and together. So you can be confident that all packages work together, that they don’t clash. Many of the packages in the official repo are one or more versions behind the latest version. PPAs contain other versions, and may include the latest version. Installing a package from a PPA increases the risk of packages clashing
    • For more information on PPAs see this article on How To Geek
  • Additional Repositories – for software that isn’t part of the official repo. Often the software’s website will give you step-by-step instructions on how to install it, including the command line for adding the repo. Or you can use Synaptic – Click on “Add a new repository” and enter the name and the URL

Linux package management – some common operations

For my own benefit (and maybe others), here are some of the common package management operations and how to do it (in Linux Mint and other Linux distros)

  • Update all install software:
    • apt-get update # refresh repos
    • apt-get upgrade # upgrade all software
    • (note: do both of the above, in that order)
    • Note: In Linux Mint you’ll see a shield with an exclamation mark in the bottom right hand corner when you need to update your software. Click on it and follow the instructions
  • Install a new package, if you know the name: apt-get install <package name>
  • Search for a package: use Synaptic (Menu -> Administration -> Synaptic), enter (partial) name or other keyword (e.g. “game”) in the search box at the top of the screen
  • View installed packages: In Synaptic, bottom left hand corner, click on “Status”, then (top left hand corner) click on “Installed”
  • Get more information about an installed package
    • Use Synaptic, find the package, click on the Properties button (top of the screen)
    • Common: Installed version, status (e.g. installed)
    • Dependencies – what other packages this package needs to work
    • Installed files – what files is this package made up of
    • Versions – what versions are available
    • Description

Linux package management: apt-get, aptitude, synaptic, wajig

When you set up your Linux system, you typically grab an image, burn it to DVD, boot the machine off the DVD and follow the instructions. The image will contain the most recent (stable) version of the core Linux distro files and of the packages which are bundled with it. The package managers let you keep your packages up to date, add new packages, remove packages, etc. They also deal with the dependencies; when installing a package, all packages it relies on are automatically installed as well

The package managers do this by accessing repositories (repos) of packages. Your distro came configured with a set of repos which contain packages which work on your repo. If you want to install some software which is not in your standard repos you may need to add a repo to the list

At the basic level, the system uses apt and dpkg to manage the software. The following are some front-ends on top of apt and dpkg:

  • apt-get: command line only
  • aptitude: very similar to apt-get, plus a text-based “gui”
  • synaptic: gui
  • wajig: slightly friendlier front-end to both apt-get and aptitude. Brings together the power of both

For more information have a look at this article

Linux Mint – family tree

Having used Fedora, CentOS and Debian (and a little of Raspbian and Unix) a couple of years ago I swapped over to Linux Mint. Since it is based on the popular Debian and Ubuntu it has an excellent eco-system –  packages, community and support

See Wikipedia for some more information about Linux Mint. This family tree shows you the relationship between many of the main Linux distros.

How to auto mount a hard disk in Linux Mint

A while ago I installed a SSD in my development machine and made it the main drive when I installed Linux Mint (17). The 1TB hard disk now gets recognised by Linux Mint, in that it shows up in the list of devices in Nemo (file manager). But applications can’t use it until I’ve clicked on it in Nemo

Time to fix this. I used the instructions I found at http://community.linuxmint.com/tutorial/view/1197:

“Go to Disks from the start menu, select the partition you want to mount, press the “more actions” button, then “edit mount options”, uncheck the “automatic mount options” and make sure that “mount at startup” is ticked, press OK and restart the system.”

Good start. Now when I reboot the system, the HDD is mounted at /mnt/<random string>. Let’s move it to somewhere sensible, say /mnt/disk2:

  1. Create the mount point. You’ll probably need to use sudo
    1. sudo mkdir /mnt/disk2
    2. sudo chown <user name> /mnt/disk2
  2. Menu -> Accessories -> Disk
  3. Click on the HDD, click on the partition, click on the two cogs, select “Mount Options”
  4. Change the Mount Point to /mnt/disk2
  5. Reboot to check

That works. Now /mnt/disk2 is the new mount point