So some time ago, I dual booted my computer with Windows 10 and Linux Mint 18:Sarah. Windows 10 created a hiberfil.sys file by default (to save system snapshots or whatever?) as I used Windows reboot feature. The problem that that created was that it made it so that my computer did not recognize grub which manages my system partitions and immediately booted into Windows. I resolved this issue by using Boot-Repair, so now I can access both system partitions. But then THAT broke apt-get so now I can't install ANY software with sudo apt-get install ___ or perform a sudo apt-get upgradeWhat's broken is my grub, or well, the system expects another version of grub known as grub2-common, but instead it has 2.02~beta2-36ubuntu3.1 version of grub installed. So now then I will show you the output of when I run a few commands: $ sudo apt-get upgradeReading package lists... DoneBuilding dependency tree       Reading state information... DoneYou might want to run 'apt-get -f install' to correct these.The following packages have unmet dependencies: grub-pc : Depends: grub2-common (= 2.02~beta2-36ubuntu3.2) but 2.02~beta2-36ubuntu3.1 is installed grub2-common : Depends: grub-common (= 2.02~beta2-36ubuntu3.1) but 2.02~beta2-36ubuntu3.2 is installedE: Unmet dependencies. Try using -f.So I will try that recommended command: $ sudo apt-get -f installReading package lists... DoneBuilding dependency tree       Reading state information... DoneCorrecting dependencies... DoneThe following additional packages will be installed:  grub2-commonThe following packages will be upgraded:  grub2-common1 upgraded, 0 newly installed, 0 to remove and 244 not upgraded.3 not fully installed or removed.Need to get 0 B/511 kB of archives.After this operation, 0 B of additional disk space will be used.Do you want to continue? [Y/n] yes(Reading database ... 288732 files and directories currently installed.)Preparing to unpack .../grub2-common_2.02~beta2-36ubuntu3.2_amd64.deb ...Unpacking grub2-common (2.02~beta2-36ubuntu3.2) over (2.02~beta2-36ubuntu3.1) ...dpkg: error processing archive /var/cache/apt/archives/grub2-common_2.02~beta2-36ubuntu3.2_amd64.deb (--unpack): trying to overwrite '/usr/sbin/grub-install', which is also in package lupin-support 0.57dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)Errors were encountered while processing: /var/cache/apt/archives/grub2-common_2.02~beta2-36ubuntu3.2_amd64.debE: Sub-process /usr/bin/dpkg returned an error code (1)How about when I try to install software? I'm trying to install an anti-virus software. sudo apt-get install clamavBuilding dependency tree       Reading state information... DoneYou might want to run 'apt-get -f install' to correct these:The following packages have unmet dependencies: clamav : Depends: clamav-freshclam (>= 0.99.2+dfsg) but it is not going to be installed or                   clamav-data          Depends: libclamav7 (>= 0.99~rc1) but it is not going to be installed grub-pc : Depends: grub2-common (= 2.02~beta2-36ubuntu3.2) but 2.02~beta2-36ubuntu3.1 is to be installed grub2-common : Depends: grub-common (= 2.02~beta2-36ubuntu3.1) but 2.02~beta2-36ubuntu3.2 is to be installedE: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).Again, the same issue with grub. Finally, one more comment I'd like to make:I cannot use sudo apt-get to install anything ... which includes updating grub repositories! Perhaps, you wonder what the state of aptitude is?sudo aptitude install clamavThe following NEW packages will be installed:  clamav clamav-base{a} clamav-freshclam{a} libclamav7{a} libllvm3.6v5{ab} The following partially installed packages will be configured:  grub-pc{b} python-pyaudio python-simplejson 0 packages upgraded, 5 newly installed, 0 to remove and 245 not upgraded.Need to get 9,109 kB of archives. After unpacking 36.8 MB will be used.The following packages have unmet dependencies: grub2-common : Depends: grub-common (= 2.02~beta2-36ubuntu3.1) but 2.02~beta2-36ubuntu3.2 is installed. grub-pc : Depends: grub2-common (= 2.02~beta2-36ubuntu3.2) but 2.02~beta2-36ubuntu3.1 is installed and it is kept back. libllvm3.6v5 : Conflicts: libllvm3.6 but 1:3.6-2ubuntu1~trusty1 is installed.                Conflicts: libllvm3.6:i386 but 1:3.6-2ubuntu1~trusty1 is installed.The following actions will resolve these dependencies:     Remove the following packages:1)     grub-gfxpayload-lists       2)     grub-pc                     3)     grub2-common                4)     libllvm3.6                  5)     libllvm3.6:i386             Accept this solution? [Y/n/q/?] YThe following NEW packages will be installed:  clamav clamav-base{a} clamav-freshclam{a} libclamav7{a} libllvm3.6v5{a} The following packages will be REMOVED:  grub-gfxpayload-lists{a} grub-pc{a} grub2-common{a} libllvm3.6{a} libllvm3.6:i386{a} The following partially installed packages will be configured:  python-pyaudio python-simplejson 0 packages upgraded, 5 newly installed, 5 to remove and 244 not upgraded.Need to get 9,109 kB of archives. After unpacking 29.9 MB will be freed.Do you want to continue? [Y/n/?] Y[ ERR] Writing extended state informationE: Failed to execute process to save dpkg selections, dpkg or trying to execute it exited with status/errno: 2E: failed to save selections to dpkg databaseAptitude seems to get a little further. But after selecting yes twice, it still fails to install my software. How can I sort out the mess?
Broken apt-get and broken grub
boot;apt;package management;grub2