我运行了一个可能损害了 Ubuntu 的“过时”命令!

San*_*dro 1 command-line midi

我运行了一个可能危险且不可预测的命令,我需要帮助来恢复它可能所做的任何更改。如果可能,不重新安装 Ubuntu。我需要确保我没有在安装旧软件时出现严重的兼容性问题。因为如果是这样的话,我以后可能会有很多bug和问题,这就是原因。

情况:我试图解决 MIDI 问题。所以我找到了这个页面,找到了这个命令并运行它:

sudo aptitude --purge reinstall linux-sound-base alsa-base alsa-utils linux-image-`uname -r` linux-ubuntu-modules-`uname -r` libasound2
Run Code Online (Sandbox Code Playgroud)

我在询问后给予了 root 权限。危险的部分是,即使在 Ubuntu 帮助页面上建议了该命令,该页面本身也会在顶部说它已过时,不应多次使用。

这是官方提示(并以键入的命令开头)。你能告诉我它是否损坏了我的机器吗?我想它可能已经安装了非常旧的软件,因为教程中的说明没有被推荐。怎样才能回到以前?或者根本就没有问题?

qwerty@qwerty-RV420-RV520-RV720-E3530-S3530:~$ sudo aptitude --purge reinstall linux-sound-base alsa-base alsa-utils linux-image-`uname -r` linux-ubuntu-modules-`uname -r` libasound2
Couldn't find any package whose name or description matched "linux-ubuntu-modules-3.19.0-42-generic"
Couldn't find any package whose name or description matched "linux-ubuntu-modules-3.19.0-42-generic"
The following packages will be REINSTALLED:
  alsa-base alsa-utils libasound2 linux-image-3.19.0-42-generic 
  linux-sound-base 
0 packages upgraded, 0 newly installed, 5 reinstalled, 0 to remove and 6 not upgraded.
Need to get 1.427 kB/18,2 MB of archives. After unpacking 0 B will be used.
Get: 1 http://ar.archive.ubuntu.com/ubuntu/ trusty/main libasound2 amd64 1.0.27.2-3ubuntu7 [327 kB]
Get: 2 http://ar.archive.ubuntu.com/ubuntu/ trusty/main alsa-base all 1.0.25+dfsg-0ubuntu4 [151 kB]
Get: 3 http://ar.archive.ubuntu.com/ubuntu/ trusty/main alsa-utils amd64 1.0.27.2-1ubuntu2 [933 kB]
Get: 4 http://ar.archive.ubuntu.com/ubuntu/ trusty/main linux-sound-base all 1.0.25+dfsg-0ubuntu4 [14,5 kB]
Fetched 1.427 kB in 6s (215 kB/s)                                               
Preconfiguring packages ...
(Reading database ... 198306 files and directories currently installed.)
Preparing to unpack .../libasound2_1.0.27.2-3ubuntu7_amd64.deb ...
Unpacking libasound2:amd64 (1.0.27.2-3ubuntu7) over (1.0.27.2-3ubuntu7) ...
Preparing to unpack .../linux-image-3.19.0-42-generic_3.19.0-42.48~14.04.1_amd64.deb ...
Done.
Unpacking linux-image-3.19.0-42-generic (3.19.0-42.48~14.04.1) over (3.19.0-42.48~14.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
run-parts: executing /etc/kernel/postrm.d/zz-extlinux 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.19.0-42-generic.efi.signed...
P: Writing config for /boot/vmlinuz-3.19.0-42-generic...
P: Writing config for /boot/vmlinuz-3.19.0-25-generic...
P: Writing config for Windows 7 (loader) on /dev/sda1...
P: Writing config for Windows Recovery Environment (loader) on /dev/sda4...
P: Installing debian theme... done.
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
Preparing to unpack .../alsa-base_1.0.25+dfsg-0ubuntu4_all.deb ...
Unpacking alsa-base (1.0.25+dfsg-0ubuntu4) over (1.0.25+dfsg-0ubuntu4) ...
Preparing to unpack .../alsa-utils_1.0.27.2-1ubuntu2_amd64.deb ...
Unpacking alsa-utils (1.0.27.2-1ubuntu2) over (1.0.27.2-1ubuntu2) ...
Preparing to unpack .../linux-sound-base_1.0.25+dfsg-0ubuntu4_all.deb ...
Unpacking linux-sound-base (1.0.25+dfsg-0ubuntu4) over (1.0.25+dfsg-0ubuntu4) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up libasound2:amd64 (1.0.27.2-3ubuntu7) ...
Setting up linux-image-3.19.0-42-generic (3.19.0-42.48~14.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled 
(3.19.0-42.48~14.04.1 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled 
(3.19.0-42.48~14.04.1 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
update-initramfs: Generating /boot/initrd.img-3.19.0-42-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
run-parts: executing /etc/kernel/postinst.d/zz-extlinux 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
P: Checking for EXTLINUX directory... found.
P: Writing config for /boot/vmlinuz-3.19.0-42-generic.efi.signed...
P: Writing config for /boot/vmlinuz-3.19.0-42-generic...
P: Writing config for /boot/vmlinuz-3.19.0-25-generic...
P: Writing config for Windows 7 (loader) on /dev/sda1...
P: Writing config for Windows Recovery Environment (loader) on /dev/sda4...
P: Installing debian theme... done.
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.19.0-42-generic /boot/vmlinuz-3.19.0-42-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.19.0-42-generic
Found initrd image: /boot/initrd.img-3.19.0-42-generic
Found linux image: /boot/vmlinuz-3.19.0-25-generic
Found initrd image: /boot/initrd.img-3.19.0-25-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Windows Recovery Environment (loader) on /dev/sda4
Found Debian GNU/Linux (8.2) on /dev/sda5
done
Setting up linux-sound-base (1.0.25+dfsg-0ubuntu4) ...
Setting up alsa-base (1.0.25+dfsg-0ubuntu4) ...
Setting up alsa-utils (1.0.27.2-1ubuntu2) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Run Code Online (Sandbox Code Playgroud)

Rap*_*ael 6

根据 aptitude --help

purge - 删除包及其配置文件。

重新安装 - 下载并(可能)重新安装当前安装的软件包。

所以,您所做的是,您已经清除了命令中的软件包并重新安装了它们。到目前为止,一切都很好,但是您的命令中只有一个部分可能会导致一些问题。它说的命令部分:

linux-image-`uname -r`
Run Code Online (Sandbox Code Playgroud)

删除您的活动内核,然后重新安装它。虽然它最不可能发生,但在极端情况下它可能会给你带来一些问题。除此之外一切正常。

从您的输出来看,似乎没有错误,一切都应该如此。

如果您仍然不确定 - 使用以下命令检查已清除软件包的版本和其他所有内容:

apt-cache policy linux-sound-base alsa-base alsa-utils linux-image-`uname -r` libasound2
Run Code Online (Sandbox Code Playgroud)