Install packages: Difference between revisions

From LWP-Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:software-faq]]
[[Category:software-faq]]
It is possible for users to install packages from the standard repositories we provide on their own LWP's. Students (i.e. those logging in with S-numbers) are excluded from this feature, because the PCs in the computer rooms need to diverge as little as possible.
It is possible for users to install packages from the standard repositories we provide on their own LWP's. Students (i.e. those logging in with S-numbers) are excluded from this feature, because the PCs in the computer rooms need to diverge as little as possible and new versions of packages can cause trouble with upgrades of packages provided by Ubuntu. You can substitute 'apt' anywhere 'apt-get' or 'apt-cache' is used, both work.


'''If you wish your software to be installed on all LWP's, please fill out [[Special:Contact/swreq|this software request form]].'''
'''If you wish your software to be installed on all LWP's, e.g. because you need it for a course, please send a email to [mailto:lwp@rug.nl lwp@rug.nl].'''


We've added many extra repositories, for special packages, but they've been given a lower install priority. We've done this, so you have to deliberately install the package version you want and no accidental installs happen. You can also install anything that can be found in the ''Ubuntu Software Center''.<br/>
We've added many extra repositories, for special packages, but they've been given a lower install priority. We've done this, so you have to deliberately install the package version you want and no accidental installs happen. You can also install anything that can be found in the ''Ubuntu Software Center''.<br/>
Line 8: Line 8:
Here are the most useful commands on the command line.<br/>
Here are the most useful commands on the command line.<br/>
* To search for the actual package name:
* To search for the actual package name:
  sudo apt-cache search <name of the program>
  apt-cache search <name of the program>
* See the available versions of a package and in what repository with what priority they can be found:
* See the available versions of a package and in what repository with what priority they can be found:
  sudo apt-cache policy <package>
  apt-cache policy <package>
* Installing a package from
* Installing a package from
:1. the standard ''Ubuntu'' repositories:
:1. the standard ''Ubuntu'' repositories:
Line 16: Line 16:
:2. the extra repositories:
:2. the extra repositories:
  sudo apt-get install -t o=<origin> <package>
  sudo apt-get install -t o=<origin> <package>
* With the '-t' option you can provide the <origin> of the package. The origin can be found in the preferences file of the repository of the package:
* With the '-t' option you can provide the <origin> of the package.
:1. If you know the repository name, the origin (o=...) can be found in the preferences file of the repository of the package:
  cat /etc/apt/preferences.d/<repository_name>.pref
  cat /etc/apt/preferences.d/<repository_name>.pref
:2. If you don't know the repository name, you can use the following commands:
apt-cache policy <package>
apt-cache policy | grep -A2 <package source> | grep -o "o=.*" | cut -d"," -f1 | uniq
'''e.g.''' If you would like to install the latest version of Libreoffice on your system. It isn't available from the main repository, but it is available in one of the extra's with a lower (400) priority. (version numbers may differ)
'''e.g.''' If you would like to install the latest version of Libreoffice on your system. It isn't available from the main repository, but it is available in one of the extra's with a lower (400) priority. (version numbers may differ)
  sudo apt-cache policy libreoffice
  '''sudo apt-cache policy libreoffice'''
  [sudo] password for <you>:  
  [sudo] password for <you>:  
  libreoffice:
  libreoffice:
Line 34: Line 39:
       1:3.5.2-2ubuntu1 0
       1:3.5.2-2ubuntu1 0
         500 http://osmirror.rug.nl/ubuntu/ trusty/main amd64 Packages
         500 http://osmirror.rug.nl/ubuntu/ trusty/main amd64 Packages
We'll have to determine the origin of the package:
We can see that version 1:4.2.1 is the latest, but 1:3.5.7 is installed.<br/>
  cat /etc/apt/preferences.d/libreoffice.pref
First we'll pretend we don't know the repository file is named libreoffice.* and try to determine the origin of the package with a command:
  '''sudo apt-cache policy | grep -A2 http://deb.rug.nl/ppa/mirror/ppa.launchpad.net/libreoffice/ppa/ubuntu/ | grep -o "o=.*" | cut -d"," -f1 | uniq'''
o=LP-PPA-libreoffice
If you do know the file to look in, you can do this:
'''cat /etc/apt/preferences.d/libreoffice.pref'''
  # libreoffice
  # libreoffice
  Explanation: : libreoffice
  Explanation: : libreoffice
Line 42: Line 51:
  Pin-Priority: 400
  Pin-Priority: 400
The "'''o=...'''" parameter is the origin, so now we can install the latest version with the addition of "'''-t o=LP-PPA-libreoffice'''" to the normal apt-get command:
The "'''o=...'''" parameter is the origin, so now we can install the latest version with the addition of "'''-t o=LP-PPA-libreoffice'''" to the normal apt-get command:
  sudo apt-get install -t o=LP-PPA-libreoffice libreoffice
  '''sudo apt-get install -t o=LP-PPA-libreoffice libreoffice'''
  <long list of packages and extra packages>
  <long list of packages and extra packages>
  [y/n] y
  [y/n] y
  <even longer list of stuff the system is doing>
  <even longer list of stuff the system is doing>
It might ask you if you want to keep some configuration file. Usually the default (keep the config file on the system) is the best choise... unless you want to begin with a completly clean install, because of problems. When it's done, you'll have the latest version of Libreoffice installed.
It might ask you if you want to keep some configuration files. Usually the default (keep the config file on the system) is the best choise... unless you want to begin with a completely clean install, because of problems. When it's done, you'll have the latest version of Libreoffice installed.

Latest revision as of 09:47, 30 April 2024

It is possible for users to install packages from the standard repositories we provide on their own LWP's. Students (i.e. those logging in with S-numbers) are excluded from this feature, because the PCs in the computer rooms need to diverge as little as possible and new versions of packages can cause trouble with upgrades of packages provided by Ubuntu. You can substitute 'apt' anywhere 'apt-get' or 'apt-cache' is used, both work.

If you wish your software to be installed on all LWP's, e.g. because you need it for a course, please send a email to lwp@rug.nl.

We've added many extra repositories, for special packages, but they've been given a lower install priority. We've done this, so you have to deliberately install the package version you want and no accidental installs happen. You can also install anything that can be found in the Ubuntu Software Center.


Here are the most useful commands on the command line.

  • To search for the actual package name:
apt-cache search <name of the program>
  • See the available versions of a package and in what repository with what priority they can be found:
apt-cache policy <package>
  • Installing a package from
1. the standard Ubuntu repositories:
sudo apt-get install <package>
2. the extra repositories:
sudo apt-get install -t o=<origin> <package>
  • With the '-t' option you can provide the <origin> of the package.
1. If you know the repository name, the origin (o=...) can be found in the preferences file of the repository of the package:
cat /etc/apt/preferences.d/<repository_name>.pref
2. If you don't know the repository name, you can use the following commands:
apt-cache policy <package>
apt-cache policy | grep -A2 <package source> | grep -o "o=.*" | cut -d"," -f1 | uniq

e.g. If you would like to install the latest version of Libreoffice on your system. It isn't available from the main repository, but it is available in one of the extra's with a lower (400) priority. (version numbers may differ)

sudo apt-cache policy libreoffice
[sudo] password for <you>: 
libreoffice:
  Installed: 1:3.5.7-0ubuntu5
  Candidate: 1:3.5.7-0ubuntu5
  Version table:
     1:4.2.1-0ubuntu1~trusty 0
        400 http://deb.rug.nl/ppa/mirror/ppa.launchpad.net/libreoffice/ppa/ubuntu/ precise/main amd64 Packages
 *** 1:3.5.7-0ubuntu5 0
        500 http://osmirror.rug.nl/ubuntu/ trusty-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:3.5.4-0ubuntu1.1 0
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     1:3.5.2-2ubuntu1 0
        500 http://osmirror.rug.nl/ubuntu/ trusty/main amd64 Packages

We can see that version 1:4.2.1 is the latest, but 1:3.5.7 is installed.
First we'll pretend we don't know the repository file is named libreoffice.* and try to determine the origin of the package with a command:

sudo apt-cache policy | grep -A2 http://deb.rug.nl/ppa/mirror/ppa.launchpad.net/libreoffice/ppa/ubuntu/ | grep -o "o=.*" | cut -d"," -f1 | uniq
o=LP-PPA-libreoffice

If you do know the file to look in, you can do this:

cat /etc/apt/preferences.d/libreoffice.pref
# libreoffice
Explanation: : libreoffice
Package: *
Pin: release o=LP-PPA-libreoffice
Pin-Priority: 400

The "o=..." parameter is the origin, so now we can install the latest version with the addition of "-t o=LP-PPA-libreoffice" to the normal apt-get command:

sudo apt-get install -t o=LP-PPA-libreoffice libreoffice
<long list of packages and extra packages>
[y/n] y
<even longer list of stuff the system is doing>

It might ask you if you want to keep some configuration files. Usually the default (keep the config file on the system) is the best choise... unless you want to begin with a completely clean install, because of problems. When it's done, you'll have the latest version of Libreoffice installed.