Ubuntu16.04 use of the problem record

Source: Internet
Author: User
Tags local time pack gparted

Record the errors/problems that I have encountered during my use of the Ubuntu system. The native system is Ubuntu 16.04 Lts,64-bit.

  1. Input method Settings--Installs the Linux version of Sogou pinyin

Because a variety of solutions have been tried, it is possible to confuse each step, listing only the actions that you have tried, rather than one specific method.

(1) Change the keyboard Input Method system option in System setting->language support to FCITX;

(2) in the Install/remove Language popup dialog box, select the Chinese Language pack and click Apply. Complete the installation of the Chinese language pack;

(3) in Sogou official website download Sogou for Linux Deb installation package, here the author directly by clicking to install, no error;

(4) Click the "+" button in the system Setting->text entry->input sources to use, find the Sogou Pinyin (FCITX), add, the right side can also choose to switch the shortcut key mode;

(5) Under the same interface, click the button similar to repair, enter into the input method Configuration, click on the bottom left corner of the "+" button, look for Sogou input method, if not found, you can click Cancel below the only Show current Language, choose the input mode of Sogou, click OK, at this time should already be set by the switch shortcut key to enter the mode of switching.

  2. For dual systems in Windows and Ubuntu, the BIOS time will change at startup (see Ubuntutime)

The problem arises because Windows differs from the Linux default setting of the hardware clock (hardware clock). Windows sets the hardware time to local time (localtime) and Ubuntu defaults to UTC time. In other words, when the 7:00pm shuts down, Windows sets the hardware clock to 7:00pm, and the hardware continues to tick at this time, and the correct local time is read at boot. For Ubuntu, 7:00pm is converted to UTC for storage by default, and the time it takes to read the hardware clock is converted to local time when it starts. This will cause a problem with the Windows boot time after Ubuntu shuts down.

Workaround:

1. Disable UTC and use local time. For older versions of Ubuntu, change the option for UTC in ubuntu config file/etc/default/rcs from Yes to No. For newer versions, you can use the command sudo timedatectl SET-LOCAL-RTC 1 that can be set. The corresponding shutdown using the local time function can be used with sudo timedatectl SET-LOCAL-RTC 0;

2. Set Windows to use UTC time (verified through in Windows8.1 and WINDOWS10). Desktop right-click Windows icon-right button, run-->regedit, select Hkey_local_machine->system->currentcontrolset->control-> TimeZoneInformation, a registry key for time information appears, right-click New-->dword (32-bit)/qword (64-bit) (the number of bits is determined by the number of system bits)- Change the project name to Realtimeisuniversal--> to change the value to 1 and the format to 16. or refer to the method in the link, that is, create a new registry file to achieve the same functionality.

  3. Remediation o.o after deletion of/etc directory (with Backup)

  An accident occurs during the practice of using the Package command tar. I practice using the TAR directive to package/etc. And in/TMP to create a new/etc directory for decompression, decompression, found that the tar produced files extracted from the results of the production of a complete/etc directory, resulting in the/TMP/ETC/ETC directory structure. Then enter the/TMP/ETC directory, want to duplicate inside/etc directory using the RM-RF command to delete. The result was taken for granted using the RM-RF/ETC command ... Found the/etc directory under the/tmp/etc file still exists ... Then suddenly realize that you have deleted the/etc folder with absolute path.

Remediation process:

(1) Due to the practice of the tar command, there are compressed files generated by/etc files. Try to extract the compressed files to the root directory, prompting permission denied. Attempting to use the sudo command to indicate that the UID is not recognized, presumably because files such as/etc/passwd and/etc/shadow about the user's information have been deleted;

(2) Try to find the data online, the results found that the network link is not available. The reason and the configuration file is missing also has the relation;

(3) Think of the previously seen restart into the single-user debug mode to try to repair, but because the/etc directory is missing, fear may not enter the single-user mode, and once the shutdown will no longer enter the system (/etc directory is not), so there is no attempt to do this method;

(4) Because the file system is the existence of/etc backup, it is necessary to find root permissions to write back the backup files to the original/etc directory, but the current system because there is no/etc directory and can not elevate permissions. Finally, I thought of the way to use the Live CD. With a USB flash drive with a Linux installer installed, set the BIOS to boot from the USB flash drive and use the trial options that the installer comes with. You can use sudo to elevate permissions. After entering trial mode, use sudo fdisk/dev/sda (different device names may be different) to get the system's disk partition, respectively, to mount the required file system (in the case of the author is separately mounted/and/home), Then use the sudo command to write back the backup information to the mounted root directory. Finally restart, found that can enter the system, problem solving!

Lenovo: Since you can use the Ubuntu Live CD to restore the/etc folder using the backup file, whether you can do new users on the live CD, etc., and then directly to the live CD/etc for the deleted/etc recovery? This way, although some of the configuration files will be lost, but in the absence of backup, the ratio of the system is much more cost-effective? Of course, for the configuration of a large number of systems, first or regular backup.

Experience and lessons learned:

(1) In the Linux command when the command is not taken for granted, especially for root privileges, bring great convenience at the same time may also nurture the devil, the role of the command and the potential effect must be retried;

(2) on the path problem with Linux, there are only absolute paths and relative paths, corresponding to the command that produces the problem, the use of relative paths should be./etc, while absolute paths should use the full pathname of/tmp/etc/etc, and/etc is considered an absolute path. thus causing problems;

(3) Backup is very important. This problem can be solved to a certain extent thanks to the practice of using the packaging instructions tar, so there is a backup, otherwise there will be more trouble. In contrast, there are many problems that can be solved if there is a backup and the powerful features of the live CD. So there is the habit of backup, good backup, will be at the critical moment to help a lot of busy.

  4. The issue of running 32-bit programs in 64-bit Ubuntu environments

  In the Csapp matching buffer experiment, found that the experiment provided hex2raw for 64-bit program, can not be used in 32-bit environment (through the command file Execname to view the information about the file), after switching to 64-bit environment, found another program Bufbomb 32-bit, It is theoretically possible to run in a 64-bit environment, but the actual use of the./bufbomb command runs, bash always error bash:./bufbomb:no such file or directory. You can see that the device is not yet able to handle 32-bit programs.

By searching, it was found that in the UBUNTU64 bit environment you would need to install an additional 32-bit compatible library to perform 32-bit programs. The answers found are:

Some of the information collected is:

(1) The environment required for 32-bit programs can be installed through an installation package ia32-libs prior to the Ubuntu13.10 version;

(2) for a later version of Ubuntu13.10, if you only need to run a single program, you can view the system prompts when you try to run the program, such as missing a library, you can use sudo apt-get install libname:i386 installation of the corresponding I386 system library solution;

(3) You can also directly install the common library under the i386 architecture, which makes the 64-bit system compatible with 32-bit programs; use sudo dpkg--add-architecture i386 to include i386 architecture without using--force-architecture option specifies the system list of installed packages that can be installed. Install the 32-bit program to run the common library files, sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386, you can run. (main reference Askubuntu)

  

  5. About the constant space saturation of/boot partitions

The initial installation of the system for/boot allocated roughly about 120M of space, think should be enough, the results found that in the OS update, the new kernel files will also be placed in the/boot folder, directly resulting in/boot left out of the system error situation, so need to make some adjustments. There are several main solutions to be collected:

(1) can enter the/boot directory, if there is more than one kernel version of the kernel files, you can make a number of delete operations, must be cautious, do not delete the kernel files in use, do not use this operation when the OS update is in progress;

(2) using the command sudo apt-get autoremove,apt-get's autoremove option will automatically download packages that were previously downloaded to meet the dependencies of other packages but are no longer needed. Use this command to delete some old kernel files in/boot (but not limited to this). You can also add the--purge parameter to this command, the corresponding configuration file will be deleted when the above file is deleted, this method may also require a portion of the remaining/boot space, so it is more suitable for the normal situation of space cleanup, and can not be used when/boot near saturation to clean up.

(3) using the Live CD method, the GParted tool is used to resize the partition, reduce the size of some partitions, and allocate space to/boot. GParted software currently appears to be included only in the live CD version of Ubuntu. You can find the corresponding software by booting into the live CD from the USB stick, choosing to try Ubuntu, and typing gparted in the software search. In the GParted interface, select the correct hard drive (upper right corner of the interface) and partition, right-click Resize, and you can set the size of the partition you want to modify by dragging the icon or typing a number. After all the modifications have been set, click the √ button above the interface to begin the previous setup operation.

Note: Modifying the/boot partition may affect the system restart (the author does not encounter this time), the operation of the data partition should be done in advance backup operations.

You can refer to the tutorial: How to Resize Your Ubuntu partitions

(4) in the Ubuntu forum to see a program, in the appropriate directory to create a sufficient space for the folder, and the original/boot directory files to the folder, and then modify the/etc/fstab in the mount relationship, so that the system at startup to mount the new folder. Personally think that just create a new folder can not be mounted, if there is still a large unallocated space on the device, it is possible to use Fdisk to create a partition of the appropriate size, and then copy the/boot content (some data should need to use DD instead of the simple CP) to the new partition, this time modify/etc/ The mount relationship in Fstab should be feasible. I feel this method is more secure than using gparted because there is no data to move and modify other partitions, but the first need to have unallocated extra space, next may need to modify some boot-related information (such as grub information), the author did not try, only to state the idea.

  

  6. A solution with the following error message

E:could not get Lock/var/lib/dpkg/lock-open (11:resource temporarily unavailable) e:unable to lock the administration Directory (/var/lib/dpkg/), is another process using it?

From the literal message of the error, it is mainly due to the inability to lock the process that needs to run, and the system asks if there is another process using the lock. This is because when the APT command is used, the corresponding process is locked and the lock is released at the end of the process. However, if a process is blocked during operation, the lock cannot be freed, and subsequent lock-up processes will not work.

Workaround:

(1) According to the system prompts, check if there is really another apt process in use lock. Using the command PS aux | Apt shows the process of all names containing apt, to see if the process is running properly, and if it is running in a stagnant state, it can be forced to end with the kill PID. Note that the above process is also likely to be a functioning apt process (such as the installation operation that was specified before the normal operation), In that case, you should wait for the process to end, rather than force it to stop. The above method is more effective for apt-get process.

(2) The above situation is very easy to happen in the process of the user just entered Ubuntu, the apt operation, it seems that some new versions of Ubuntu introduced the Automatic Update feature, the system will check for new version updates after each boot, and automatically update operations without the need for user participation. You can balance the need to close the operation, and if the user can persist with manual updates, you can choose to turn this service off.

sudo systemctl disable apt-daily.service # makes automatic update service no longer booting up sudo systemctl disable Apt-daily.timer   # makes it no longer possible to use a timer

The corresponding start-up service simply enables the disable modifier in the above command. The main reference here.

(3) Delete the folder associated with the lock operation of Apt. It is recommended that you use this action only if all of the methods are not working, and you can refer to the first answer here.

Ubuntu16.04 use of the problem record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.