VMware 安裝Ubuntu 系統(tǒng)的教程網(wǎng)絡(luò)上已經(jīng)有很多眉枕,在這里我就不班門弄斧啦,我后面會(huì)介紹篇博文介紹很詳細(xì)。我們這篇博文主要目的是總結(jié)安裝中遇到的問題以及解決方式录别,雖然網(wǎng)上都是能搜索到的朽色,不過比較的瑣碎麻煩,我希望我的總結(jié)能給你帶來便利
廢話不多說组题,開始吧:小!崔列!
安裝:
?https://blog.csdn.net/colin_lisicong/article/details/70193539
講的是VMware 12 安裝Ubuntu 16.04梢褐。@colin_lisicong,如果我的引用涉及侵權(quán)赵讯,請(qǐng)及時(shí)聯(lián)系我刪除此文章@啊!瘦癌!
問題:
一猪贪、這一步等待時(shí)間會(huì)比較久,因?yàn)橄到y(tǒng)在下載更新讯私,不要skip热押。如果跳過后,進(jìn)入系統(tǒng)后安裝軟件時(shí)會(huì)提示缺少這樣那樣的庫斤寇,賊麻煩
二桶癣、如何設(shè)置中文輸入法
進(jìn)入system settings–>Language Support
選擇install/removeLanguages,添加需要支持的English和中文(簡(jiǎn)體)娘锁,然后點(diǎn)擊Apply System-wide牙寞,等待即可
然后點(diǎn)擊Regional Formats 選擇對(duì)應(yīng)輸入法即可,因?yàn)闆]做搜狗莫秆,所以教程請(qǐng)自行搜索间雀。
問題:
問題一、sudo apt-get update報(bào)錯(cuò)
Ubuntu 16.04出現(xiàn):Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli;then appstreamcli refresh > /dev/null;fi'
解決:
1镊屎、sudo pkill -KILL appstreamcli
2惹挟、wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
3、sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
問題二缝驳、sudo apt-get update 和 sudo apt-get dist -upgrade 更新速度慢
1连锯、命令介紹:sudo apt-get update:獲得最近的軟件包的列表;列表中包含一些包的信息用狱,比如這個(gè)包是否更新過?
sudo apt-get upgarde 和 sudo apt-get dist -upgrade 相同點(diǎn)都是進(jìn)行更新包运怖,不同點(diǎn)upgarde是系統(tǒng)將現(xiàn)有的Package升級(jí),如果有相依性的問題,而此相依性需要安裝其它新的Package或影響到其它Package的相依性時(shí),此Package就不會(huì)被升級(jí),會(huì)保留下來.?dist-upgrade:可以聰明的解決相依性的問題,如果有相依性問題,需要安裝/移除新的Package,就會(huì)試著去安裝/移除它.?(所以通常這個(gè)會(huì)被認(rèn)為是有點(diǎn)風(fēng)險(xiǎn)的升級(jí))?,簡(jiǎn)而言之:不涉及依賴關(guān)系二者相同夏伊,存在依賴變更摇展,upgrade可能不會(huì)更新,dist_upgrad則會(huì)刪除舊的依賴署海,添加新的依賴吗购,所以會(huì)存在風(fēng)險(xiǎn)
例如軟件包?a?原先依賴?b?c?d,但是在源里面可能已經(jīng)升級(jí)了砸狞,現(xiàn)在是?a?依賴?b?c?e捻勉。這種情況下,dist-upgrade?會(huì)刪除?d?安裝?e刀森,并把?a?軟件包升級(jí)踱启,而?upgrade?會(huì)認(rèn)為依賴關(guān)系改變而拒絕升級(jí)?a?軟件包
此問題答案引用:https://blog.csdn.net/gaoxingnengjisuan/article/details/8909872
2、解決辦法:更改系統(tǒng)的更新地址
1>獲取root權(quán)限,sudo -i
2>備份文件cd /etc/apt/? ? ?
cp? sources.list? sources.backup
3>編輯鏡像:vim? sources.list
刪除文件內(nèi)容研底,3選1復(fù)制進(jìn)sources.list埠偿,然后保存即可
阿里鏡像:
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
163鏡像:
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
清華
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
問題三:sudo apt-get install xxxx?
報(bào)錯(cuò):
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
解決:
1、將/var/lib/apt/lists目錄下所有文件清空榜晦,sudo rm -vf /var/lib/apt/lists/*
2冠蒋、更新庫sudo apt-get update
3、如果還不行就sudo apt-get dist_upgrade升級(jí)庫并更新依賴
問題四乾胶、安裝python教程抖剿,這篇介紹很詳細(xì)
https://blog.csdn.net/qq_29837161/article/details/83616364
1>不過安裝過程中會(huì)報(bào)錯(cuò),因?yàn)樾枰砑右韵乱蕾?/p>
sudo apt-get update
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
sudo apt-get install libssl-dev openssl
sudo apt-get install libffi-devsudo apt-get install libffi-dev
這里就出現(xiàn)另外一個(gè)問題 apt-get 和 yum區(qū)別
一般來說著名的linux系統(tǒng)基本上分兩大類识窿,RedHat系列和Debian系列
所以u(píng)buntu安裝時(shí)使用apt-get命令斩郎,如果是其他的系統(tǒng)可能需要用到sudo? yum -y install xxx
2>sudo ln -s /opt/python3.7/bin/python3.7 /usr/bin/python3.7執(zhí)行這個(gè)命令后,大概意思就是在usr/bin/目錄創(chuàng)建一個(gè)python3.7快捷啟動(dòng)方式喻频,后面啟動(dòng)python時(shí)需要用python3.7啟動(dòng)缩宜,不知道你們什么感受,我是很難受的甥温;但時(shí)python對(duì)應(yīng)的是2.7版本锻煌,不好直接覆蓋,所以嘛退而求其次
sudo ln -s /opt/python3.7/bin/python3.7 /usr/bin/python3
問題五:使用過程中頁面莫名卡死姻蚓,短則幾分鐘炼幔,長則不知道;
原因:百度結(jié)果是ubuntu系統(tǒng)在開啟應(yīng)用過多時(shí)史简,出現(xiàn)內(nèi)存不夠用情況乃秀,系統(tǒng)開始用換硬盤上的swap分區(qū)做虛擬內(nèi)存,其速度可想而知
在ubuntu里面往往不是物理內(nèi)存全部耗盡采取使用swap分區(qū)圆兵,swappiness的值的大小對(duì)如何使用swap分區(qū)是有著很大的聯(lián)系的跺讯。 swappiness=0的時(shí)候表示最大限度使用物理內(nèi)存,然后才是 swap空間殉农,swappiness=100的時(shí)候表示積極的使用swap分區(qū)刀脏,并且把內(nèi)存上的數(shù)據(jù)及時(shí)的搬運(yùn)到swap空間里面。兩個(gè)極端超凳,對(duì)于 ubuntu的默認(rèn)設(shè)置愈污,這個(gè)值等于60耀态,建議修改為10
解決:
1.查看你的系統(tǒng)里面的swappiness
cat /proc/sys/vm/swappiness?
不出意外的話,你應(yīng)該看到是60?
2.修改swappiness值為10
sudo sysctl vm.swappiness=10?
但是這只是臨時(shí)性的修改暂雹,在你重啟系統(tǒng)后會(huì)恢復(fù)默認(rèn)的60首装,所以,還要做一步:
sudo gedit /etc/sysctl.conf?
在這個(gè)文檔的最后加上這樣一行:
vm.swappiness=10
3.修改cpu設(shè)置 和 定時(shí)釋放內(nèi)存杭跪,上面已經(jīng)對(duì)卡頓很大改善仙逻,所以這步暫時(shí)未實(shí)現(xiàn),效果如何不得而知
引用于:https://blog.csdn.net/u010746357/article/details/81813739