{"id":563,"date":"2012-08-09T15:30:52","date_gmt":"2012-08-09T15:30:52","guid":{"rendered":"http:\/\/naich.net\/wordpress\/?p=563"},"modified":"2012-09-20T13:41:03","modified_gmt":"2012-09-20T13:41:03","slug":"keeping-it-up-to-date-given-up-with-the-pi-puns","status":"publish","type":"post","link":"https:\/\/naich.net\/wordpress\/index.php\/keeping-it-up-to-date-given-up-with-the-pi-puns\/","title":{"rendered":"Keeping it up to date (given up with the Pi puns)"},"content":{"rendered":"<p><a href=\"http:\/\/naich.net\/wordpress\/?p=526\">Continuing from here<\/a><\/p>\n<p><a href=\"http:\/\/naich.net\/wordpress\/?p=435\">First page here<\/a><\/p>\n<h3>7.\u00c2\u00a0 Updating your system<\/h3>\n<p>We&#8217;ve just got a spot of housekeeping to do before installing some stuff to turn your pi into something useful.\u00c2\u00a0 We are going to do a system update to make sure we are running the latest version of everything.\u00c2\u00a0 And I mean everything.\u00c2\u00a0 The update will not only update the operating system, but <strong>all<\/strong> your installed software.\u00c2\u00a0 All your Pi&#8217;s software comes from a &#8220;repository&#8221; on the internet of pre-compiled software packages, created by the people who made the <a href=\"http:\/\/www.raspbian.org\/\">Raspbian<\/a> distribution &#8211; over 35,000 packages in total, covering pretty much anything you might want your Pi to do: web server, media server, media streamer, torrent client, DNS, web browser (yes, a text only web browser) and so on.\u00c2\u00a0 Each package contains software, configuration files, manual pages, and <a href=\"http:\/\/en.wikipedia.org\/wiki\/Shell_script\">scripts<\/a> needed to set the software up after install.\u00c2\u00a0 You can install packages from outside the repository or compile your own software, but that is a bit more advanced and everything we need is included in the Raspbian repository.<\/p>\n<p>Software is maintained on a your Pi&#8217;s Debian-based Linux system, Raspbian, with a set of utilities called Apt, which is short for &#8220;Advanced Package Tool&#8221;.\u00c2\u00a0 It keeps a track of all the installed software packages, what version they are, if they need updating, and other packages required by each package.\u00c2\u00a0 That last one is important.\u00c2\u00a0 Most packages will rely on other packages being installed on your Pi in order to work.\u00c2\u00a0 From a programmer&#8217;s point of view, there is no point in re-inventing the wheel if you want a feature in your program (let&#8217;s call your program &#8220;Program A&#8221;) that has already been created by someone else in Program B.\u00c2\u00a0 The programmer can tell program A to call up Program B when this feature is needed.\u00c2\u00a0 Then, when the repository maintainer creates Program A&#8217;s package for the Raspbian repository, the maintainer adds a specification to the package that tells Apt to check that the package containing Program B is already installed on the Pi.\u00c2\u00a0 If it is then that&#8217;s fine and dandy, but if it&#8217;s not, Apt will nip off and download Program B&#8217;s package too. \u00c2\u00a0Of course, it then has to check if the Program B&#8217;s package<em><\/em> needs any other packages to be installed on the Pi, download them if they aren&#8217;t installed, check <em>those<\/em>\u00c2\u00a0ones&#8230;, and so on until all the packages are happy.\u00c2\u00a0 Keeping track of all these interlinking packages, each depending on the other (package B is called a &#8220;dependency&#8221; of package A), would be a nightmare to do yourself, so thank goodness for Apt, which does it all for you.<\/p>\n<p>You might think that it sounds a bit complicated, but it&#8217;s not. \u00c2\u00a0You will soon see how easy it all is to use.\u00c2\u00a0 Then you might start feeling sorry for Windows users and the pain they have to go through &#8211; finding the software, downloading it (Windows downloads are usually bigger as they don&#8217;t have Linux&#8217;s dependency system), going through the install procedure and then finding that the installer just splatted a load of <a href=\"http:\/\/www.urbandictionary.com\/define.php?term=crapware\">crapware<\/a> all over their PC.\u00c2\u00a0 Do not pity them though.\u00c2\u00a0 They have chosen their path.\u00c2\u00a0 It&#8217;s quite similar (and predates by many years) the &#8220;App&#8221; system used by Apple, Android etc., except it is far more flexible and doesn&#8217;t restrict you to one source of packages.<\/p>\n<p>But back to the updating&#8230; Let&#8217;s start off by getting a list of software that needs updating.\u00c2\u00a0 Type <strong><tt>sudo apt-get update<\/tt><\/strong> and you should see something like this:<\/p>\n<blockquote>\n<pre>naich@raspberrypi ~ $ sudo apt-get update \r\nGet:1 http:\/\/mirrordirector.raspbian.org wheezy InRelease [12.5 kB] \r\nGet:2 http:\/\/archive.raspberrypi.org wheezy InRelease [7,698 B] \r\nGet:3 http:\/\/mirrordirector.raspbian.org wheezy\/main armhf Packages [7,296 kB] \r\n... and so on for a bit... \r\nIgn http:\/\/mirrordirector.raspbian.org wheezy\/rpi Translation-en \r\nFetched 7,388 kB in 48s (151 kB\/s) \r\nReading package lists... Done \r\nnaich@raspberrypi ~ $<\/pre>\n<\/blockquote>\n<p>Lovely jubbly.\u00c2\u00a0 It&#8217;s got a list of all the latest packages.\u00c2\u00a0 Let&#8217;s process all the packages that need upgrading to a later version.\u00c2\u00a0 Type <strong><tt>sudo apt-get upgrade<\/tt><\/strong>:<\/p>\n<blockquote>\n<pre>naich@raspberrypi ~ $ sudo apt-get upgrade \r\nReading package lists... Done \r\nBuilding dependency tree Reading state information... Done \r\n\r\nThe following packages will be upgraded: \r\nbash dictionaries-common file idle3 krb5-locales libgssapi-krb5-2 \r\nlibk5crypto3 libkrb5-3 libkrb5support0 liblapack3 liblapack3gf \r\nlibmagic1 libpulse0 libsystemd-login0 libtiff4 libxapian-dev libxapian22 \r\nlibxml2 libxml2-dev libxslt1-dev libxslt1.1 nfs-common omxplayer \r\npython3 python3-minimal tasksel tasksel-data udisks vim-common vim-tiny \r\nxserver-common xserver-xorg-core \r\n\r\n32 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. \r\nNeed to get 23.0 MB of archives. \r\nAfter this operation, 1,183 kB of additional disk space will be used. \r\nDo you want to continue [Y\/n]?<\/pre>\n<\/blockquote>\n<p>Do you want to continue?\u00c2\u00a0 You do.\u00c2\u00a0 And away it goes, upgrading it&#8217;s little silicon heart out.\u00c2\u00a0 Very rarely, you might see something like this:<\/p>\n<blockquote>\n<pre>Configuration file `\/etc\/skel\/.bashrc'\r\n ==&gt; Modified (by you or by a script) since installation.\r\n ==&gt; Package distributor has shipped an updated version.\r\n What would you like to do about it ? Your options are:\r\n Y or I : install the package maintainer's version\r\n N or O : keep your currently-installed version\r\n D : show the differences between the versions\r\n Z : start a shell to examine the situation\r\n The default action is to keep your current version.\r\n*** .bashrc (Y\/I\/N\/O\/D\/Z) [default=N] ?<\/pre>\n<\/blockquote>\n<p>This means that Apt has found a configuration file that been changed since the package was installed.\u00c2\u00a0 Unless you have made the change yourself, it&#8217;s safest to choose &#8220;Y&#8221; to install the new version which will be compatible with the updated software. A backup of the old config file will be saved in case the new one doesn&#8217;t work so you can examine them later to see the differences and fix them if necessary.<\/p>\n<p>Warnings can generally be ignored.\u00c2\u00a0 Things like this probably don&#8217;t mean much to you:<\/p>\n<blockquote>\n<pre>insserv: warning: current start runlevel(s) (empty) of script `nfs-common' overwrites defaults (2 3 4 5 S).\r\ninsserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6 S) of script `nfs-common' overwrites defaults (0 1 6).<\/pre>\n<\/blockquote>\n<p>And to be honest it doesn&#8217;t mean that much to me either.\u00c2\u00a0 It looks like it&#8217;s saying that the nfs server isn&#8217;t automatically started on runlevels 2-5 any more. \u00c2\u00a0Possibly. \u00c2\u00a0We aren&#8217;t using nfs so we don&#8217;t care; we&#8217;ll cross that bridge if we come to it.\u00c2\u00a0 My Pi seemed to work OK after those warnings, so I didn&#8217;t worry about them.\u00c2\u00a0 Make a note of warnings, just in case you need to find a problem later, but don&#8217;t worry about them unduly.\u00c2\u00a0 &#8220;warning: &#8221; means something unexpected has happened but Apt can keep going.\u00c2\u00a0 Errors, however, can&#8217;t be ignored.\u00c2\u00a0 &#8220;error: &#8221; means something so bad has happened that Apt can&#8217;t continue.\u00c2\u00a0 If you ever see an error, the best thing to do is to copy and paste it into Google to find someone else who has had the same problem and has hopefully fixed it.<\/p>\n<p>You want to go through this procedure (&#8220;apt-get update&#8221; followed by &#8220;apt-get upgrade&#8221;) every now and again to make sure your system is up to date.\u00c2\u00a0 Most updates are due to bugs regarding security and are closing avenues of attack for hackers, so you want to install them.\u00c2\u00a0 I do it about once a week.<\/p>\n<p>There is also another type of upgrade &#8211; <strong><tt>apt-get dist-upgrade<\/tt><\/strong>. This upgrades your system to the latest stable <a href=\"http:\/\/www.debian.org\/releases\/\">release<\/a>.\u00c2\u00a0 This means that it won&#8217;t just upgrade your packages for bug fixes and security patches, it will upgrade all your software to the version included in the current stable release of your distribution, as if you downloaded and installed it from scratch.\u00c2\u00a0 This is a more serious upgrade and should only be undertaken if you&#8217;ve got a bit of spare time to fix anything that might get broken.\u00c2\u00a0 You are likely to see those messages about the configuration files and might have to edit upgraded ones to get things working again.\u00c2\u00a0 If you start seeing messages during your &#8220;apt-get upgrade&#8221; that packages have been &#8220;held back&#8221;, it means that you should probably start thinking about doing a &#8220;dist-upgrade&#8221;.<\/p>\n<p><a title=\"Torrents of Pi\" href=\"http:\/\/naich.net\/wordpress\/?p=574\">Continued here&#8230;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Continuing from here First page here 7.\u00c2\u00a0 Updating your system We&#8217;ve just got a spot of housekeeping to do before installing some stuff to turn your pi into something useful.\u00c2\u00a0 We are going to do a system update to make sure we are running the latest version of everything.\u00c2\u00a0 And I mean everything.\u00c2\u00a0 The update [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74,102],"tags":[],"class_list":["post-563","post","type-post","status-publish","format-standard","hentry","category-geek","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=563"}],"version-history":[{"count":49,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/563\/revisions"}],"predecessor-version":[{"id":581,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/563\/revisions\/581"}],"wp:attachment":[{"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/naich.net\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}