Updating Ubuntu Software & Repairing Broken Files (System)

Updating Ubuntu Software & Repairing Broken Files (System)

Postby Wolfman » Tue Jun 19, 2012 8:09 pm

These are my own setting preferences, use at your own risk!.

Please be aware that if you use Synaptic to update your system and you have critical system updates, make sure you restart after closing Synaptic as Synaptic will not issue a warning that a restart is necessary!.

Complete Synaptic "How-To" guides here: (Synaptic is pre-installed in Zorin OS!)

https://help.ubuntu.com/community/SynapticHowto

http://www.debianadmin.com/simple-packa ... buntu.html


List of topics covered here:

Restart your system after updating (See above!):
Reset Ubuntu Password:
System Update:
Booting into recovery mode:
If you only have an Ubuntu based system on your PC:
If you have more than one operating system installed use the following method:
To update your system fully, use the following commands in a terminal:
NB: "dist-upgrade" will not udate your OS to the next highest version!
Forcing an update:
Run an update (or install/remove a package) using the command line in "Recovery Mode":
Partial Update:
Replacing Files:
Software Sources Settings:
Synaptic > Settings > Repositories > Additional Drivers:
Changing your software sources download location:
Fixing Broken Packages:
Error messages about "Duplicate Sources":
Broken Upgrade or Installation:
Repairing the Grub Menu:
Removing unwanted applications:
Stopping a package from updating (Locking):
When using the terminal:
APT Explained in more detail: (Advanced Packaging Tool)
And all commands:
Boot Options explained in more detail:
Ubuntu Software Center:



Restart your system after updating:

As the title above suggests, when you do regular updates; regardless of which method you use to do so, you should restart your system (PC) for that "Just in case scenario" where something relating to the system was installed/updated. It often won't advise you to do so, so if you have a lot of updates, you should restart, those few seconds you take to do so, can possibly save you hours of head scratching and headache if you don't!. (This is only a recomendation but an advisable one!).


Reset Ubuntu Password:

To reset your password should you need to do so, follow the advice on this link:

http://www.psychocats.net/ubuntu/resetpassword

See also:

https://help.ubuntu.com/community/LostPassword


System Update:

Assuming you have already installed and are now looking for some assistance in some way, you can ignore this first part if you already started your system for the first time, this is merely a suggestion.

Immediately after installing your system I recommend booting into "Advanced Options" > "Recovery Mode" (don't do a first boot but boot straight into "Advanced Options" > "Recovery Mode") and running "dpkg" see below in "Fixing Broken Packages" about cable connection as this will only work with a network cable connected), once you have run dpkg; and you re-boot, set your "Software Sources" (see below) list and update again due to the changes made to the software sources lists!!. (I know this may sound strange but its something I found that seems to work well for me!.)

Select the 2nd option "Advanced options for Zorin:

Or you might see "Previous Linux versions" with which you can choose an older kernel if you are having problems booting a newer kernel!:

zorin-grub boot screenshot.jpg
zorin-grub boot screenshot.jpg (19.29 KiB) Viewed 57679 times


From the menu, select "Network" first and then "Dpkg". (A NETWORK CABLE CONNECTION IS REQUIRED FOR THIS TO WORK)

recovery menu network.png
recovery menu network.png (9.74 KiB) Viewed 57679 times


recovery menu dpkg.png
recovery menu dpkg.png (10.46 KiB) Viewed 57679 times


After running DPKG, restart your PC with Ctrl + Alt + Del, do not click on resume because there might have been updates for your graphics card and a restart is the smart thing to do!.


Booting into recovery mode:

If you only have an Ubuntu based system on your PC:

Switch on your computer and wait until the BIOS finishes loading (you will probably see a logo of your computer manufacturer)

The following messages may show up:

Grub loading stage1.5

Grub loading, please wait...


Quickly press the Shift key and hold it down when booting (normally Esc in older versions of Ubuntu!), which will bring up a boot menu. (If you see the Ubuntu logo, you've missed the point where you can enter the GRUB menu)

Select the line ending with '(recovery mode)', probably the second line, something like:

Ubuntu, kernel 2.6.17-10-generic (recovery mode)

Press enter and your machine will begin the boot process.
After a few moments, your workstation should display a menu with a number of options. One of the options (you may need to scroll down to the bottom of the list) will be "Drop to root shell prompt".

If you have more than one operating system installed use the following method:

Switch on your PC and wait until you see the GRUB menu, select the 2nd option (2nd line down) and select the 2nd line again, the one that ends "Recovery Mode". (This is working on the assumption that the OS you last installed was indeed an Ubuntu based system and the GRUB bootloader is being used!)


To update your system fully, use the following commands in a terminal:

(The first part of the command will update your package list, the second part of the command will update the packages and any missing dependencies ; if there are new versions available).


Code: Select all
sudo apt-get update && sudo apt-get dist-upgrade


NB: "dist-upgrade" will not udate your OS to the next highest version!.


Forcing an update:

The only difference about the force command is the "-f" at the end of the command which denotes the "force" part of the command. This will make sure that any missing dependencies get installed too!.

Code: Select all
sudo apt-get update && sudo apt-get dist-upgrade -f



Run an update (or install/remove a package) using the command line in "Recovery Mode":

Start in recovery mode and first activate "Network" and then click on "root", then type the above commands (write it down on paper first), this is much the same as running "DPKG". :D

To remove a package, just use the normal remove command like the following:

Code: Select all
sudo apt-get remove firefox


Firefox is only an example, type the name of the package you want to remove replacing "firefox with the real package name!.

A real good example would be graphics card drivers which may be causing a problem, lets use an Nvidia package as an example:

Code: Select all
sudo apt-get remove nvidia-304


which will remove the Nvidia 304 drivers package, again, restart with Ctrl + alt + Del, don't click on "Resume"!.

You can also do the same as the above commands using Synaptic, open Synaptic and click on "Reload" then "Mark All Updates" and lastly on "Apply". (Except the force part!!!!)

Make sure that your sources lists are active and set to "Main". You can do this via Synaptic > Settings > Repositories


Partial Update:

If you are asked whether you just wish to do a "partial update" (or upgrade); you should say "Yes" as it most likely won't advance anyway in the update process, it will normally say that it can (will) only update a few packages and once the partial update is done, then you should continue on to a full update assuming that there is indeed anything to update!.


Replacing Files:

Sometimes when updating you will be asked if you want to replace an existing file with a new one, the normal default action is to say no, I on the other hand find it better to install the new one, you must decide yourself whether or not you wish to do the same, I recommend replacing the existing file with the new one!!. (Use at your own risk but I have never had a problem doing just that!.)

replace.jpg


In the same token, you may be asked if you want to remove unwanted/orphaned files, again you should say yes! (Replace).


Software Sources Settings:

if you have a problem with the software sources update, please see this How-To which should give you tips on how to keep your system fully updated.

I recommend using the "Main server" repository download link and make sure you click on "Canonical partners" if you want "Nonfree" software (Skype etc)!.

Software & Updates_001.jpg


Software & Updates_002.jpg


Software & Updates_003.jpg



For additional graphic card drivers (if your graphics card is supported), the additional hardware drivers tool is now intergrated into Synaptic.

Synaptic > Settings > Repositories > Additional Drivers:

Software & Updates_004.jpg



Changing your software sources download location:

If you are having a problem with the downloads, you can change the download location with:

Open Synaptic > Settings > Repositories > Download From > Other > Choose a country and select best server, close the windows then reload and try updating again.

Software & Updates_005.jpg



Fixing Broken Packages:

There are often posts on the forum about "Broken Packages", you can solve this problem by opening: Synaptic > Edit > Fix broken packages. (You may well already be in Synaptic when you see this message!)

You can also run a command to fix this; run this command in a terminal:

Code: Select all
sudo dpkg --configure -a


The above command may not be necessary but it will fix "Broken packages" if needed!.

Code: Select all
sudo apt-get --fix-missing install


The above command downloads and installs any missing packages on your system.

Code: Select all
sudo apt-get --fix-broken install


The above command downloads and installs any broken dependencies on your system.

The third option is to restart your PC and go into "Recovery Mode" then activate "Network" and run "Dpkg" in the list. When asked if you should continue, press "y" (for yes even if it says that there are no updates available) and then enter, this will run any updates and repairs it needs to!!.

This option requires a working cable network connection, it may not work with a WiFi connection!!. Click on "Network" to activate the network before trying to use the internet to update the system. If you are on a laptop/notebook/netbook and you get error messages, ignore them and continue, it is whining about not finding the WiFi drivers!.
(I could not get it to work with WiFi (I didn't try that hard) although there are solutions they are for the advanced users only, see the only answer here:

http://askubuntu.com/questions/104066/e ... y-terminal ).


Error messages about "Duplicate Sources":

If you get error messages about duplicate source lists or similar, you can enter the following commands in a terminal to solve this problem:

Code: Select all
sudo rm -r /var/lib/apt/lists/*


then:

Code: Select all
sudo apt-get update


The other option is to simply ignore them which won't make them go away, but it still works for me!!.


Broken Upgrade or Installation:

What to do if an installation process fails and you find it is no longer possible to install or remove packages.

Open a terminal (Ctrl + Alt +t) and type (copy & paste) the following commands, pressing the Return or Enter key after each (you may have to type in your password which will not be visible!):

Code: Select all
sudo dpkg --configure -a


followed by

Code: Select all
sudo apt-get install -f


The first of the above commands fixes the "You have held Broken Packages" message, the second command forces the package installer to force an install of the failed package installation by making sure that all dependency requirements are met!.


Repairing the Grub Menu:

The Grub menu is the menu you see at the very beginning of the boot process from which you can select the various options it has to offer, boot into Linux, boot into Windows/Mac or boot into the recovery options menu.

If you are having a problem with the Grub Menu, open a terminal (Ctrl + Alt + t) and copy & paste the following command and this should/will repair Grub:

Code: Select all
sudo update-grub


If that isn't successful, keep the terminal open and run the following commands and use "Boot Repair", this works in both installed and Live CD modes:

For Ubuntu 14.04 upwards (Zorin 9):

Code: Select all
sudo add-apt-repository ppa:kranich/cubuntu


Code: Select all
sudo apt-get update && sudo apt-get install -y boot-repair && boot-repair


For anything below Ubuntu 14.04 (Zorin 6):

Code: Select all
sudo add-apt-repository ppa:yannubuntu/boot-repair


Code: Select all
sudo apt-get update && sudo apt-get install -y boot-repair && boot-repair


If you need to because the above didn't work in installed mode, start the **Ubuntu Live CD** and then **use the terminal**, or you can download a copy of "Boot Repair"

http://sourceforge.net/p/boot-repair-cd/home/Home/

See also:

https://help.ubuntu.com/community/Grub2/Setup

The above should be good for any Ubuntu version.


Removing unwanted applications:

To remove an unwanted app, simply type the name of the unwanted app at the end of this terminal command:

Code: Select all
sudo apt-get remove


As an example, choose the app "Qmail":

Code: Select all
sudo apt-get remove qmail


The above will only remove the main body of the app but not its dependencies in case there are other packages relying on those dependencies!!. (There is also a "purge" command which I personally won't recommend!)

This can also be done via Synaptic by opening Synaptic and typing the name of the app in search and right click it and mark it for complete removal!.


Stopping a package from updating (Locking):

If you don't want a particular package to update, open Synaptic and find the package using search, mark it with a mouse click then go to "Panel > Lock Version > Apply" which will stop the package from updating forever, to undo this, just do the reverse!.

When using the terminal:

NB: The password will never show any signs of being written (no characters will show at all) when you type it in the terminal so make sure you type the password correctly in the first place!.
When using the terminal to install packages, keep an eye out for messages that also suggests packages to install to enhance the application you are installing, these are only suggestions but may help the app run better in some small way:

using the terminal.jpg


Remember that any package can be installed via the terminal providing you know the **exact name** of the package you want to install!. (No deviations from the package name are allowed as it will only try and install the package name you type)

As an example: "firefox":

Code: Select all
sudo apt-get install firefox


Remember when using the terminal: Linux is case sensitive so "Downloads" is NOT "downloads".


APT Explained in more detail: (Advanced Packaging Tool)

https://help.ubuntu.com/community/AptGet/Howto

and:

https://help.ubuntu.com/community/Packa ... gProcedure

And all commands:

http://linux.die.net/man/8/apt-get


Boot Options explained in more detail:

https://help.ubuntu.com/community/BootOptions


Complete Synaptic "How-To" guides here:

https://help.ubuntu.com/community/SynapticHowto

and:

http://www.debianadmin.com/simple-packa ... buntu.html


Ubuntu Software Center:

In Zorin OS, you will find the (Ubuntu) Software Center in the Main Zorin Menu > Software Center. You can add an icon to the desktop by right clicking and add to desktop.

Software Centre_006.jpg



To manually fully update your Zorin OS to the next highest version, please see the following link:

viewtopic.php?f=6&t=4848
Regards Wolfman :D

Kindness is something the blind can see and the deaf can hear :)

Preparation and planning prevent poor performance! :)

Free Ubuntu User Manual: https://ubuntu-manual.org/
User avatar
Wolfman
 
Posts: 7615
Joined: Sat Jul 02, 2011 1:03 pm

Re: [STICKY] Updating software and Repairing Broken Files

Postby Bulldawg67 » Sat Jun 30, 2012 1:57 pm

Thanks Wolfman.
User avatar
Bulldawg67
 
Posts: 3
Joined: Mon Jun 25, 2012 7:38 pm

Re: [STICKY] Updating software and Repairing Broken Files

Postby Sunbirdaz » Fri Jul 06, 2012 4:09 am

Hi madvinegar and Wolfman,
Thank you both for all of your suggestions. I appreciate all your help. I spend a good part of the day reading help and tutorials. I just learned what the # means and I tried going to the root but it wants a password and I have no idea what it would be. It is not my user password. I am still reading and trying your suggestions and will let you know my progress tomorrow. I am now updating my system using Synaptic as was suggested. There are quite a few updates and my internet connection is so freaking slow tonight that it take a while.
Thanks again.
User avatar
Sunbirdaz
 
Posts: 8
Joined: Mon Jul 02, 2012 10:58 pm

Re: [STICKY] Updating software and Repairing Broken Files

Postby Wolfman » Fri Jul 06, 2012 6:39 am

Hi Sunbirdaz,

please see this guide:

viewtopic.php?f=6&t=1941&p=7345#p7345

And thanks to the others for the appreciation :D :D :D
Regards Wolfman :D

Kindness is something the blind can see and the deaf can hear :)

Preparation and planning prevent poor performance! :)

Free Ubuntu User Manual: https://ubuntu-manual.org/
User avatar
Wolfman
 
Posts: 7615
Joined: Sat Jul 02, 2011 1:03 pm

Re: [STICKY] Updating software and Repairing Broken Files

Postby Viking » Wed Nov 07, 2012 5:29 pm

Thanks, Wolf. You are bad to the bone.
User avatar
Viking
 
Posts: 6
Joined: Mon Nov 05, 2012 6:24 pm

Re: [STICKY] Updating Ubuntu Software/Repairing Broken Files

Postby jojothehobo » Wed Feb 19, 2014 7:59 pm

This is a great post and a great sticky. I just went through an extended repair and would have saved a lot of time if I had remembered this post and referred to it earlier. It took that work for me to appreciate just how good this post of Wolfman's is. I hope other Zorin users will bookmark this and remember it.

all the best
Joj
User avatar
jojothehobo
 
Posts: 103
Joined: Wed Oct 10, 2012 10:33 pm

Re: Updating Ubuntu Software & Repairing Broken Files (Syste

Postby Brons2 » Thu May 15, 2014 3:53 pm

I keep getting errors when doing the apt-get update about one of my sources. But I can't figure out which one it is, I've been through the whole list and don't have for for archive.canonical.com saucy InRelease

Ign http://archive.canonical.com saucy InRelease
E: GPG error: http://archive.canonical.com saucy InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)

[edit] Deselecting the Canonical partner sources fixed the problem, although I worry about any updates I might be missing from those sources, if any.
User avatar
Brons2
 
Posts: 1
Joined: Thu May 15, 2014 3:42 pm

Re: Updating Ubuntu Software & Repairing Broken Files (Syste

Postby loowic » Fri May 16, 2014 2:41 pm

I have ruined my Zorin installation when I've updated ubuntu. What can I do?
User avatar
loowic
 
Posts: 2
Joined: Fri May 16, 2014 2:34 pm

Re: Updating Ubuntu Software & Repairing Broken Files (Syste

Postby Wolfman » Sat May 17, 2014 7:27 am

loowic wrote:I have ruined my Zorin installation when I've updated ubuntu. What can I do?

Hi,

firstly you can post in the forum with a more descriptive post on what you did!.

If you mean you updated to the next highest level of Ubuntu then you will have to re-install Zorin, you can keep your data intact if you follow this advice:

viewtopic.php?f=6&t=4848

HOWEVER!, there may be a problem if you updated to Ubuntu 14.04 with the older config files from Zorin OS in the newer home and you might consider formatting both root and home!. (This is working on the assumption that you have seperate root and home partitions!)
Regards Wolfman :D

Kindness is something the blind can see and the deaf can hear :)

Preparation and planning prevent poor performance! :)

Free Ubuntu User Manual: https://ubuntu-manual.org/
User avatar
Wolfman
 
Posts: 7615
Joined: Sat Jul 02, 2011 1:03 pm

Re: Updating Ubuntu Software & Repairing Broken Files (Syste

Postby Wolfman » Sat May 17, 2014 7:28 am

Wolfman wrote:
loowic wrote:I have ruined my Zorin installation when I've updated ubuntu. What can I do?

Hi,

firstly you can post in the forum with a more descriptive post on what you did!.

If you mean you updated to the next highest level of Ubuntu then you will have to re-install Zorin, you can keep your data intact if you follow this advice:

viewtopic.php?f=6&t=4848

HOWEVER!, there may be a problem if you updated to Ubuntu 14.04 with the older config files from Zorin OS in the newer home and you might consider formatting both root and home!. (This is working on the assumption that you have seperate root and home partitions!)


Or did you simply bork the system by doing something you shouldn't have done, you need to tell us exactly what it was you did!.
Regards Wolfman :D

Kindness is something the blind can see and the deaf can hear :)

Preparation and planning prevent poor performance! :)

Free Ubuntu User Manual: https://ubuntu-manual.org/
User avatar
Wolfman
 
Posts: 7615
Joined: Sat Jul 02, 2011 1:03 pm
Next

Return to Zorin OS

Who is online

Users browsing this forum: No registered users and 1 guest