0

I am using Ubuntu 18.04. After my Laptop froze, I hit the power button to shut it down and rebooted it. The login screen came up, I entered my credentials and then got a black screen and the cursor. Nothing more. I have been recently installing some package to use an Pinyin/ Chinese keyboard and yesterday installed some updates (but hadn't restarted until today morning). Hot button don't work and can't change to Function keys either.

Has anyone had this experience? Is there any way to restore it without losing data?

karel
  • 114,770
  • 1
    Can you boot to an earlier kernel version: https://askubuntu.com/questions/1014634/how-to-access-advanced-options-in-grub/1014753#1014753 in recovery mode? If so, you can try to fix the problem in recovery mode. – karel Oct 24 '18 at 09:39
  • 1
    Recovery mode works. Entered recovery mode: Recovery Menu (filesystem state: read-only). Suggestions on how to proceed? – Chronicle Oct 24 '18 at 09:46
  • Ok, I am acting really stupid here: THe GNU GRUB shows: the following: Ubuntu, with Linux 4.15.0-35-generic; Ubuntu, with Linux 4.15.0.38-generic (recovery mode); Ubuntu, with Linux 4.15.0-36-generic; Ubuntu, with Linux 4.15.0-36-generic (recovery mode). I chose the recovery mode 0-36. And then it shows me the following: Recover Menu: - resume; -clean; -dpkg; -fsck; -grub; -network; -root; -system summary. – Chronicle Oct 24 '18 at 10:06

1 Answers1

0
  1. Immediately after the motherboard / computer manufacturer logo splash screen appears when the computer is booting, with BIOS, quickly press and hold the Shift key, which will bring up a GNU GRUB menu screen. With UEFI press (perhaps several times) the Esc key to get to the GNU GRUB menu screen. Sometimes the manufacturer's splash screen is a part of the Windows bootloader, so when you power up the machine it goes straight to the GNU GRUB menu screen, and then pressing Shift or Esc is unnecessary.

    The timing when to press the left Shift or Esc key can be tricky, so sometimes if you miss it you need to try it again.

    You will see a GNU GRUB menu screen that looks like this:

enter image description here

  1. From the next screen select any recovery mode option.

enter image description here

  1. From the Recovery Menu use the arrow keys to select network, press the Tab key to put the focus on <OK> and press Enter.

  2. From the Recovery Menu use the arrow keys to select root, press the Tab key to put the focus on <OK> and press Enter.

enter image description here

  1. Check Where can I look up my update history?, and write down every package that was updated in the last update.

  2. Fix E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

    Up to this point you can run commands in recovery mode, but the commands that you try are not always successful because of package management issues. You can't install software or access the all the default software repositories. I recommend running the Ubuntu live USB/DVD that you used to install Ubuntu as a live session in order to check if the Ubuntu live session also freezes. This is to check the possibility that the freezing may be caused by a hardware issue.

karel
  • 114,770
  • Ok, thanks. So far I could open the shell prompt in 0-36-generic (recovery mode), which is the oldest kernel. Using dpkg as instructed in point 3. got me several files: Some are linux-headers, others are linux-images, linux-modules (all have severalversions 36 or 38). Which of these do I have to remove? – Chronicle Oct 24 '18 at 10:38
  • Ok, all done. Only the 36 version showing in GRUB, but after login the screen remains black with a movable white cursor. – Chronicle Oct 24 '18 at 10:49
  • Hm, that bring up a whole new problem: Among others: "W: Not using locking for read only lock file /var/lib/dpkg/lock". Could it be that the network is not on? – Chronicle Oct 24 '18 at 11:11
  • That was my mistake. I forgot that you are already the root user, so you don't need to use sudo to run commands that require root permissions. – karel Oct 24 '18 at 11:15
  • It states: Err 1: http://ch.archive.ubuntu.com/ubuntu ionic/universe amd64 lightdm amd64 1.26.0-0ubuntu1; Could not resolve 'ch.archive.ubuntu.com; E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/pool/universe/l/lightdm/lightdm_1.26.0-0ubuntu1_amd6.deb; Coul not resolve 'ch.archive.ubuntu.com'; E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? – Chronicle Oct 24 '18 at 11:16
  • sorry my mistake. It states bionic. – Chronicle Oct 24 '18 at 11:21
  • Run add-apt-repository universe to add the missing universe repository and try again. – karel Oct 24 '18 at 11:24
  • "Traceback (most recent call last):" a bunch of "File "/usr ..." , then: FileNotFoundErroe: (Errno2) No usable temporary directory found in ('/tmp, '/vartmp', 'usr/tmp', '/root'. Then "Error in sys.exceptbook: " , then "OSError", then "Original exception was: Traceback (most recent call last": ... . Then again the same message "FileNotFoundError: (Errno 21). – Chronicle Oct 24 '18 at 11:35
  • Run apt install --reinstall ubuntu-desktop && reboot – karel Oct 24 '18 at 11:38
  • This won't delete any data saved on the disk will it? – Chronicle Oct 24 '18 at 11:41
  • This command gives me the same: "Could not resolce 'ch.archive.ubuntu.com' from above.; "E: Failed to fetch ..." ; "E: Unable to fetch some archives, mayge run apt-get udpate or try with --fix-missing?" – Chronicle Oct 24 '18 at 11:52
  • Can I transfer the data (which is not encrypted) via root shell prompt to a external harddrive and then fully reinstall via USB drive Ubuntu again? – Chronicle Oct 24 '18 at 11:55
  • Run man cp for more information. – karel Oct 24 '18 at 12:11