我最近尝试安装 OBS 进行录制。输入 sudo apt-get install obs-studio 后,我得到:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libavdevice57 libdc1394-22 libfdk-aac1 libluajit-5.1-2 libluajit-5.1-common
libmbedcrypto1 libmbedtls10 libmbedx509-0 libqt5x11extras5 libsdl2-2.0-0
The following packages will be REMOVED:
linux-image-4.18.0-22-generic linux-image-4.18.0-24-generic
The following NEW packages will be installed:
libavdevice57 libdc1394-22 libfdk-aac1 libluajit-5.1-2 libluajit-5.1-common
libmbedcrypto1 libmbedtls10 libmbedx509-0 libqt5x11extras5 libsdl2-2.0-0
obs-studio
0 upgraded, 11 newly installed, 2 to remove and 0 not upgraded.
5 not fully installed or removed.
Need to get 0 B/4.822 kB of archives.
After this operation, 56,3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 216936 files and directories currently installed.)
Removing linux-image-4.18.0-22-generic (4.18.0-22.23~18.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.18.0-22-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 38: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-4.18.0-22-generic (--remove):
installed linux-image-4.18.0-22-generic package post-removal script subprocess returned error exit status 1
Removing linux-image-4.18.0-24-generic (4.18.0-24.25~18.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.18.0-24-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 38: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-4.18.0-24-generic (--remove):
installed linux-image-4.18.0-24-generic package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.18.0-22-generic
linux-image-4.18.0-24-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
linux-image-4.18.0-22-generic 和 linux-image-4.18.0-24-generic 这两个软件包似乎有问题。我尝试了几种方法来解决这个问题,包括:
$ sudo apt-get dist-upgrade 和 $ sudo apt-get autoremove --purge
但都没有起到作用,问题仍然持续发生。
如果有人提出其他解决方案我将不胜感激。
编辑:我试图更改 usr/sbin/grub-mkconfig 文件,但是
prefix="/usr"
exec_prefix="/usr"
sbindir="${exec_prefix}/sbin"
bindir="${exec_prefix}/bin"
sysconfdir="/etc"
PACKAGE_NAME=GRUB
PACKAGE_VERSION=2.02-2ubuntu8.13
host_os=linux-gnu
datadir="${datarootdir}"
if [ "x$pkgdatadir" = x ]; then
pkgdatadir="${datadir}/grub"
fi
# export it for scripts
export pkgdatadir
grub_cfg=""
grub_mkconfig_dir="${sysconfdir}"/grub.d
self=`basename $0`
pkgdatardir
第 38 行(export和之间的行grub_cfg=""
)似乎为空,我无法发现代码中的语法错误
编辑2:错误可能出在etc/default/grub
,但是,所述文件只有 37 行:
GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.cik_support=0 amdgpu.cik_support=1
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
最后编辑:更改GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.cik_support=0 amdgpu.cik_support=1
为
GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.cik_support=0 amdgpu.cik_support=1"
工作完美。谢谢你的回答!
答案1
您忘记在第一行末尾添加结束引号。
您需要将其从
GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.cik_support=0 amdgpu.cik_support=1
到
GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.cik_support=0 amdgpu.cik_support=1"
然后注释掉第二GRUB_CMDLINE_LINUX_DEFAULT
行,
然后手动运行sudo update-grub
。