Friday, November 25, 2016

boot - Booting problems after automatic software update: TPM error and Recovering journal

Last week, after an automatic software update, my PC is having some problems when booting. The PC is a ThinkPad T400 (32 bits) with Ubuntu 18.04.02 LTS. It has dual-boot with Linux and Windows.



A few seconds after starting the boot, the system stops, the screen stay in normal Ubuntu color but with one or two bars in gradient white in the upper half of it. Sometimes after one minute the system itself reboots again, sometimes I need to force the shutdown.
In any case, during the second reboot, appears the following messages:



[1.032407] - TPM TPM0: A TPM error (6) occurred attempting to read a PCR value.  
[1.299927] - TPM TPM0: A TPM error (6) occurred attempting to read a PCR value.
/dev/sda6/: recovering journal
/dev/sda6: clean, 324482/1470769 ....



After this message I can see in the screen what system is doing until enter again in graphics mode asking for identification and password and finish the reboot without problems.
Just another information: ist I start a Terminal session and and execute the fsck command, I can see the following message:



artur@artur-ThinkPad-T400:~$ sudo fsck -n  
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
Warning! /dev/sda6 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.

Superbloco last mount time is in the future.
(by less than a day, probably due to the hardware clock being incorrectly set)
Superbloco last write time is in the future.
(by less than a day, probably due to the hardware clock being incorrectly set)
/dev/sda6: clean, 324561/14704640 files, 33330696/58808064 blocks


My question is: How to solve this problem?



Output of dmesg command:




artur@artur-ThinkPad-T400:~$ dmesg --level=err,warn
[ 0.000000] ACPI BIOS Warning (bug): 32/64X length mismatch in FADT/Pm1aControlBlock: 16/32 (20170831/tbfadt-603)
[ 0.000000] ACPI BIOS Warning (bug): Invalid length for FADT/Pm1aControlBlock: 32, using default 16 (20170831/tbfadt-708)
[ 0.036000] APIC calibration not consistent with PM-Timer: 135ms instead of 100ms
[ 0.037884] mtrr: your CPUs had inconsistent variable MTRR settings
[ 0.898904] (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
[ 1.032407] tpm tpm0: A TPM error (6) occurred attempting to read a pcr value
[ 1.224381] platform eisa.0: EISA: Cannot allocate resource for mainboard
[ 1.224383] platform eisa.0: Cannot allocate resource for EISA slot 1
[ 1.224386] platform eisa.0: Cannot allocate resource for EISA slot 2
[ 1.224388] platform eisa.0: Cannot allocate resource for EISA slot 3
[ 1.224390] platform eisa.0: Cannot allocate resource for EISA slot 4
[ 1.224392] platform eisa.0: Cannot allocate resource for EISA slot 5
[ 1.224394] platform eisa.0: Cannot allocate resource for EISA slot 6
[ 1.224396] platform eisa.0: Cannot allocate resource for EISA slot 7
[ 1.224399] platform eisa.0: Cannot allocate resource for EISA slot 8
[ 1.299927] tpm tpm0: A TPM error (6) occurred attempting to read a pcr value
[ 40.066660] ACPI Warning: SystemIO range 0x0000000000001028-0x000000000000102F conflicts with OpRegion 0x0000000000001000-0x000000000000107F (_SB.PCI0.LPC.PMIO) (20170831/utaddress-247)
[ 40.066671] ACPI Warning: SystemIO range 0x00000000000011B0-0x00000000000011BF conflicts with OpRegion 0x0000000000001180-0x00000000000011FF (_SB.PCI0.LPC.LPIO) (20170831/utaddress-247)
[ 40.066676] ACPI Warning: SystemIO range 0x0000000000001180-0x00000000000011AF conflicts with OpRegion 0x0000000000001180-0x00000000000011FF (_SB.PCI0.LPC.LPIO) (20170831/utaddress-247)
[ 40.066681] lpc_ich: Resource conflict(s) found affecting gpio_ich
[ 40.246207] excluding 0x4000-0x40ff 0x4400-0x44ff
[ 40.326155] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
[ 40.352839] excluding 0xf4800000-0xf4b7ffff
[ 40.352859] excluding 0xf0000000-0xf3ffffff
[ 41.701782] kvm: disabled by bios
[ 42.979781] clean
[ 42.980620] excluding 0x4d0-0x4d7
[ 42.981376] clean
[ 42.982130] clean
[ 42.982164] excluding 0xc0000-0xd3fff 0xdc000-0xfffff
[ 42.982208] clean
[ 42.982239] excluding 0x60000000-0x60ffffff
[ 42.983105] clean
[ 56.536275] kauditd_printk_skb: 44 callbacks suppressed
[ 62.379824] vboxdrv: loading out-of-tree module taints kernel.
[ 62.387393] vboxdrv: fAsync=0 offMin=0x201 offMax=0x975
[ 62.497615] VBoxNetFlt: Successfully started.
[ 62.505621] VBoxNetAdp: Successfully started.
[ 62.514793] VBoxPciLinuxInit



*Windows? Yes, I have dual boot with Windows and Ubuntu



Output of cat /etc/fstab:



artur@artur-ThinkPad-T400:~$ cat /etc/fstab
~# /etc/fstab: static file system information.
~#
~# Use 'blkid' to print the universally unique identifier for a
~# device; this may be used with UUID= as a more robust way to name devices
~# that works even if disks are added and removed. See fstab(5).
~#
~#
~# / was on /dev/sda6 during installation
~UUID=a7549fe0-e162-430c-920f-c19181772cfd / ext4 errors=remount-ro 0 1




~# swap was on /dev/sda5 during installation
~UUID=b1a2d1a2-b05b-4430-8a5e-78070a76d4d5 none swap sw ~0 0'



Output of df:



artur@artur-ThinkPad-T400:~$ df
Sist.fichs 1K-blocos Ocup Livres Uso% Montado em
udev 959524 0 959524 0% /dev
tmpfs 195396 2008 193388 2% /run
/dev/sda6 231409704 131425692 88206016 60% /
tmpfs 976968 42920 934048 5% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 976968 0 976968 0% /sys/fs/cgroup
/dev/loop0 14336 14336 0 100% /snap/remmina/2816
/dev/loop1 52224 52224 0 100% /snap/core18/729
/dev/loop2 150400 150400 0 100% /snap/gnome-3-26-1604/83
/dev/loop3 113792 113792 0 100% /snap/flacon-tabetai/61
/dev/loop4 52224 52224 0 100% /snap/core18/780
/dev/loop5 36224 36224 0 100% /snap/gtk-common-themes/1198
/dev/loop6 160128 160128 0 100% /snap/gnome-3-28-1804/39
/dev/loop7 260992 260992 0 100% /snap/wine-platform/127
/dev/loop8 35456 35456 0 100% /snap/gtk-common-themes/818
/dev/loop9 160128 160128 0 100% /snap/gnome-3-28-1804/35
/dev/loop10 113792 113792 0 100% /snap/flacon-tabetai/59
/dev/loop11 52224 52224 0 100% /snap/core18/940
/dev/loop12 260992 260992 0 100% /snap/wine-platform/124
/dev/loop13 80128 80128 0 100% /snap/remmina/2788
/dev/loop14 260992 260992 0 100% /snap/wine-platform/123
/dev/loop15 14336 14336 0 100% /snap/remmina/2832
/dev/loop16 55424 55424 0 100% /snap/p7zip-desktop/164
/dev/loop17 4480 4480 0 100% /snap/tor-mkg20001/12
/dev/loop18 87680 87680 0 100% /snap/core/6675
/dev/loop19 35712 35712 0 100% /snap/gtk-common-themes/1122
/dev/loop20 150400 150400 0 100% /snap/gnome-3-26-1604/75
/dev/loop21 87808 87808 0 100% /snap/core/6813
/dev/loop22 87808 87808 0 100% /snap/core/6530
/dev/loop23 160128 160128 0 100% /snap/gnome-3-28-1804/33
/dev/loop24 113152 113152 0 100% /snap/flacon-tabetai/50
/dev/loop25 150400 150400 0 100% /snap/gnome-3-26-1604/79
tmpfs 195392 16 195376 1% /run/user/122
tmpfs 195392 28 195364 1% /run/user/1000



artur@artur-ThinkPad-T400:~$



Shutdown:




Today I could see that the system is doing it normaly. But, still this week I could see the same message /dev/sda6: recovering journal. Before, after software upgrade, as per the computer sound, it seems that, before closing, the processor stops working and the screen still live with ubuntu logo and the dots under it. A few seconds after the computer shutdown definitively.
By the way, I still don't understand why being my computer a Lenovo T400 with 32 bits machine (Intel® Core™2 Duo CPU P8600 @ 2.40GHz × 2), the system was automaticaly upgraded from 16.04.05 to 18.04.1. Is this the cause of these problems?



Summarizing the problem:
To achieve a normal working session in Ubuntu, I need to give two steps.




  1. First, in GRUB wait 10 sec start the boot and a few seconds later the system stops with a gradiente strip in upper side of the screen (I can send an image). I have to force a shutdown with power off botton

  2. Restart again and in GRUB wait 30 sec and boot starts with black screen and the message:
    /dev/sda6/: recovering journal
    /dev/sda6: clean, 324482/1470769
    but the boot goes on and complete normaly.




SMART Data and autotest



I'm sorry, I've sent in Portuguese. Now I chose the secondary language and it is in English US:
SMART Data and autotest . English



Regarding with the boot on a earlier release of Kernel, I lost that opportunuty yesterday. The good release was 4.15.0-47 Generic and the system updated to 4.15.0.50 Generic and remove the 47. Now in GRUB I have release 48 and 50 and the upgrade didn't solve my problem.

apt - I am unable to install skype on ubuntu 14.04



When trying to install skype using aptitude I get the following error :



The following NEW packages will be installed:
libaudio2:i386{a} libavahi-client3:i386{a} libavahi-common-data:i386{a}
libavahi-common3:i386{a} libcgmanager0:i386{a} libcups2:i386{a}
libdbusmenu-qt2:i386{a} libdrm-intel1:i386{a} libdrm-nouveau2:i386{a}
libdrm-radeon1:i386{a} libelf1:i386{a} libexpat1:i386{a} libffi6:i386{a}

libfontconfig1:i386{ab} libgcrypt11:i386{a} libgl1-mesa-dri:i386{ab}
libgl1-mesa-glx:i386{ab} libglapi-mesa:i386{ab} libglib2.0-0:i386{a}
libgnutls26:i386{a} libgpg-error0:i386{a} libgssapi-krb5-2:i386{a}
libgstreamer-plugins-base1.0-0:i386{ab} libgstreamer1.0-0:i386{ab}
libice6:i386{a} libjbig0:i386{a} libjpeg-turbo8:i386{a} libjpeg8:i386{a}
libllvm3.4:i386{a} libmysqlclient18:i386{a} liborc-0.4-0:i386{a}
libp11-kit0:i386{a} libpciaccess0:i386{a} libqt4-dbus:i386{a}
libqt4-declarative:i386{a} libqt4-network:i386{a} libqt4-opengl:i386{a}
libqt4-script:i386{a} libqt4-sql:i386{a} libqt4-sql-mysql:i386{a}
libqt4-xml:i386{a} libqt4-xmlpatterns:i386{a} libqtcore4:i386{a}

libqtdbus4:i386{a} libqtgui4:i386{a} libqtwebkit4:i386{a}
libselinux1:i386{ab} libsm6:i386{a} libsqlite3-0:i386{a}
libssl1.0.0:i386{a} libtasn1-6:i386{a} libtiff5:i386{a}
libtxc-dxtn-s2tc0:i386{a} libudev1:i386{ab} libuuid1:i386{ab}
libx11-6:i386{a} libx11-xcb1:i386{a} libxcb-dri2-0:i386{a}
libxcb-dri3-0:i386{a} libxcb-glx0:i386{a} libxcb-present0:i386{a}
libxcb-sync1:i386{a} libxdamage1:i386{a} libxext6:i386{a}
libxfixes3:i386{a} libxi6:i386{a} libxml2:i386{a} libxrender1:i386{a}
libxshmfence1:i386{a} libxslt1.1:i386{a} libxss1:i386{a} libxt6:i386{a}
libxv1:i386{a} libxxf86vm1:i386{a} mysql-common{a} skype

skype-bin:i386{a} sni-qt:i386{a}
0 packages upgraded, 78 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.7 MB of archives. After unpacking 206 MB will be used.
The following packages have unmet dependencies:
libgstreamer-plugins-base1.0-0 : Breaks: libgstreamer-plugins-base1.0-0:i386 (!= 1.2.4-1~ubuntu1) but 1.2.3-1 is to be installed.
libgstreamer-plugins-base1.0-0:i386 : Breaks: libgstreamer-plugins-base1.0-0 (!= 1.2.3-1) but 1.2.4-1~ubuntu1 is installed.
libgl1-mesa-dri : Breaks: libgl1-mesa-dri:i386 (!= 10.1.3-0ubuntu0.1) but 10.1.0-4ubuntu5 is to be installed.
libgl1-mesa-dri:i386 : Breaks: libgl1-mesa-dri (!= 10.1.0-4ubuntu5) but 10.1.3-0ubuntu0.1 is installed.
libfontconfig1 : Breaks: libfontconfig1:i386 (!= 2.11.0-0ubuntu4.1) but 2.11.0-0ubuntu4 is to be installed.
libfontconfig1:i386 : Depends: fontconfig-config:i386 (= 2.11.0-0ubuntu4) which is a virtual package.

Breaks: libfontconfig1 (!= 2.11.0-0ubuntu4) but 2.11.0-0ubuntu4.1 is installed.


Tried with apt-get earlier which gives the following error



The following packages have unmet dependencies:
skype : Depends: skype-bin
E: Unable to correct problems, you have held broken packages.



Tried fixing with Synaptic Package Manager but the filter Broken Packages doesn't show any packages.



Tried



sudo apt-get clean
sudo apt-get autoclean
sudo apt-get install -f


Tried adding the following in /etc/apt/preferences and sudo apt-get dist-upgrade then sudo apt-get install skype:




Package: *       
Pin: release a=quantal*
Pin-Priority: 2012


None of the above worked.



Enabling Recommended Updates and Unsupported Updates in 'Software & Updates' and then installing skype worked.




It seems I didn't have the latest versions of some packages since I have disabled Recommended Updates and Unsupported Updates. I had only Security Updates enabled. I was thinking that I had the latest versions of packages but apparently I was only getting security updates.


Thursday, November 24, 2016

apt - Ubuntu 13.10: Upgrade interrupted because of openjdk-7

I was running an apt-get upgrade (not version upgrade, just normal), when I got this message:




You might want to run 'apt-get -f install' to correct these.




The following packages have unmet dependencies:
icedtea-7-jre-jamvm : Depends: openjdk-7-jre-headless (=
7u51-2.4.4-0ubuntu0.13.10.1)



openjdk-7-jre : Depends: openjdk-7-jre-headless (=
7u51-2.4.4-0ubuntu0.13.10.1)



openjdk-7-jre-lib : Breaks: openjdk-7-jre-headless (< 7u45-2.4.3-1)



E: Unmet dependencies. Try using -f.





I then run as recommended "apt-get install -f" and here is the output:




Preparing to replace openjdk-7-jre-headless:amd64 7u25-2.3.12-4ubuntu3
(using
.../openjdk-7-jre-headless_7u51-2.4.4-0ubuntu0.13.10.1_amd64.deb) ...



Unpacking replacement openjdk-7-jre-headless:amd64 ... dpkg: error

processing
/var/cache/apt/archives/openjdk-7-jre-headless_7u51-2.4.4-0ubuntu0.13.10.1_amd64.deb
(--unpack):



trying to overwrite shared '/etc/java-7-openjdk/sound.properties',
which is different from other instances of package
openjdk-7-jre-headless:amd64



Errors were encountered while processing:
/var/cache/apt/archives/openjdk-7-jre-headless_7u51-2.4.4-0ubuntu0.13.10.1_amd64.deb




E: Sub-process /usr/bin/dpkg returned an error code (1)




How can I fix this error?
Thanks



UPDATE:



The 1st time, I ran the command, there was no output. Now, running it again, I get:





dpkg: dependency problems prevent removal of



openjdk-7-jre-headless:amd64: icedtea-7-jre-jamvm:amd64 depends on



openjdk-7-jre-headless (= 7u51-2.4.4-0ubuntu0.13.10.1).



dpkg: error processing openjdk-7-jre-headless:amd64 (--remove):




dependency problems - not removing Errors were encountered while



processing: openjdk-7-jre-headless:amd64


mount: you must specify the filesystem type




I want to mount a partition to an auxiliary folder via mount to fix a damaged grub.



I used the command.



sudo mount /dev/sdb2 /home/ubuntu/temp


and got as error:



mount: you must specify the filesystem type



Why?



You need to add the -t FILESYSTEMTYPE argument to the command, replacing FILESYSTEMTYPE with your filesystem type. This specifies the filesystem type of the filesystem to be mounted. In your case, this would be /dev/sdb2. Some common, valid filesystem types are:




  • auto - this is a special one. It will try to guess the fs type when you use this.

  • ext4 - this is probably the most common Linux fs type of the last few years

  • ext3 - this is the most common Linux fs type from a couple years back


  • ntfs - this is the most common Windows fs type or larger external hard drives

  • vfat - this is the most common fs type used for smaller external hard drives

  • exfat - is also a file system option commonly found on USB flash drives and other external drives


nvidia - CUDA conflict with Wine

Every time I install Wine on Ubuntu 14.04 my CUDA gets disabled, so I can't use GPU compute with Cycles in Blender. For some reason I can either use Wine or CUDA, not both. I forgot to mention that even the OpenCL (Open Computing Language) driver gets disabled.


I have tried both of the NVIDIA CUDA toolkits, from the Ubuntu Software Center and the CUDA 6.5 toolkit from the Nvidia website. Unfortunately I get the same problem. I have three GPUs - 2 GTX 760s and one GTX 560 Ti. The moment I install Wine, Blender stops detecting them under the Compute Device. I have tried the nvidia-331 graphics driver and also nvidia-340 from the website. I don't know what else to do.


Is there a workaround for this?

package management - Are Snap and Flatpack apps safe to install? Are they "official", approved or tested for a particular distro version?



I don't like installing apps outside my distro's official repositories.



Linux security relies a lot on having a repository meticulously curated and tested for library compatibility with current distro version, stability and security.



Once I installed, from outside repos, a fancy terminal emulator that mimicked retro green/amber phosphor monitors. This app wreaked havoc in my system and I had to reinstall Ubuntu.



I hesitate a lot about using ppas as well.




I only trust very few external sources, ppas or packages downloaded from websites.



But now Snap and Flatpack seems to be all the rage in Ubuntu-specialized sites.




  • Is it safe to install Snap apps or Flatpack apps?

  • Are there official repos for such?

  • How is stability taken cared of with this non-apt stuff?




Snaps have the https://snapcraft.io/ repo - this is run by Canonical, the same people that build Ubuntu.



Flatpaks have an official repo at https://flathub.org/ . Flatpaks were developed by Redhat but I don't know if they manage the flathub repo or not.






Stability:



The stability of the individual packages, of course, rely on the quality of the build and are at the mercy of the maintainer.




Both flatpaks and snaps are built completely using the dependencies they need inside a sandbox but both handle this a little differently



Snaps build a mount point and the system mounts the program archive and runs it from there.



Flatpaks are built in /var/flatpak/ for system-wide (global) installs and in ~/.var/app on the local side.
Flatpak mounts those and runs them



The good news about stability is that if you get a wonky application in either it is contained and will not make the rest of your system unstable by installing libraries that cause conflicts with other installed apps.




Both are self contained applications with all the needed information to run. This is what makes this distro-agnostic and allows them to be installed on any Linux system that supports them (flatpak or snap)






Security:



This is a little more ambiguous.



Snaps only have the official repo. There was one reported case of malware getting into the repo but it was caught quickly and removed. If I remember right it was a cyrptocurrency mining software that would send some of the mined currency back to the app maintainers without the users knowledge. Even with that there was no other ill effect from the app and afiak it was unable to access the home folder of the user.




Flatpaks: If you use the official repo it should have about the same security as Snaps, nothing is perfect but anything that makes it in will be very quickly noticed and removed if it is malware and made it past the initial submission review.



I would personally doubt that anything overtly malware like a virus would make it into either Snap or Flatpaks repos and anything with sneaky unwanted behavior like the aforementioned cyrptocurrency app would stay in very long.



Overall I would say that both are safe but neither is as inherently safe as the official Ubuntu sources, but this goes for PPAs as wel. Adding any sources outside of Ubuntu's official sources is not quite as safe.



I do have to add a caveat here, there are other Flatpak repos out there, most are for legitimate programs that just want to host their own repo rather than use flathub. Those are completely outside any quality control of flathub and should only be added if you trust the developers of the program. This would also go for adding snap repos but I don't think that at this time there are any but the official Snap repos.







As to the whether or not flatpaks and snaps are safe to install:



Overall that are safe as long as you stick to the official repos, look over the description of the packages you want to install and don't install anything that looks even a bit shady.



Both are a great way for users to have safe (as safe as can be expected outside a distro's official package sources) way to install software that are not available any other way and have them "just work".



For example I have Spotify installed as a Snap and Teamspeak 3 installed as a flatpak. While Spotify is available via a ppa, using a snap allows me to avoid cluttering apt with ppa that I can avoid using.



Teamspeak would only be available for me with a .run that unpacks the folder and then you put the extracted folder in your home directory and click on the sh file or use the command line to start. While I did this before and then made a desktop launcher to launch it for me then added that launcher to my ~/local/share/applications folder to launch it. It was so much easier to just install the flatpack in one step and have it work.







"Once I installed, from outside repos, a fancy terminal emulator that mimicked retro green/amber phosphor monitors. This app wreaked havoc in my system and I had to reinstall Ubuntu."



To address that part of your lead up to your question:



I would suspect that reason the ppa completely hosed your Ubuntu install is because it brought in newer libraries as dependencies that your native programs were unable to use or overwrote your installed libraries with older ones that were too outdated to be used by your native Ubuntu.



The good thing about both snaps and flatpaks is that they will bring in any libraries they need to run inside their own folders. Snaps and flatpaks are self contained and will not touch any of your system files or libraries.




The disadvantage to this is that the programs might be bigger than a non snap or flatpak version but the trade off is that you don't have to worry about it affecting anything else, not even other snaps or flatpaks. If the app is broken because it brought in bad libraries or for any other reason you just uninstall it and it is completely gone.


installation - What factors should be considered when installing packages manually?


I have seen many packages' readme or install files on instructing how to install a package manually. But many times the results are erroneous.


They instruct us to do many thing with for example the configure file.


But many, many factors are involved in this procedure (dependencies, make, path variables and much more).


I am yet able to install a single package manually.


What are the common factors that should be considered with manual installations?



I am answering this question under my knowledge .


you have to install build-essential to compile any package manually .


     sudo apt-get install build-essential

Then you can configure your package with ./configure
Then make and sudo make install
But one more thing you have to remember is that package dependencies . If you are installing a package means those will obtained automatically ,if not
sudo apt-get install -f will do the job .


In the case of No internet connection , you have to collect all of them and thats a risky job , my opinion .


So if you want to install a package manually then you have to take care of the compilation tools nothing but build essential and dependencies of that package .


The above explanation applicable for any source packages .


But if you got builded packages directly i mean .DEB files then simply you can install them with


sudo dpkg -i filename.deb

and here also if dependencies issue may raise and you can take care of them with sudo apt-get install -f


If you got that package as a script(.sh) or binary file (.bin ) , the you can install with


chmod +x filenmae.sh
./filename.sh

for binary


chmod +x filename.bin
./filename.bin

11.10 - Can&#39;t boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...