解決Ubuntu 22.04安裝AMD 顯卡驅動失敗的問題

每次升級Ubuntu系統都總能搞出一些新問題….
跟我一樣從AMD 官網(https://www.amd.com/en/support/linux-drivers) 下載amdgpu-install 程式的朋友們應該都遇到跟我一樣的情況:那就是系統會提示所需套件rocm-llvm無法安裝,導致AMD Driver也跟著無法安裝的問題。

原因是在於ROCm目前還不支援Ubuntu 22.04,所以才會發生這種事情;幸好在Github Issues上有人提出了解決方法,才終於能夠順利安裝:

1. 從Github上下載rocm_dummy_packages這個項目:

https://github.com/jacodt/rocm_dummy_packages

2. 切換到項目資料夾,安裝裡面所有的deb包:
dpkg -i *.deb

3. 安裝libstdc++-10-dev:

sudo apt-get install libstdc++-10-dev

4. 重新執行amdgpu-install,問題解決。

參考資料:

ROCm fails to install from APT repository in 22.04 #1713

https://github.com/RadeonOpenCompute/ROCm/issues/1713

Ubuntu 20.04上解決以Lutris運行Warcraft 3 重製版黑屏問題

Lutris真的是很偉大的存在,跟GE Proton一樣偉大。多虧了它們我才終於能夠在Ubuntu上實現玩大部份的遊戲,然而Battle.net和暴雪的遊戲對Wine的支援性實在是低得令人髮指,近期的更新甚至搞的Battle.net都安裝不了。

以下記錄我成功安裝Battle.net,並正常運行Warcraft 3 重製版的方法。

(此處默認電腦已經成功安裝上Lutris)

1. 將Lutris的默認Wine版本設定為Lutris-5.7-11.

2. 在Lutris上下載並安裝Warcraft 3 重製版。(選取Another Version的那段安裝Script)

https://lutris.net/games/warcraft-iii-reforged/

3. 這段安裝Script並不會直接幫你安裝好遊戲,而是直接安裝戰網;安裝完畢後,正常地登入Battle.net,正式下載Warcraft 3 重製版,等待下載完成。

4. 啟動遊戲後,正式情況下應該是會黑屏並且彈出遊戲的,這是正常表現。

5. 之後關掉Battle.net,在Lutris裡單點Warcraft 3 重製版,選擇wineticks,點擊「選擇預設的容器」,確定 =>「執行Wine設定的程式」,確定。

6. 新增Warcraft 3資料夾內的BlizzardBrowser.exe至應用程式設定中(正常路徑為/Program Files (x86)/Warcraft III/_retail_/x86_64/BlizzardBrowser/),將Windows版本設定為Windows 7。

7.  DLL覆寫設定裡,加入d3d11, dxgi 。

8. 最後再次重新啟動Warcraft 3,一切大功告成!

幾經辛苦可算是終於給我找到問題的答案了….

 

參考資料:

https://github.com/doitsujin/dxvk/issues/1866

感謝@ orklann 提供解決方法。

記一次在Ubuntu 20.04上玩FF14的經驗

註:本篇文章編寫時用的是Ubuntu 20.04,但理論上應該20.04 之後版本,甚至Steam Deck都適用文中提到的方法。

最近買了一塊外接1TB的SSD硬碟,然後在上面安裝了Ubuntu 20.04--運行速度不但比裝在HDD時快多了,還能體驗大容量硬碟空間帶來的安全感,實在太爽了!
然而跟Windows不一樣,Linux很少會累積太多的垃圾檔案,而我的重要檔案又基本都放在HDD上,所以1TB的空間其實在正常使用的情況下實在是略多了一點。

於是我就開始嘗試挑戰在Linux上玩遊戲了!

眾所周知,雖然現在Linux 上原生的遊戲已經十年前多很多,但相對來說依然是九牛一毛。然而多虧了Staem Deck的存在,現在用Wine 玩Windows 遊戲也是一個非常理想的選擇了!而我第一款挑戰的遊戲,就是我目前最愛的網絡遊戲--FF14。

實現的方法很簡單:

1. 確認系統已經安裝最新版的顯示卡驅動程式。

我個人使用的顯卡為AMD,Nvdia的我並不太清楚安裝方法,以及運行FF14時的效果…抱歉;)

要下載AMD的最新顯卡驅動,需要前往官方網站尋找對應顯卡的型號,再下載驅動程式安裝器(Radeon™ Software for Linux® installer):

https://www.amd.com/zh-hant/support/graphics

安裝過後,在命令行裡輸入:

amdgpu-install

安裝完成後重啟電腦即可。

2. 前往Flathub,下載並安裝名為XIVLauncher 的第三方啟動器。這是一個基於GPLv3 的自由軟件,請放心使用 🙂

https://flathub.org/apps/details/dev.goats.xivlauncher

要安裝Flathub上提供的軟體,需要先安裝Flatpak:

sudo add-apt-repository ppa:flatpak/stable
sudo apt update
sudo apt install flatpak

3.安裝完成後,啟動XIVLauncher,並輸入你的FF14帳號及密碼,點擊登入。(注意:如果你購買的是Steam版的FF14,請先啟動Steam,並將”Use Steam service” 打勾)

4.登入後,如果你是第一次使用XIVLauncher,它會開始在你的電腦上安裝對應的Wine版本,並且下載及安裝最新版本的FF14。

5.安裝完成後,你就可以經由XIVLauncher啟動FF14,並如同Windows上那樣遊玩了。Have Fun!

有時侯在經XIVLauncher啟動FF14時,有可能會出現明明啟動了卻沒有反應的情況,請不要慌張:你只要重啟XIVLauncher,再Login一次就可以了。 祝大家在艾歐澤亞過得快樂!

解決Ubuntu 20.4 Deepin Wine QQ登入即當機的問題

(本篇已經過期,關於如何在Ubuntu上取得最新可用版的QQ,請參考以下文章:
https://zhuanlan.zhihu.com/p/428285559

自從因為一些私人原因每天都要用到QQ後,這玩意就成為了我用Linux時永遠的痛。
以前還有完美的WebQQ可以使用,現在沒有這個選項了。那麼到底該怎麼辦呢?你說用虛擬機吧,肯定不會出任何BUG,但Windows10佔的記憶體是真的太多了遭不住。
用第三方QQ客戶端吧,功能也挺完美的,但是討論組沒法正常用。

最後還是得投靠Deepin Wine上的QQ,但這玩意前陣子在更新後也沒有辦法正常運行了--只要一登入就會當住,閃退,根本沒法用。

最後的解決方案是這樣的:

1. 按照Github上的教程安裝Deepin-wine-ubuntu。
https://github.com/wszqkzqk/deepin-wine-ubuntu

2. 下載並安裝舊版的QQ軟體包:
wget https://gitee.com/wszqkzqk/deepin-wine-containers-for-ubuntu/raw/master/deepin.com.qq.im_9.1.8deepin0_i386.deb
sudo dpkg -i deepin.com.qq.im_9.1.8deepin0_i386.deb

3. 登出系統並重新登入。

4. 如同平常那樣使用Deepin QQ-看,成功了!

有夠蠢的。

Ubuntu 20.04上解決Gcin無法在FocusWriter等軟件上輸入中文的問題

Gcin和Hime一向都是我最喜歡的中文輸入法,然而前者在某些軟件上(例如我平常寫作用的FocusWriter)無法輸入中文,而Hime則是有著同樣的問題之餘,還會跟Android Studio和VLC等軟體衝突,因此一直讓我感到非常苦惱。

後來我發現Gcin社區上有人遇到跟我一樣的問題,決定在這裡分享自己的解決方法--那就是不要安裝Ubuntu 20.04自帶的Gcin!

以下是Gcin官方網站上提供的新版套件,以及它的安裝方法:

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 835AB0E3
sudo add-apt-repository “deb http://hyperrate.com/gcin-ubuntu2004 eliu release”
sudo apt-get update
sudo apt-get install gcin

在安裝之前,記得-一定要-徹底移除舊版Gcin,否則會發生衝突而無法順利安裝!

完成之後,FocusWriter就應該能夠順利輸入中文了。祝寫作愉快!

 

平田志穗子- Ying Yang 歌詞翻譯

no no no no “yes yes yes yes”

no no no no “yes yes yes yes”

ain’t no such thing as trust nor justice
信任也好 正義也好 這世上並不存在

so disgusting y’all ass kissers
所以你們才要隱藏自己 像條噁心的馬屁蟲般委曲求全

y’all die spell curse came from hell
我要從地獄詛咒你們全都去死!

“past is what you don’t wanna dwell”
「你也不想沉溺於過去吧?」

it’s all BS it’s all garbage
閉嘴 你們這群垃圾 說的全是廢話

“I say neither, it’s vice versa”
「不是的 並非如此」

lost in himself
他已迷失於

maze he has made
自己創造的迷宮

“just trying to reach out reach out
「無論如何努力逃避

ain’t those bluffings gonna get you out”
自欺欺人都不會讓你得到解脫」

hmm… nothing but middle finger
哼….而我卻只想對你舉中指

I hate talking to ignorants, stop the whimpers
所以我才討厭跟無知的小鬼說話,快閉上你那煩人的嘴

“misunderstanding man that’s too much overrreacting
「你誤會了 請不要如此激動

better go retract that
現在回頭還來得及

statements on it, you can’t own it”
你不能背負這一切」

I am flawless “more like thoughtless”
我是完美無缺的 「不,這只是在放棄思考」

chasing stars afar(so so far)
追遂遠方的繁星 (遙遠而漫長)

overlooks his own path(dark dark night)
卻迷失在路途上(在這深暗的夜晚)

where is light when needed he didn’t get it
在最需要光明的時侯 卻未能尋得

enough for a man to lose sight for a frail pride
足以讓人因為虛榮心而變得盲目

so lost in the starless night
在無星夜下彷徨

sun don’t rise
明日並不會迎接

on the blinded mind
陷入盲目的人

around and around there goes now
明明一切都是伸手能及

waiting for another falling
卻選擇等待他人與自己一同墮落

let their be stars to guide him the way
願那些人能成為繁星 為他指引道路

in this poor night
在這悲傷的夜晚裡

so numb he’s become so numb
變得麻木的他

ways of life
即使眼前有無數的道路

so exhausted
仍選擇放棄一切

he will not be who he’s not
因此他將無法改變自己

so sick of lies over lies but
厭惡無數謊言

can’t tell what is a lie anymore
到最後卻無法分清真假

he’s going so numb
只能停止思考

your crew love that gibberish
那些狗屁不通的話 只有你的伙伴會喜歡

to me that’s illiterate
對我來說不過是笑話

makes me want to obliterate it
讓人恨不得讓他們全數消失

“you just love being bitter-y? don’t ya
「你只是試圖用痛苦讓自己感覺好一點,不是嗎?

I am thinking you just might be
我開始覺得

you just like me I’m just lucky
你和我是如此相像…只是我比較幸運

just took it wrongfully and it just
而你則是誤入歧途

might not be entirely your fault”
但這些並非全是你的錯」

just let it go
放開執念

open the door
打開新的門扉

no words can mean anything at this point so we must battle
廢話不必多說 我們注定必須戰鬥

“that’s just you and that’s how you mishandle thing mishandle mishandle now!”
「你這樣執迷不悟 只會犯下更多的錯!」

now you’re telling me what to do?
你這是想指使我做事嗎?

let me tell you who rules
還是讓我來告訴你 誰才是掌管一切的人吧

“come on this ain’t nothing to rule over this matter brother
「不 我們並沒有上下之分

you and I we ain’t so different
你和我之間的差別

I guess I had more blessings
只是我得到更多祝福

without it you got belligerent
而你因此抽到了鬼牌

but I totally understand
但我完全明白

glass was half full for mine”
對我來說,杯子是半滿的」

and it looked half empty for me
在我看來,這卻是半空的

maybe that[one glass] made the path we took who knows?
也許就是對「杯子」的想法,讓我們走上了不同的道路?

chasing stars afar(so so far)
追遂遠方的繁星 (遙遠而漫長)

overlooks his own path(dark dark night)
卻迷失在路途上(在這深暗的夜晚)

he who knows not and knows not then he knows not…
他並不理解自身 也不明白有何意義 更一直未能察覺

but he could just easily be
但其實只要他願意

oh anyone
改變是如此簡單

so lost in the darkest night
迷失在至黑之夜裡

where’s the love?
當人需要愛時

when one needs it?
它到底在何處?

around and around there goes now
明明一切都是伸手能及

waiting for another falling
卻選擇等待他人與自己一同墮落

let their be stars to guide him the way
願那些人能成為繁星 為他指引道路

in this poor night
在這悲傷的夜晚裡

so numb he’s become so numb
變得麻木的他

ways of life
即使眼前有無數的道路

so exhausted
仍選擇放棄一切

he will not be who he’s not
因此他將無法改變自己

so sick of lies over lies but
厭惡無數謊言

can’t tell what is a lie anymore
到最後卻無法分清真假

he’s going so numb
只能停止思考

just let it go
放棄那份執念和

maze he has made
犯下的一切錯誤吧

Ubuntu 20.04 Spotify無法播放本地音樂問題

一開始以為Ubuntu20.04不能播放本地音樂是資料夾問題,結果一查才發現原來只是缺少了某些Library罷了。 

首先安裝必要的軟體:

sudo apt install ubuntu-restricted-extras ffmpeg

下載Spotify提供的Library並複製檔案至:

git clone https://github.com/ramedeiros/spotify_libraries.git
cd spotify_libraries
sudo cp lib* /usr/lib/x86_64-linux-gnu/

執行ldconfig:

sudo ldconfig
#修正檔案連結
sudo ln -frs /usr/lib/x86_64-linux-gnu/libavutil.so.52.6.100 /usr/lib/x86_64-linux-gnu/libavutil.so.52
sudo ln -frs /usr/lib/x86_64-linux-gnu/libavformat.so.54.36.100 /usr/lib/x86_64-linux-gnu/libavformat.so.54
sudo ln -frs /usr/lib/x86_64-linux-gnu/libavcodec.so.54.71.100 /usr/lib/x86_64-linux-gnu/libavcodec.so.54

 完成。其實我也只是照樣參考資料寫的,這個解法… 

參考資料:

https://community.spotify.com/t5/Desktop-Linux/Linux-Local-files-do-not-play-on-Ubuntu-16-04-SOLVED/td-p/1343831

Ubuntu 18.04解決無法使用VirtualBox共享剪貼簿的問題

裝在VirtualBox裡的Ubuntu18.04之所以辦法共享剪貼簿,是因為缺少了名為virtualbox-guest-x11的套件。 

照樣安裝VirtualBox Guest Addition後,再打開終端機輸入指令安裝此套件:

sudo apt-get update
sudo apt-get install virtualbox-guest-x11

遇到版本相容性提示訊息時,選擇安裝新版本。

再手動啟用共享剪貼簿功能即可:

sudo VBoxClient --clipboard

Drupal 8 在/admin/config頁面下新增分類

首先在自訂模組的links.menu.yml(例如your_custom_module.links.menu.yml)下新增以下內容:

system.admin_config_new:
title: 'My New Config'
route_name: system.admin_config_new
parent: system.admin_config

然後再在routing.yml(例如your_custom_module.routing.yml)新增內容:

system.admin_config_new:
  path: '/admin/config/new'
  defaults:
    _controller: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage'
    _title: 'My New Config'
  requirements:
    _permission: 'access administration pages'

清除緩存後即會生效。

以上代碼中請將自行將route名改為想要的名字,path和title同理。

Node Sass Watch不能正常使用的暫時代替方案

不知為何自從node-sass升級後,-w的選項就一直沒有生效過--能執行成功,但無法偵測指定Sass/Scss檔案的修改,這樣在無法使用IDE(例如在伺服器作業)的情況下編譯檔案會變得有點麻煩。

目前想到的解決方法是改用Gulp 監視檔案修改,有點麻煩但最少有效。

  1. 安裝gulp和gulp-sass:
npm install gulp gulp-sass
yarn add gulp gulp-sass

2.創建gulpfile.js,輸入以下內容:

vi gulpfile.js

const gulp = require('gulp');
const sass = require('gulp-sass');

gulp.task('watch', function () {
  gulp.watch('./css/*.scss', gulp.series('build:scss'));
});

gulp.task('build:scss', function() {
    return gulp.src('./css/style.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('./css/'));
});

3.在Package.json加入Watch指令:

  "scripts": {
    "watch": "./node_modules/.bin/gulp watch"
  }

4.想要編譯Sass/Scss檔案時,運行Watch指令:

npm run watch
yarn watch

完成。逃避可恥但有用,對吧?