无法将 xlock 下载到 Ubuntu 18.04

无法将 xlock 下载到 Ubuntu 18.04

我一直在尝试使用命令安装 xlock

sudo apt-get install xlock

它输出这个而不是安装 xlock:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package xlock is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'xlock' has no installation candidate

在尝试安装 xlock 之前我已经分别执行了以下两个命令:

sudo apt-get update 
sudo apt-get upgrade

如果读者认为 xlock 不存在,这里是其手册页的 URL:这里

我是 Linux 新手(六个月用户),所以我还不是很了解。请帮忙。

答案1

您选择了错误的包裹:包裹xclock中可用x11-apps
检查https://packages.ubuntu.com

所以正确的命令是:

sudo apt-get install x11-apps

command-not-found此外,如果您不知道/不记得包名称,您可以在终端中输入其可执行文件名称以获取工具的建议:

$ xlock

Command 'xlock' not found, did you mean:

  command 'lxlock' from deb lxlock
  command 'slock' from deb suckless-tools
  command 'vlock' from deb vlock
  command 'flock' from deb util-linux
  command 'rlock' from deb ruby-lockfile
  command 'wlock' from deb sendfile
  command 'xclock' from deb x11-apps
  command 'mlock' from deb mlock

Try: sudo apt install <deb name>

$ xclock 

Command 'xclock' not found, but can be installed with:

sudo apt install x11-apps

如果你真的想说xlock,那么根据它的Ubuntuman xlock-页在 Ubuntu 12.04 LTS 之后它被删除

我发现PPA ppa:chaocrator-ppa/anarchy(它有适用于 16.04 LTS 的软件包,但没有适用于 18.04 LTS 的软件包)带有所需的xlockmore-gl软件包。您可以使用以下命令安装它:

cd ~/Downloads
wget http://ppa.launchpad.net/chaocrator-ppa/anarchy/ubuntu/pool/main/x/xlockmore/xlockmore-gl_5.31-0~xenial_amd64.deb
sudo apt-get install ./xlockmore-gl_5.31-0~xenial_amd64.deb

答案2

您可以手动下载并安装:

1. Download archive from http://sillycycle.com/xlock/
2. Unpack (into e.g. /tmp/xlockmore)
3. Install build deps: apt install build-essential libx11-dev libxext-dev libxt-dev
4. cd /tmp/xlockmore; ./configure; make; make install

相关内容