sujingjhong.com


除錯日記#5 Debian

今天一整天都在除錯 debian…

MacOS 可以安裝 .deb 檔案嘛? #

答案是不行 。原本查到可以用 MacPorts 安裝 deb ,結果是一個名叫 deb 的套件。

所以只能請同事弄台 debian/ubuntu 虛擬機給我測試用。

要怎麼切換預設 shell? #

用 chsh 切換

chsh -s $(which zsh) $(whoami)

另外記得要確認 which 的值在不在,我因為沒裝 zsh,導致寫了空字串進去,root 就壞了。

後來是強者同事幫我用 livecd 掛載 host disk 幫我解決。

要怎麼切換語言包? #

查了蠻多的,後來有用的是直接安裝全部語言包

sudo apt install locales-all

查過沒用的:連結一連結二

執行 appimage 時出現 failed to exec fusermount #

fuse: failed to exec fusermount: No such file or directory

Cannot mount AppImage, please check your FUSE setup.
You might still be able to extract the contents of this AppImage
if you run it with the --appimage-extract option.
See https://github.com/AppImage/AppImageKit/wiki/FUSE
for more information
open dir error: No such file or directory

指南網站建議的方式

sudo apt install fuse libfuse2
sudo modprobe fuse
sudo groupadd fuse

user="$(whoami)"
sudo usermod -a -G fuse $user

不過我執行下面這行就可以了:

sudo apt install fuse libfuse2

要如何升級到 Debian 12 #

原本虛擬機是用 Debian 10 然後一堆東西不能使用,只好升級。

不過升級途中有些東西沒裝好,導致之後出現 SSH 拒絕連線。最後還是請同事直接幫我開台到 Debian 12 的解決。

但還是附上一下 網路上找到的指令

# Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Debian 10
apt-get -y update
apt-get -y upgrade
apt-get -y full-upgrade

cat > /etc/apt/sources.list <<"EOF"
deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/debian-security stable-security/updates main
deb-src http://security.debian.org/debian-security stable-security/updates main
deb http://deb.debian.org/debian/ bullseye-updates main
deb-src http://deb.debian.org/debian/ bullseye-updates main
EOF

apt-get clean
apt-get -y update

apt-get -y upgrade
apt-get -y full-upgrade

shutdown -r now

# Debian 11

cat > /etc/apt/sources.list <<"EOF"
deb http://deb.debian.org/debian/ bookworm main
deb-src http://deb.debian.org/debian/ bookworm main
deb http://security.debian.org/debian-security stable-security/updates main
deb-src http://security.debian.org/debian-security stable-security/updates main
deb http://deb.debian.org/debian/ bookworm-updates main
deb-src http://deb.debian.org/debian/ bookworm-updates main
EOF

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BDE6D2B9216EC7A8

apt-get clean
apt-get -y update

apt-get -y upgrade
apt-get -y full-upgrade

# issue with libcrypt.so.1
cd /tmp
apt -y download libcrypt1
dpkg-deb -x libcrypt1_1%3a4.4.25-2_amd64.deb .
cp -av lib/x86_64-linux-gnu/* /lib/x86_64-linux-gnu/
apt -y --fix-broken install

apt-get -y upgrade
apt-get -y full-upgrade

apt-get -y auto-remove
shutdown -r now

另外 有網友提到如果安裝過程出現 broken dependencies ,可以改成用

- apt-get -y upgrade
+ apt-get -y upgrade --without-new-pkgs