sudo apt-get install gksu debootstrap
gksudo gparted
。制作一个带有ext4
格式的USB,只留下1GB作为空闲内存,并将1GB设置为Linux Swap;管理标志>仅选择boot
。通过以下步骤准备操作系统并运行在USB驱动器上:
sudo mkdir /mnt/stick sudo mount /dev/sdb1 /mnt/stick/ sudo debootstrap --arch=amd64 xenial /mnt/stick http://de.archive.ubuntu.com/ubuntu/ sudo mount -o bind /dev /mnt/stick/dev sudo mount -o bind /dev/pts /mnt/stick/dev/pts sudo mount -t sysfs /sys /mnt/stick/sys sudo mount -t proc /proc /mnt/stick/proc sudo cp /proc/mounts /mnt/stick/etc/mtab sudo cp /etc/resolv.conf /mnt/stick/etc/resolv.conf sudo chroot /mnt/stick/
提示看起来像是
root@masi-CM6340:/#
。设置区域设置。%locale-gen en_US en_US.UTF-8 %dpkg-reconfigure locale dpkg-rekonfigure locales %上述两个命令会引起gnome-terminal出现错误;在此处选择您的区域设置并设置环境为en_US.UTF-8 dpkg-reconfigure keyboard-configuration localedef -i en_US -c -f UTF-8 en_US.UTF-8
apt-get install linux-image-generic
。您会看到/dev/sda [NotThisOne,您的硬盘驱动器],2 /dev/sdb (31474 MB; ???) 2b - /dev/sdb1 (30398 MB; /)
。选择/dev/sdb1
和/dev/sdb
。在此处选择您喜欢的Linux内核。我保留了最稳定的Linux内核4.6,您可以按照本文末尾所述进行下载。apt-get install vim wget
blkid
,复制到剪贴板,vim /etc/fstab
。删除sda
行,只保留两个sdb
行。将它们编辑为如下形式:UUID="..." swap swap defaulst 0 0
和UUID="..." / ext4 defaults 0 1
。将以下内容粘贴到文件
/etc/apt/sources.list
中:#deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://de.archive.ubuntu.com/ubuntu/ xenial main restricted # deb-src http://de.archive.ubuntu.com/ubuntu/ xenial main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted # deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## universe WILL NOT receive any review or updates from the Ubuntu security ## team. deb http://de.archive.ubuntu.com/ubuntu/ xenial universe # deb-src http://de.archive.ubuntu.com/ubuntu/ xenial universe deb http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe # deb-src http://de.archive.ubuntu.com/ubuntu/ xenial-updates universe ## N.B. software from this repository is ENTIRE 测试您的持久化安装Ubuntu 16.04 [alpha]
开始您的新持久化Ubuntu。在终端中执行
sudo true
命令。如果出现无法解析主机 * 连接被拒绝
的错误,请执行以下操作:# https://askubuntu.com/q/59458/25388 sudo vim /etc/hostname masi sudo vim /etc/hosts 127.0.0.1 localhost.localdomain masi [...]
可能出现的问题:Ubuntu启动时显示$(inittramfs)$。请执行以下操作...
- 您可以打开LibreOffice,Firefox等。 - `masi`在sudo组中;组正确。 - 在chroot到存储设备时,区域设置正确。 - 如果您在GUI中打开gnome-terminal时遇到错误,请在TTY1中再次运行`sudo dpkg-reconfigure locales`。这将解决问题。
报告给Videonauth的错误:
始终在测试过程中更新系统:`sudo apt-get update && sudo apt-get upgrade`。- Ubuntu的互联网浏览器。启动它会导致系统崩溃。鼠标仍然可以工作,但无法发送信号到TTY。
- Firefox。启动它会出现关于[profile exists]的警告,因此无法打开。临时解决方法
rm -r ~/.mozilla && rm -r ./.cache/mozilla
只适用于一个会话。该问题在每次登录时都存在。更好的解决方法:sudo mv -v /home/masi /home/masi_backup
,sudo mkdir -v /home/masi
,sudo chown masi:masi /home/masi
,sudo chmod 755 /home/masi
和sudo reboot
,因为某些家庭文件夹的所有权会导致错误。运行source的命令,您将获得以下差异 /etc/hostname
在一段时间后无法匹配/etc/hosts
- 有时,启动到
(inittramsfs)
运行命令:
vimdiff <(find /home/masi -printf "%P %u:%g %m\n" | sort) <(find /home/masi_backup -printf "%P %u:%g %m\n" | sort)
%LHS-file .bash_history masi:masi 600 .cache/compizconfig-1/animation.pb masi:masi 664 .cache/compizconfig-1/commands.pb masi:masi 664 .cache/compizconfig-1/compiztoolbox.pb masi:masi 664 % here many files not existing in the RHS %RHS-file (fresh installation) .bash_history root:root 600 .bash_logout masi:masi 664 .bashrc masi:masi 644 .cache root:root 700
我不明白是什么原因导致了这个bug。
升级到Linux内核4.6
按照这里的指示进行操作。Linux内核4.4存在一个普遍的暂停/恢复bug。升级到4.6版本可以解决该问题并改善系统性能。
系统版本:14.04,16.04
Linux内核版本:4.4 - 4.6